Skip to content

Commit 052e0e8

Browse files
GuillaumeGomeztgross35
authored andcommitted
Add missing filedesc and fdescenttbl in FreeBSD
[ edited the message to be more specific - Trevor ] (backport <#4327>) (cherry picked from commit a23e0e0)
1 parent dca8f09 commit 052e0e8

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
@@ -1357,6 +1357,47 @@ s! {
13571357
pub strchange_instrms: u16,
13581358
pub strchange_outstrms: u16,
13591359
}
1360+
1361+
pub struct filedesc {
1362+
pub fd_files: *mut fdescenttbl,
1363+
pub fd_map: *mut c_ulong,
1364+
pub fd_freefile: c_int,
1365+
pub fd_refcnt: c_int,
1366+
pub fd_holdcnt: c_int,
1367+
fd_sx: sx,
1368+
fd_kqlist: kqlist,
1369+
pub fd_holdleaderscount: c_int,
1370+
pub fd_holdleaderswakeup: c_int,
1371+
}
1372+
1373+
pub struct fdescenttbl {
1374+
pub fdt_nfiles: c_int,
1375+
fdt_ofiles: [*mut c_void; 0],
1376+
}
1377+
1378+
// FIXME: Should be private.
1379+
#[doc(hidden)]
1380+
pub struct sx {
1381+
lock_object: lock_object,
1382+
sx_lock: crate::uintptr_t,
1383+
}
1384+
1385+
// FIXME: Should be private.
1386+
#[doc(hidden)]
1387+
pub struct lock_object {
1388+
lo_name: *const c_char,
1389+
lo_flags: c_uint,
1390+
lo_data: c_uint,
1391+
// This is normally `struct witness`.
1392+
lo_witness: *mut c_void,
1393+
}
1394+
1395+
// FIXME: Should be private.
1396+
#[doc(hidden)]
1397+
pub struct kqlist {
1398+
tqh_first: *mut c_void,
1399+
tqh_last: *mut *mut c_void,
1400+
}
13601401
}
13611402

13621403
s_no_extra_traits! {

0 commit comments

Comments
 (0)