Skip to content

feat: add new struct definitions from fanotify linux api #3449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,8 @@ fn test_linux(target: &str) {
"type_"
if struct_ == "input_event"
|| struct_ == "input_mask"
|| struct_ == "ff_effect" =>
|| struct_ == "ff_effect"
|| struct_ == "fanotify_response_info_header" =>
{
"type".to_string()
}
Expand Down
7 changes: 7 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,7 @@ MAP_STACK
MAP_TYPE
MAXTTL
MAX_ADDR_LEN
MAX_HANDLE_SZ
MAX_IPOPTLEN
MCAST_BLOCK_SOURCE
MCAST_EXCLUDE
Expand Down Expand Up @@ -3435,10 +3436,16 @@ execvpe
faccessat
fallocate
fallocate64
fanotify_event_info_error
fanotify_event_info_fid
fanotify_event_info_header
fanotify_event_info_pidfd
fanotify_event_metadata
fanotify_init
fanotify_mark
fanotify_response
fanotify_response_info_header
fanotify_response_info_audit_rule
fchdir
fdatasync
fdopendir
Expand Down
38 changes: 37 additions & 1 deletion src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,45 @@ s! {
pub len: u32
}

pub struct fanotify_event_info_header {
pub info_type: ::__u8,
_pad: ::__u8,
pub len: ::__u16,
}

pub struct fanotify_event_info_fid {
pub hdr: fanotify_event_info_header,
pub fsid: ::fsid_t,
pub handle: [::c_uchar; 0],
}

pub struct fanotify_event_info_pidfd {
pub hdr: fanotify_event_info_header,
pub pidfd: ::__s32,
}

pub struct fanotify_event_info_error {
pub hdr: fanotify_event_info_header,
pub error: ::__s32,
pub error_count: ::__u32,
}

pub struct fanotify_response {
pub fd: ::c_int,
pub response: __u32,
pub response: ::__u32,
}

pub struct fanotify_response_info_header {
pub type_: ::__u8,
pub pad: ::__u8,
pub len: ::__u16,
}

pub struct fanotify_response_info_audit_rule {
pub hdr: fanotify_response_info_header,
pub rule_number: ::__u32,
pub subj_trust: ::__u32,
pub obj_trust: ::__u32,
}

pub struct sockaddr_vm {
Expand Down