Skip to content

Commit edb7c11

Browse files
committed
Auto merge of #743 - Susurrus:syscalls, r=alexcrichton
Add syscall constants to more Android/Linux targets Primarily adding `SYS_memfd_create` and `SYS_pivot_root` for `nix`. But I also equalized a few constants across platforms so some of the other ones that were defined on some targets are now defined across all linux/android targets.
2 parents 2f4ca87 + deb30e5 commit edb7c11

File tree

13 files changed

+38
-4
lines changed

13 files changed

+38
-4
lines changed

src/unix/notbsd/android/b32/arm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
66
pub const O_NOFOLLOW: ::c_int = 0x8000;
77
pub const O_LARGEFILE: ::c_int = 0o400000;
88

9+
pub const SYS_pivot_root: ::c_long = 218;
910
pub const SYS_gettid: ::c_long = 224;
11+
pub const SYS_perf_event_open: ::c_long = 364;
12+
pub const SYS_memfd_create: ::c_long = 385;

src/unix/notbsd/android/b64/aarch64.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ pub const O_DIRECTORY: ::c_int = 0x4000;
5454
pub const O_NOFOLLOW: ::c_int = 0x8000;
5555
pub const O_LARGEFILE: ::c_int = 0o400000;
5656

57+
pub const SYS_pivot_root: ::c_long = 41;
5758
pub const SYS_gettid: ::c_long = 178;
59+
pub const SYS_perf_event_open: ::c_long = 241;
60+
pub const SYS_memfd_create: ::c_long = 279;
5861

5962
pub const SIGSTKSZ: ::size_t = 16384;
6063
pub const MINSIGSTKSZ: ::size_t = 5120;

src/unix/notbsd/linux/mips/mips32.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,8 @@ pub const O_LARGEFILE: ::c_int = 0x2000;
269269

270270
pub const RLIM_INFINITY: ::rlim_t = 0x7fffffff;
271271

272-
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
272+
// Valid for O32
273+
pub const SYS_pivot_root: ::c_long = 4216;
274+
pub const SYS_gettid: ::c_long = 4222;
275+
pub const SYS_perf_event_open: ::c_long = 4333;
276+
pub const SYS_memfd_create: ::c_long = 4354;

src/unix/notbsd/linux/mips/mips64.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,7 @@ pub const O_LARGEFILE: ::c_int = 0;
251251

252252
pub const RLIM_INFINITY: ::rlim_t = 0xffff_ffff_ffff_ffff;
253253

254-
pub const SYS_gettid: ::c_long = 5178; // Valid for n64
254+
// Valid for n64
255+
pub const SYS_pivot_root: ::c_long = 5151;
256+
pub const SYS_gettid: ::c_long = 5178;
257+
pub const SYS_memfd_create: ::c_long = 5314;

src/unix/notbsd/linux/musl/b32/arm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,10 @@ pub const TIOCMSET: ::c_int = 0x5418;
371371
pub const FIONREAD: ::c_int = 0x541B;
372372
pub const TIOCCONS: ::c_int = 0x541D;
373373

374+
pub const SYS_pivot_root: ::c_long = 218;
374375
pub const SYS_gettid: ::c_long = 224;
375376
pub const SYS_perf_event_open: ::c_long = 364;
377+
pub const SYS_memfd_create: ::c_long = 385;
376378

377379
pub const POLLWRNORM: ::c_short = 0x100;
378380
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b32/mips.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,11 @@ pub const TIOCMSET: ::c_int = 0x741A;
382382
pub const FIONREAD: ::c_int = 0x467F;
383383
pub const TIOCCONS: ::c_int = 0x80047478;
384384

385-
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
386-
pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
385+
// Valid for O32
386+
pub const SYS_pivot_root: ::c_long = 4216;
387+
pub const SYS_gettid: ::c_long = 4222;
388+
pub const SYS_perf_event_open: ::c_long = 4333;
389+
pub const SYS_memfd_create: ::c_long = 4354;
387390

388391
pub const POLLWRNORM: ::c_short = 0x4;
389392
pub const POLLWRBAND: ::c_short = 0x100;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
pub type c_char = u8;
22
pub type __u64 = ::c_ulonglong;
33

4+
pub const SYS_pivot_root: ::c_long = 41;
5+
pub const SYS_gettid: ::c_long = 178;
46
pub const SYS_perf_event_open: ::c_long = 241;
7+
pub const SYS_memfd_create: ::c_long = 279;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
pub type c_char = u8;
22
pub type __u64 = ::c_ulong;
33

4+
pub const SYS_pivot_root: ::c_long = 203;
5+
pub const SYS_gettid: ::c_long = 207;
46
pub const SYS_perf_event_open: ::c_long = 319;
7+
pub const SYS_memfd_create: ::c_long = 360;

src/unix/notbsd/linux/other/b32/arm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ pub const SO_RCVBUFFORCE: ::c_int = 33;
125125
pub const FIOCLEX: ::c_ulong = 0x5451;
126126
pub const FIONBIO: ::c_ulong = 0x5421;
127127

128+
pub const SYS_pivot_root: ::c_long = 218;
128129
pub const SYS_gettid: ::c_long = 224;
129130
pub const SYS_perf_event_open: ::c_long = 364;
131+
pub const SYS_memfd_create: ::c_long = 385;
130132

131133
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
132134
pub const PTRACE_SETFPXREGS: ::c_uint = 19;

src/unix/notbsd/linux/other/b32/powerpc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ pub const SO_PEERCRED: ::c_int = 21;
126126
pub const FIOCLEX: ::c_ulong = 0x20006601;
127127
pub const FIONBIO: ::c_ulong = 0x8004667e;
128128

129+
pub const SYS_pivot_root: ::c_long = 203;
129130
pub const SYS_gettid: ::c_long = 207;
130131
pub const SYS_perf_event_open: ::c_long = 319;
132+
pub const SYS_memfd_create: ::c_long = 360;
131133

132134
pub const MCL_CURRENT: ::c_int = 0x2000;
133135
pub const MCL_FUTURE: ::c_int = 0x4000;

src/unix/notbsd/linux/other/b64/aarch64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,10 @@ pub const EDEADLOCK: ::c_int = 35;
367367
pub const FIOCLEX: ::c_ulong = 0x5451;
368368
pub const FIONBIO: ::c_ulong = 0x5421;
369369

370+
pub const SYS_pivot_root: ::c_long = 41;
370371
pub const SYS_gettid: ::c_long = 178;
371372
pub const SYS_perf_event_open: ::c_long = 241;
373+
pub const SYS_memfd_create: ::c_long = 279;
372374

373375
pub const MCL_CURRENT: ::c_int = 0x0001;
374376
pub const MCL_FUTURE: ::c_int = 0x0002;

src/unix/notbsd/linux/other/b64/powerpc64.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,10 @@ pub const EDEADLOCK: ::c_int = 58;
365365
pub const FIOCLEX: ::c_ulong = 0x20006601;
366366
pub const FIONBIO: ::c_ulong = 0x8004667e;
367367

368+
pub const SYS_pivot_root: ::c_long = 203;
368369
pub const SYS_gettid: ::c_long = 207;
369370
pub const SYS_perf_event_open: ::c_long = 319;
371+
pub const SYS_memfd_create: ::c_long = 360;
370372

371373
pub const MCL_CURRENT: ::c_int = 0x2000;
372374
pub const MCL_FUTURE: ::c_int = 0x4000;

src/unix/notbsd/linux/s390x.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,10 @@ pub const LINUX_REBOOT_CMD_RESTART2: ::c_int = 0xA1B2C3D4;
800800
pub const LINUX_REBOOT_CMD_SW_SUSPEND: ::c_int = 0xD000FCE2;
801801
pub const LINUX_REBOOT_CMD_KEXEC: ::c_int = 0x45584543;
802802

803+
pub const SYS_pivot_root: ::c_long = 217;
803804
pub const SYS_gettid: ::c_long = 236;
804805
pub const SYS_perf_event_open: ::c_long = 331;
806+
pub const SYS_memfd_create: ::c_long = 350;
805807

806808
pub const VTIME: usize = 5;
807809
pub const VSWTC: usize = 7;

0 commit comments

Comments
 (0)