Skip to content

Commit c1044df

Browse files
committed
Add constants from linux/cn_proc.h and linux/connector.h
1 parent 50a2acf commit c1044df

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3789,6 +3789,8 @@ fn test_linux(target: &str) {
37893789
"linux/can.h",
37903790
"linux/can/raw.h",
37913791
"linux/can/j1939.h",
3792+
"linux/cn_proc.h",
3793+
"linux/connector.h",
37923794
"linux/dccp.h",
37933795
"linux/errqueue.h",
37943796
"linux/falloc.h",
@@ -4573,6 +4575,9 @@ fn test_linux(target: &str) {
45734575
// FIXME(linux): Requires >= 6.4 kernel headers.
45744576
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
45754577

4578+
// FIXME(linux): Requires >= 6.6 kernel headers.
4579+
"PROC_EVENT_NONZERO_EXIT" => true,
4580+
45764581
_ => false,
45774582
}
45784583
});

src/unix/linux_like/linux/mod.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,6 +4708,51 @@ pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22;
47084708
pub const RTNLGRP_TUNNEL: c_uint = 0x23;
47094709
pub const RTNLGRP_STATS: c_uint = 0x24;
47104710

4711+
// linux/cn_proc.h
4712+
c_enum! {
4713+
proc_cn_mcast_op {
4714+
PROC_CN_MCAST_LISTEN = 1,
4715+
PROC_CN_MCAST_IGNORE = 2,
4716+
}
4717+
}
4718+
4719+
c_enum! {
4720+
proc_cn_event {
4721+
PROC_EVENT_NONE = 0x00000000,
4722+
PROC_EVENT_FORK = 0x00000001,
4723+
PROC_EVENT_EXEC = 0x00000002,
4724+
PROC_EVENT_UID = 0x00000004,
4725+
PROC_EVENT_GID = 0x00000040,
4726+
PROC_EVENT_SID = 0x00000080,
4727+
PROC_EVENT_PTRACE = 0x00000100,
4728+
PROC_EVENT_COMM = 0x00000200,
4729+
PROC_EVENT_NONZERO_EXIT = 0x20000000,
4730+
PROC_EVENT_COREDUMP = 0x40000000,
4731+
PROC_EVENT_EXIT = 0x80000000,
4732+
}
4733+
}
4734+
4735+
// linux/connector.h
4736+
pub const CN_IDX_PROC: c_uint = 0x1;
4737+
pub const CN_VAL_PROC: c_uint = 0x1;
4738+
pub const CN_IDX_CIFS: c_uint = 0x2;
4739+
pub const CN_VAL_CIFS: c_uint = 0x1;
4740+
pub const CN_W1_IDX: c_uint = 0x3;
4741+
pub const CN_W1_VAL: c_uint = 0x1;
4742+
pub const CN_IDX_V86D: c_uint = 0x4;
4743+
pub const CN_VAL_V86D_UVESAFB: c_uint = 0x1;
4744+
pub const CN_IDX_BB: c_uint = 0x5;
4745+
pub const CN_DST_IDX: c_uint = 0x6;
4746+
pub const CN_DST_VAL: c_uint = 0x1;
4747+
pub const CN_IDX_DM: c_uint = 0x7;
4748+
pub const CN_VAL_DM_USERSPACE_LOG: c_uint = 0x1;
4749+
pub const CN_IDX_DRBD: c_uint = 0x8;
4750+
pub const CN_VAL_DRBD: c_uint = 0x1;
4751+
pub const CN_KVP_IDX: c_uint = 0x9;
4752+
pub const CN_KVP_VAL: c_uint = 0x1;
4753+
pub const CN_VSS_IDX: c_uint = 0xA;
4754+
pub const CN_VSS_VAL: c_uint = 0x1;
4755+
47114756
// linux/module.h
47124757
pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
47134758
pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;

0 commit comments

Comments
 (0)