Skip to content

Commit 60e12f7

Browse files
committed
Add constants from linux/cn_proc.h and linux/connector.h
1 parent 181b043 commit 60e12f7

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",
@@ -4589,6 +4591,9 @@ fn test_linux(target: &str) {
45894591
// FIXME(linux): Requires >= 6.4 kernel headers.
45904592
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
45914593

4594+
// FIXME(linux): Requires >= 6.6 kernel headers.
4595+
"PROC_EVENT_NONZERO_EXIT" => true,
4596+
45924597
_ => false,
45934598
}
45944599
});

src/unix/linux_like/linux/mod.rs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4741,6 +4741,51 @@ pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22;
47414741
pub const RTNLGRP_TUNNEL: c_uint = 0x23;
47424742
pub const RTNLGRP_STATS: c_uint = 0x24;
47434743

4744+
// linux/cn_proc.h
4745+
c_enum! {
4746+
proc_cn_mcast_op {
4747+
PROC_CN_MCAST_LISTEN = 1,
4748+
PROC_CN_MCAST_IGNORE = 2,
4749+
}
4750+
}
4751+
4752+
c_enum! {
4753+
proc_cn_event {
4754+
PROC_EVENT_NONE = 0x00000000,
4755+
PROC_EVENT_FORK = 0x00000001,
4756+
PROC_EVENT_EXEC = 0x00000002,
4757+
PROC_EVENT_UID = 0x00000004,
4758+
PROC_EVENT_GID = 0x00000040,
4759+
PROC_EVENT_SID = 0x00000080,
4760+
PROC_EVENT_PTRACE = 0x00000100,
4761+
PROC_EVENT_COMM = 0x00000200,
4762+
PROC_EVENT_NONZERO_EXIT = 0x20000000,
4763+
PROC_EVENT_COREDUMP = 0x40000000,
4764+
PROC_EVENT_EXIT = 0x80000000,
4765+
}
4766+
}
4767+
4768+
// linux/connector.h
4769+
pub const CN_IDX_PROC: c_uint = 0x1;
4770+
pub const CN_VAL_PROC: c_uint = 0x1;
4771+
pub const CN_IDX_CIFS: c_uint = 0x2;
4772+
pub const CN_VAL_CIFS: c_uint = 0x1;
4773+
pub const CN_W1_IDX: c_uint = 0x3;
4774+
pub const CN_W1_VAL: c_uint = 0x1;
4775+
pub const CN_IDX_V86D: c_uint = 0x4;
4776+
pub const CN_VAL_V86D_UVESAFB: c_uint = 0x1;
4777+
pub const CN_IDX_BB: c_uint = 0x5;
4778+
pub const CN_DST_IDX: c_uint = 0x6;
4779+
pub const CN_DST_VAL: c_uint = 0x1;
4780+
pub const CN_IDX_DM: c_uint = 0x7;
4781+
pub const CN_VAL_DM_USERSPACE_LOG: c_uint = 0x1;
4782+
pub const CN_IDX_DRBD: c_uint = 0x8;
4783+
pub const CN_VAL_DRBD: c_uint = 0x1;
4784+
pub const CN_KVP_IDX: c_uint = 0x9;
4785+
pub const CN_KVP_VAL: c_uint = 0x1;
4786+
pub const CN_VSS_IDX: c_uint = 0xA;
4787+
pub const CN_VSS_VAL: c_uint = 0x1;
4788+
47444789
// linux/module.h
47454790
pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
47464791
pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;

0 commit comments

Comments
 (0)