Skip to content

Commit b8c947c

Browse files
committed
linux: add PIDFD_NONBLOCK and organize pidfd constants
1 parent 9c2df3f commit b8c947c

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

  • src/unix/linux_like/linux

src/unix/linux_like/linux/mod.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,32 +1600,29 @@ pub const NS_MNT_GET_NEXT: Ioctl = _IOR::<mnt_ns_info>(NSIO, 11);
16001600
pub const NS_MNT_GET_PREV: Ioctl = _IOR::<mnt_ns_info>(NSIO, 12);
16011601

16021602
// linux/pidfd.h
1603-
pub const PIDFD_NONBLOCK: c_uint = O_NONBLOCK as c_uint;
1604-
pub const PIDFD_THREAD: c_uint = O_EXCL as c_uint;
1605-
1606-
pub const PIDFD_SIGNAL_THREAD: c_uint = 1 << 0;
1607-
pub const PIDFD_SIGNAL_THREAD_GROUP: c_uint = 1 << 1;
1608-
pub const PIDFD_SIGNAL_PROCESS_GROUP: c_uint = 1 << 2;
1609-
1610-
pub const PIDFD_INFO_PID: c_uint = 1 << 0;
1611-
pub const PIDFD_INFO_CREDS: c_uint = 1 << 1;
1612-
pub const PIDFD_INFO_CGROUPID: c_uint = 1 << 2;
1613-
pub const PIDFD_INFO_EXIT: c_uint = 1 << 3;
1614-
1615-
pub const PIDFD_INFO_SIZE_VER0: c_uint = 64;
1616-
16171603
const PIDFS_IOCTL_MAGIC: c_uint = 0xFF;
1604+
16181605
pub const PIDFD_GET_CGROUP_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 1);
1606+
pub const PIDFD_GET_INFO: Ioctl = _IOWR::<pidfd_info>(PIDFS_IOCTL_MAGIC, 11);
16191607
pub const PIDFD_GET_IPC_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 2);
16201608
pub const PIDFD_GET_MNT_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 3);
16211609
pub const PIDFD_GET_NET_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 4);
1622-
pub const PIDFD_GET_PID_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 5);
16231610
pub const PIDFD_GET_PID_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 6);
1624-
pub const PIDFD_GET_TIME_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 7);
1611+
pub const PIDFD_GET_PID_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 5);
16251612
pub const PIDFD_GET_TIME_FOR_CHILDREN_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 8);
1613+
pub const PIDFD_GET_TIME_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 7);
16261614
pub const PIDFD_GET_USER_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 9);
16271615
pub const PIDFD_GET_UTS_NAMESPACE: Ioctl = _IO(PIDFS_IOCTL_MAGIC, 10);
1628-
pub const PIDFD_GET_INFO: Ioctl = _IOWR::<pidfd_info>(PIDFS_IOCTL_MAGIC, 11);
1616+
pub const PIDFD_INFO_CGROUPID: c_uint = 1 << 2;
1617+
pub const PIDFD_INFO_CREDS: c_uint = 1 << 1;
1618+
pub const PIDFD_INFO_EXIT: c_uint = 1 << 3;
1619+
pub const PIDFD_INFO_PID: c_uint = 1 << 0;
1620+
pub const PIDFD_INFO_SIZE_VER0: c_uint = 64;
1621+
pub const PIDFD_NONBLOCK: crate::c_int = 0x00000800;
1622+
pub const PIDFD_SIGNAL_PROCESS_GROUP: c_uint = 1 << 2;
1623+
pub const PIDFD_SIGNAL_THREAD: c_uint = 1 << 0;
1624+
pub const PIDFD_SIGNAL_THREAD_GROUP: c_uint = 1 << 1;
1625+
pub const PIDFD_THREAD: c_uint = O_EXCL as c_uint;
16291626

16301627
pub const PR_SET_MDWE: c_int = 65;
16311628
pub const PR_GET_MDWE: c_int = 66;

0 commit comments

Comments
 (0)