Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ s! {
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut c_void,
pub ki_fd: *mut crate::filedesc,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut c_void,
Expand Down
3 changes: 1 addition & 2 deletions src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ s! {
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut c_void,
pub ki_fd: *mut crate::filedesc,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut c_void,
Expand Down
3 changes: 1 addition & 2 deletions src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ s! {
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut c_void,
pub ki_fd: *mut crate::filedesc,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut c_void,
Expand Down
3 changes: 1 addition & 2 deletions src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ s! {
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut c_void,
pub ki_fd: *mut crate::filedesc,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut c_void,
Expand Down
3 changes: 1 addition & 2 deletions src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ s! {
// This is normally "struct vnode".
/// Pointer to executable file.
pub ki_textvp: *mut c_void,
// This is normally "struct filedesc".
/// Pointer to open file info.
pub ki_fd: *mut c_void,
pub ki_fd: *mut crate::filedesc,
// This is normally "struct vmspace".
/// Pointer to kernel vmspace struct.
pub ki_vmspace: *mut c_void,
Expand Down
41 changes: 41 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,47 @@ s! {
pub strchange_instrms: u16,
pub strchange_outstrms: u16,
}

pub struct filedesc {
pub fd_files: *mut fdescenttbl,
pub fd_map: *mut c_ulong,
pub fd_freefile: c_int,
pub fd_refcnt: c_int,
pub fd_holdcnt: c_int,
fd_sx: sx,
fd_kqlist: kqlist,
pub fd_holdleaderscount: c_int,
pub fd_holdleaderswakeup: c_int,
}

pub struct fdescenttbl {
pub fdt_nfiles: c_int,
fdt_ofiles: [*mut c_void; 0],
}

// FIXME: Should be private.
#[doc(hidden)]
pub struct sx {
lock_object: lock_object,
sx_lock: crate::uintptr_t,
}

// FIXME: Should be private.
#[doc(hidden)]
pub struct lock_object {
lo_name: *const c_char,
lo_flags: c_uint,
lo_data: c_uint,
// This is normally `struct witness`.
lo_witness: *mut c_void,
}

// FIXME: Should be private.
#[doc(hidden)]
pub struct kqlist {
tqh_first: *mut c_void,
tqh_last: *mut *mut c_void,
}
}

s_no_extra_traits! {
Expand Down
Loading