Skip to content

Commit 6337752

Browse files
committed
feat: add new struct definitions from fanotify linux api
1 parent 4ac74f5 commit 6337752

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

libc-test/semver/linux.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ MAP_STACK
14231423
MAP_TYPE
14241424
MAXTTL
14251425
MAX_ADDR_LEN
1426+
MAX_HANDLE_SZ
14261427
MAX_IPOPTLEN
14271428
MCAST_BLOCK_SOURCE
14281429
MCAST_EXCLUDE
@@ -3435,10 +3436,16 @@ execvpe
34353436
faccessat
34363437
fallocate
34373438
fallocate64
3439+
fanotify_event_info_error
3440+
fanotify_event_info_fid
3441+
fanotify_event_info_header
3442+
fanotify_event_info_pidfd
34383443
fanotify_event_metadata
34393444
fanotify_init
34403445
fanotify_mark
34413446
fanotify_response
3447+
fanotify_response_info_header
3448+
fanotify_response_info_audit_rule
34423449
fchdir
34433450
fdatasync
34443451
fdopendir

src/unix/linux_like/linux/mod.rs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,45 @@ s! {
503503
pub len: u32
504504
}
505505

506+
pub struct fanotify_event_info_header {
507+
pub info_type: ::__u8,
508+
_pad: ::__u8,
509+
pub len: ::__u16,
510+
}
511+
512+
pub struct fanotify_event_info_fid {
513+
pub hdr: fanotify_event_info_header,
514+
pub fsid: ::fsid_t,
515+
pub handle: [::c_uchar; ::MAX_HANDLE_SZ],
516+
}
517+
518+
pub struct fanotify_event_info_pidfd {
519+
pub hdr: fanotify_event_info_header,
520+
pub pidfd: ::__s32,
521+
}
522+
523+
pub struct fanotify_event_info_error {
524+
pub hdr: fanotify_event_info_header,
525+
pub error: ::__s32,
526+
pub error_count: ::__u32,
527+
}
528+
506529
pub struct fanotify_response {
507530
pub fd: ::c_int,
508-
pub response: __u32,
531+
pub response: ::__u32,
532+
}
533+
534+
pub struct fanotify_response_info_header {
535+
pub type_: ::__u8,
536+
pub pad: ::__u8,
537+
pub len: ::__u16,
538+
}
539+
540+
pub struct fanotify_response_info_audit_rule {
541+
pub hdr: fanotify_response_info_header,
542+
pub rule_number: ::__u32,
543+
pub subj_trust: ::__u32,
544+
pub obj_trust: ::__u32,
509545
}
510546

511547
pub struct sockaddr_vm {
@@ -3958,6 +3994,9 @@ pub const SND_CNT: usize = SND_MAX as usize + 1;
39583994
pub const UINPUT_VERSION: ::c_uint = 5;
39593995
pub const UINPUT_MAX_NAME_SIZE: usize = 80;
39603996

3997+
// linux/exportfs.h
3998+
pub const MAX_HANDLE_SZ: usize = 128;
3999+
39614000
// uapi/linux/fanotify.h
39624001
pub const FAN_ACCESS: u64 = 0x0000_0001;
39634002
pub const FAN_MODIFY: u64 = 0x0000_0002;

0 commit comments

Comments
 (0)