Skip to content

Commit 3ba96df

Browse files
chriswailestgross35
authored andcommitted
Clean up CLONE_ definitions
This CL moves all `CLONE_` constant definitions into `src/unix/linux_like/mod.rs` as there are no differences between the GNU, MUSL, and Android BIONIC definitions of these constants.
1 parent 78196ba commit 3ba96df

File tree

9 files changed

+7
-37
lines changed

9 files changed

+7
-37
lines changed

libc-test/semver/android.txt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -236,32 +236,8 @@ CLOCK_REALTIME_ALARM
236236
CLOCK_REALTIME_COARSE
237237
CLOCK_TAI
238238
CLOCK_THREAD_CPUTIME_ID
239-
CLONE_CHILD_CLEARTID
240-
CLONE_CHILD_SETTID
241239
CLONE_CLEAR_SIGHAND
242-
CLONE_DETACHED
243-
CLONE_FILES
244-
CLONE_FS
245240
CLONE_INTO_CGROUP
246-
CLONE_IO
247-
CLONE_NEWCGROUP
248-
CLONE_NEWIPC
249-
CLONE_NEWNET
250-
CLONE_NEWNS
251-
CLONE_NEWPID
252-
CLONE_NEWUSER
253-
CLONE_NEWUTS
254-
CLONE_PARENT
255-
CLONE_PARENT_SETTID
256-
CLONE_PIDFD
257-
CLONE_PTRACE
258-
CLONE_SETTLS
259-
CLONE_SIGHAND
260-
CLONE_SYSVSEM
261-
CLONE_THREAD
262-
CLONE_UNTRACED
263-
CLONE_VFORK
264-
CLONE_VM
265241
CMSG_DATA
266242
CMSG_FIRSTHDR
267243
CMSG_LEN

libc-test/semver/linux-gnu.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ BPF_FS_MAGIC
3131
BTRFS_SUPER_MAGIC
3232
CGROUP2_SUPER_MAGIC
3333
CGROUP_SUPER_MAGIC
34-
CLONE_CLEAR_SIGHAND
35-
CLONE_INTO_CGROUP
36-
CLONE_NEWTIME
3734
CODA_SUPER_MAGIC
3835
CRAMFS_MAGIC
3936
DEAD_PROCESS

libc-test/semver/linux-musl.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ AIO_ALLDONE
66
AIO_CANCELED
77
AIO_NOTCANCELED
88
BOOT_TIME
9-
CLONE_NEWTIME
109
DEAD_PROCESS
1110
EMPTY
1211
Elf32_Chdr

libc-test/semver/linux.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,18 @@ CLOCK_TAI
273273
CLOCK_THREAD_CPUTIME_ID
274274
CLONE_CHILD_CLEARTID
275275
CLONE_CHILD_SETTID
276+
CLONE_CLEAR_SIGHAND
276277
CLONE_DETACHED
277278
CLONE_FILES
278279
CLONE_FS
280+
CLONE_INTO_CGROUP
279281
CLONE_IO
280282
CLONE_NEWCGROUP
281283
CLONE_NEWIPC
282284
CLONE_NEWNET
283285
CLONE_NEWNS
284286
CLONE_NEWPID
287+
CLONE_NEWTIME
285288
CLONE_NEWUSER
286289
CLONE_NEWUTS
287290
CLONE_PARENT

src/unix/linux_like/android/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2849,7 +2849,6 @@ pub const SCHED_DEADLINE: c_int = 6;
28492849

28502850
pub const SCHED_RESET_ON_FORK: c_int = 0x40000000;
28512851

2852-
pub const CLONE_PIDFD: c_int = 0x1000;
28532852
pub const CLONE_CLEAR_SIGHAND: c_ulonglong = 0x100000000;
28542853
pub const CLONE_INTO_CGROUP: c_ulonglong = 0x200000000;
28552854

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,6 @@ pub const GENL_ID_PMCRAID: c_int = crate::NLMSG_MIN_TYPE + 2;
889889

890890
pub const ELFOSABI_ARM_AEABI: u8 = 64;
891891

892-
// linux/sched.h
893-
pub const CLONE_NEWTIME: c_int = 0x80;
894-
pub const CLONE_CLEAR_SIGHAND: c_ulonglong = 0x100000000;
895-
pub const CLONE_INTO_CGROUP: c_ulonglong = 0x200000000;
896-
897892
// linux/keyctl.h
898893
pub const KEYCTL_DH_COMPUTE: u32 = 23;
899894
pub const KEYCTL_PKEY_QUERY: u32 = 24;

src/unix/linux_like/linux/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5635,7 +5635,8 @@ pub const SCHED_DEADLINE: c_int = 6;
56355635

56365636
pub const SCHED_RESET_ON_FORK: c_int = 0x40000000;
56375637

5638-
pub const CLONE_PIDFD: c_int = 0x1000;
5638+
pub const CLONE_CLEAR_SIGHAND: c_ulonglong = 0x100000000;
5639+
pub const CLONE_INTO_CGROUP: c_ulonglong = 0x200000000;
56395640

56405641
pub const SCHED_FLAG_RESET_ON_FORK: c_int = 0x01;
56415642
pub const SCHED_FLAG_RECLAIM: c_int = 0x02;

src/unix/linux_like/linux/musl/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,8 +835,6 @@ pub const MAXTC: c_long = 6;
835835
pub const _CS_V6_ENV: c_int = 1148;
836836
pub const _CS_V7_ENV: c_int = 1149;
837837

838-
pub const CLONE_NEWTIME: c_int = 0x80;
839-
840838
pub const UT_HOSTSIZE: usize = 256;
841839
pub const UT_LINESIZE: usize = 32;
842840
pub const UT_NAMESIZE: usize = 32;

src/unix/linux_like/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,10 +1199,12 @@ pub const ONLRET: crate::tcflag_t = 0o000040;
11991199
pub const OFILL: crate::tcflag_t = 0o000100;
12001200
pub const OFDEL: crate::tcflag_t = 0o000200;
12011201

1202+
pub const CLONE_NEWTIME: c_int = 0x80;
12021203
pub const CLONE_VM: c_int = 0x100;
12031204
pub const CLONE_FS: c_int = 0x200;
12041205
pub const CLONE_FILES: c_int = 0x400;
12051206
pub const CLONE_SIGHAND: c_int = 0x800;
1207+
pub const CLONE_PIDFD: c_int = 0x1000;
12061208
pub const CLONE_PTRACE: c_int = 0x2000;
12071209
pub const CLONE_VFORK: c_int = 0x4000;
12081210
pub const CLONE_PARENT: c_int = 0x8000;

0 commit comments

Comments
 (0)