Skip to content

Commit 139801f

Browse files
authored
Merge pull request #4327 from GuillaumeGomez/missing-freebsd-items
Add missing `filedesc` and `fdescenttbl` in FreeBSD
2 parents 2d82b0e + a23e0e0 commit 139801f

File tree

6 files changed

+46
-10
lines changed

6 files changed

+46
-10
lines changed

src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ s! {
5151
// This is normally "struct vnode".
5252
/// Pointer to executable file.
5353
pub ki_textvp: *mut c_void,
54-
// This is normally "struct filedesc".
5554
/// Pointer to open file info.
56-
pub ki_fd: *mut c_void,
55+
pub ki_fd: *mut crate::filedesc,
5756
// This is normally "struct vmspace".
5857
/// Pointer to kernel vmspace struct.
5958
pub ki_vmspace: *mut c_void,

src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ s! {
5959
// This is normally "struct vnode".
6060
/// Pointer to executable file.
6161
pub ki_textvp: *mut c_void,
62-
// This is normally "struct filedesc".
6362
/// Pointer to open file info.
64-
pub ki_fd: *mut c_void,
63+
pub ki_fd: *mut crate::filedesc,
6564
// This is normally "struct vmspace".
6665
/// Pointer to kernel vmspace struct.
6766
pub ki_vmspace: *mut c_void,

src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ s! {
6969
// This is normally "struct vnode".
7070
/// Pointer to executable file.
7171
pub ki_textvp: *mut c_void,
72-
// This is normally "struct filedesc".
7372
/// Pointer to open file info.
74-
pub ki_fd: *mut c_void,
73+
pub ki_fd: *mut crate::filedesc,
7574
// This is normally "struct vmspace".
7675
/// Pointer to kernel vmspace struct.
7776
pub ki_vmspace: *mut c_void,

src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ s! {
6969
// This is normally "struct vnode".
7070
/// Pointer to executable file.
7171
pub ki_textvp: *mut c_void,
72-
// This is normally "struct filedesc".
7372
/// Pointer to open file info.
74-
pub ki_fd: *mut c_void,
73+
pub ki_fd: *mut crate::filedesc,
7574
// This is normally "struct vmspace".
7675
/// Pointer to kernel vmspace struct.
7776
pub ki_vmspace: *mut c_void,

src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ s! {
6969
// This is normally "struct vnode".
7070
/// Pointer to executable file.
7171
pub ki_textvp: *mut c_void,
72-
// This is normally "struct filedesc".
7372
/// Pointer to open file info.
74-
pub ki_fd: *mut c_void,
73+
pub ki_fd: *mut crate::filedesc,
7574
// This is normally "struct vmspace".
7675
/// Pointer to kernel vmspace struct.
7776
pub ki_vmspace: *mut c_void,

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,47 @@ s! {
13551355
pub strchange_instrms: u16,
13561356
pub strchange_outstrms: u16,
13571357
}
1358+
1359+
pub struct filedesc {
1360+
pub fd_files: *mut fdescenttbl,
1361+
pub fd_map: *mut c_ulong,
1362+
pub fd_freefile: c_int,
1363+
pub fd_refcnt: c_int,
1364+
pub fd_holdcnt: c_int,
1365+
fd_sx: sx,
1366+
fd_kqlist: kqlist,
1367+
pub fd_holdleaderscount: c_int,
1368+
pub fd_holdleaderswakeup: c_int,
1369+
}
1370+
1371+
pub struct fdescenttbl {
1372+
pub fdt_nfiles: c_int,
1373+
fdt_ofiles: [*mut c_void; 0],
1374+
}
1375+
1376+
// FIXME: Should be private.
1377+
#[doc(hidden)]
1378+
pub struct sx {
1379+
lock_object: lock_object,
1380+
sx_lock: crate::uintptr_t,
1381+
}
1382+
1383+
// FIXME: Should be private.
1384+
#[doc(hidden)]
1385+
pub struct lock_object {
1386+
lo_name: *const c_char,
1387+
lo_flags: c_uint,
1388+
lo_data: c_uint,
1389+
// This is normally `struct witness`.
1390+
lo_witness: *mut c_void,
1391+
}
1392+
1393+
// FIXME: Should be private.
1394+
#[doc(hidden)]
1395+
pub struct kqlist {
1396+
tqh_first: *mut c_void,
1397+
tqh_last: *mut *mut c_void,
1398+
}
13581399
}
13591400

13601401
s_no_extra_traits! {

0 commit comments

Comments
 (0)