Skip to content

Commit 14b941f

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

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

libc-test/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,8 @@ fn test_linux(target: &str) {
34953495
"type_"
34963496
if struct_ == "input_event"
34973497
|| struct_ == "input_mask"
3498-
|| struct_ == "ff_effect" =>
3498+
|| struct_ == "ff_effect"
3499+
|| struct_ == "fanotify_response_info_header" =>
34993500
{
35003501
"type".to_string()
35013502
}

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: 37 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; 0],
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 {

0 commit comments

Comments
 (0)