Skip to content

Commit 3dd6220

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

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4708,6 +4708,47 @@ 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+
pub const PROC_CN_MCAST_LISTEN: c_int = 1;
4713+
pub const PROC_CN_MCAST_IGNORE: c_int = 2;
4714+
4715+
c_enum! {
4716+
proc_cn_event {
4717+
PROC_EVENT_NONE = 0x00000000,
4718+
PROC_EVENT_FORK = 0x00000001,
4719+
PROC_EVENT_EXEC = 0x00000002,
4720+
PROC_EVENT_UID = 0x00000004,
4721+
PROC_EVENT_GID = 0x00000040,
4722+
PROC_EVENT_SID = 0x00000080,
4723+
PROC_EVENT_PTRACE = 0x00000100,
4724+
PROC_EVENT_COMM = 0x00000200,
4725+
PROC_EVENT_NONZERO_EXIT = 0x20000000,
4726+
PROC_EVENT_COREDUMP = 0x40000000,
4727+
PROC_EVENT_EXIT = 0x80000000,
4728+
}
4729+
}
4730+
4731+
// linux/connector.h
4732+
pub const CN_IDX_PROC: c_int = 0x1;
4733+
pub const CN_VAL_PROC: c_int = 0x1;
4734+
pub const CN_IDX_CIFS: c_int = 0x2;
4735+
pub const CN_VAL_CIFS: c_int = 0x1;
4736+
pub const CN_W1_IDX: c_int = 0x3;
4737+
pub const CN_W1_VAL: c_int = 0x1;
4738+
pub const CN_IDX_V86D: c_int = 0x4;
4739+
pub const CN_VAL_V86D_UVESAFB: c_int = 0x1;
4740+
pub const CN_IDX_BB: c_int = 0x5;
4741+
pub const CN_DST_IDX: c_int = 0x6;
4742+
pub const CN_DST_VAL: c_int = 0x1;
4743+
pub const CN_IDX_DM: c_int = 0x7;
4744+
pub const CN_VAL_DM_USERSPACE_LOG: c_int = 0x1;
4745+
pub const CN_IDX_DRBD: c_int = 0x8;
4746+
pub const CN_VAL_DRBD: c_int = 0x1;
4747+
pub const CN_KVP_IDX: c_int = 0x9;
4748+
pub const CN_KVP_VAL: c_int = 0x1;
4749+
pub const CN_VSS_IDX: c_int = 0xA;
4750+
pub const CN_VSS_VAL: c_int = 0x1;
4751+
47114752
// linux/module.h
47124753
pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
47134754
pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;

0 commit comments

Comments
 (0)