Skip to content

Commit d06f4f5

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. (backport <rust-lang#4672>) (cherry picked from commit 3ba96df)
1 parent 00d08b7 commit d06f4f5

File tree

9 files changed

+7
-38
lines changed

9 files changed

+7
-38
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
@@ -2883,7 +2883,6 @@ pub const SCHED_DEADLINE: c_int = 6;
28832883

28842884
pub const SCHED_RESET_ON_FORK: c_int = 0x40000000;
28852885

2886-
pub const CLONE_PIDFD: c_int = 0x1000;
28872886
pub const CLONE_CLEAR_SIGHAND: c_ulonglong = 0x100000000;
28882887
pub const CLONE_INTO_CGROUP: c_ulonglong = 0x200000000;
28892888

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -886,12 +886,6 @@ pub const GENL_ID_PMCRAID: c_int = crate::NLMSG_MIN_TYPE + 2;
886886

887887
pub const ELFOSABI_ARM_AEABI: u8 = 64;
888888

889-
// linux/sched.h
890-
pub const CLONE_NEWTIME: c_int = 0x80;
891-
// DIFF(main): changed to `c_ulonglong` in e9abac9ac2
892-
pub const CLONE_CLEAR_SIGHAND: c_int = 0x100000000;
893-
pub const CLONE_INTO_CGROUP: c_int = 0x200000000;
894-
895889
// linux/keyctl.h
896890
pub const KEYCTL_DH_COMPUTE: u32 = 23;
897891
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
@@ -5665,7 +5665,8 @@ pub const SCHED_DEADLINE: c_int = 6;
56655665

56665666
pub const SCHED_RESET_ON_FORK: c_int = 0x40000000;
56675667

5668-
pub const CLONE_PIDFD: c_int = 0x1000;
5668+
pub const CLONE_CLEAR_SIGHAND: c_ulonglong = 0x100000000;
5669+
pub const CLONE_INTO_CGROUP: c_ulonglong = 0x200000000;
56695670

56705671
pub const SCHED_FLAG_RESET_ON_FORK: c_int = 0x01;
56715672
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
@@ -834,8 +834,6 @@ pub const MAXTC: c_long = 6;
834834
pub const _CS_V6_ENV: c_int = 1148;
835835
pub const _CS_V7_ENV: c_int = 1149;
836836

837-
pub const CLONE_NEWTIME: c_int = 0x80;
838-
839837
pub const UT_HOSTSIZE: usize = 256;
840838
pub const UT_LINESIZE: usize = 32;
841839
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
@@ -1164,10 +1164,12 @@ pub const ONLRET: crate::tcflag_t = 0o000040;
11641164
pub const OFILL: crate::tcflag_t = 0o000100;
11651165
pub const OFDEL: crate::tcflag_t = 0o000200;
11661166

1167+
pub const CLONE_NEWTIME: c_int = 0x80;
11671168
pub const CLONE_VM: c_int = 0x100;
11681169
pub const CLONE_FS: c_int = 0x200;
11691170
pub const CLONE_FILES: c_int = 0x400;
11701171
pub const CLONE_SIGHAND: c_int = 0x800;
1172+
pub const CLONE_PIDFD: c_int = 0x1000;
11711173
pub const CLONE_PTRACE: c_int = 0x2000;
11721174
pub const CLONE_VFORK: c_int = 0x4000;
11731175
pub const CLONE_PARENT: c_int = 0x8000;

0 commit comments

Comments
 (0)