Skip to content

Add constants from linux/cn_proc.h and linux/connector.h #4434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,8 @@ fn test_linux(target: &str) {
"linux/can.h",
"linux/can/raw.h",
"linux/can/j1939.h",
"linux/cn_proc.h",
"linux/connector.h",
"linux/dccp.h",
"linux/errqueue.h",
"linux/falloc.h",
Expand Down
37 changes: 37 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4708,6 +4708,43 @@ pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22;
pub const RTNLGRP_TUNNEL: c_uint = 0x23;
pub const RTNLGRP_STATS: c_uint = 0x24;

// linux/cn_proc.h
pub const PROC_CN_MCAST_LISTEN: c_int = 1;
pub const PROC_CN_MCAST_IGNORE: c_int = 2;

pub const PROC_EVENT_NONE: c_int = 0x00000000;
pub const PROC_EVENT_FORK: c_int = 0x00000001;
pub const PROC_EVENT_EXEC: c_int = 0x00000002;
pub const PROC_EVENT_UID: c_int = 0x00000004;
pub const PROC_EVENT_GID: c_int = 0x00000040;
pub const PROC_EVENT_SID: c_int = 0x00000080;
pub const PROC_EVENT_PTRACE: c_int = 0x00000100;
pub const PROC_EVENT_COMM: c_int = 0x00000200;
pub const PROC_EVENT_NONZERO_EXIT: c_int = 0x20000000;
pub const PROC_EVENT_COREDUMP: c_int = 0x40000000;
pub const PROC_EVENT_EXIT: c_int = 0x80000000;

// linux/connector.h
pub const CN_IDX_PROC: c_int = 0x1;
pub const CN_VAL_PROC: c_int = 0x1;
pub const CN_IDX_CIFS: c_int = 0x2;
pub const CN_VAL_CIFS: c_int = 0x1;
pub const CN_W1_IDX: c_int = 0x3;
pub const CN_W1_VAL: c_int = 0x1;
pub const CN_IDX_V86D: c_int = 0x4;
pub const CN_VAL_V86D_UVESAFB: c_int = 0x1;
pub const CN_IDX_BB: c_int = 0x5;
pub const CN_DST_IDX: c_int = 0x6;
pub const CN_DST_VAL: c_int = 0x1;
pub const CN_IDX_DM: c_int = 0x7;
pub const CN_VAL_DM_USERSPACE_LOG: c_int = 0x1;
pub const CN_IDX_DRBD: c_int = 0x8;
pub const CN_VAL_DRBD: c_int = 0x1;
pub const CN_KVP_IDX: c_int = 0x9;
pub const CN_KVP_VAL: c_int = 0x1;
pub const CN_VSS_IDX: c_int = 0xA;
pub const CN_VSS_VAL: c_int = 0x1;

// linux/module.h
pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001;
pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002;
Expand Down
Loading