Skip to content

Commit 23f6e65

Browse files
committed
Auto merge of #3463 - mbyzhang:master, r=JohnTitor
Move common Linux ptrace definitions to linux_like/mod.rs Move common Linux ptrace definitions to linux_like/mod.rs.
2 parents 1e755f9 + 62e017f commit 23f6e65

File tree

20 files changed

+146
-325
lines changed

20 files changed

+146
-325
lines changed

libc-test/semver/android.txt

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,43 +1889,6 @@ PTHREAD_MUTEX_NORMAL
18891889
PTHREAD_MUTEX_RECURSIVE
18901890
PTHREAD_RWLOCK_INITIALIZER
18911891
PTHREAD_STACK_MIN
1892-
PTRACE_ATTACH
1893-
PTRACE_CONT
1894-
PTRACE_DETACH
1895-
PTRACE_EVENT_CLONE
1896-
PTRACE_EVENT_EXEC
1897-
PTRACE_EVENT_EXIT
1898-
PTRACE_EVENT_FORK
1899-
PTRACE_EVENT_SECCOMP
1900-
PTRACE_EVENT_STOP
1901-
PTRACE_EVENT_VFORK
1902-
PTRACE_EVENT_VFORK_DONE
1903-
PTRACE_GETEVENTMSG
1904-
PTRACE_GETSIGINFO
1905-
PTRACE_KILL
1906-
PTRACE_O_EXITKILL
1907-
PTRACE_O_MASK
1908-
PTRACE_O_SUSPEND_SECCOMP
1909-
PTRACE_O_TRACECLONE
1910-
PTRACE_O_TRACEEXEC
1911-
PTRACE_O_TRACEEXIT
1912-
PTRACE_O_TRACEFORK
1913-
PTRACE_O_TRACESECCOMP
1914-
PTRACE_O_TRACESYSGOOD
1915-
PTRACE_O_TRACEVFORK
1916-
PTRACE_O_TRACEVFORKDONE
1917-
PTRACE_PEEKDATA
1918-
PTRACE_PEEKTEXT
1919-
PTRACE_PEEKUSER
1920-
PTRACE_POKEDATA
1921-
PTRACE_POKETEXT
1922-
PTRACE_POKEUSER
1923-
PTRACE_SECCOMP_GET_METADATA
1924-
PTRACE_SETOPTIONS
1925-
PTRACE_SETSIGINFO
1926-
PTRACE_SINGLESTEP
1927-
PTRACE_SYSCALL
1928-
PTRACE_TRACEME
19291892
PT_HIOS
19301893
PT_LOPROC
19311894
PT_HIPROC
@@ -3474,7 +3437,6 @@ pthread_spin_unlock
34743437
pthread_spinlock_t
34753438
pthread_t
34763439
ptrace
3477-
ptrace_peeksiginfo_args
34783440
ptrdiff_t
34793441
ptsname
34803442
ptsname_r
@@ -3538,7 +3500,6 @@ sched_setparam
35383500
sched_setscheduler
35393501
sched_yield
35403502
seccomp_data
3541-
seccomp_metadata
35423503
seekdir
35433504
select
35443505
sem_close

libc-test/semver/linux-gnu-x86_64.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ NFT_MSG_NEWOBJ
1919
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
2020
PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
2121
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
22-
PTRACE_GET_RSEQ_CONFIGURATION
2322
PTRACE_SYSEMU
2423
PTRACE_SYSEMU_SINGLESTEP
2524
_libc_fpstate
2625
flock64
2726
getcontext
2827
makecontext
29-
ptrace_rseq_configuration
3028
setcontext
3129
swapcontext
3230
termios2

libc-test/semver/linux-gnu.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,6 @@ PR_SET_VMA
363363
PR_SET_VMA_ANON_NAME
364364
PROC_SUPER_MAGIC
365365
PTHREAD_MUTEX_ADAPTIVE_NP
366-
PTRACE_GET_SYSCALL_INFO
367-
PTRACE_SYSCALL_INFO_ENTRY
368-
PTRACE_SYSCALL_INFO_EXIT
369-
PTRACE_SYSCALL_INFO_NONE
370-
PTRACE_SYSCALL_INFO_SECCOMP
371366
QNX4_SUPER_MAGIC
372367
QNX6_SUPER_MAGIC
373368
RDTGROUP_SUPER_MAGIC
@@ -644,8 +639,6 @@ pthread_attr_setaffinity_np
644639
pthread_rwlockattr_getkind_np
645640
pthread_rwlockattr_getpshared
646641
pthread_rwlockattr_setkind_np
647-
ptrace_peeksiginfo_args
648-
ptrace_syscall_info
649642
pututxline
650643
pwritev2
651644
pwritev64

libc-test/semver/linux.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2005,6 +2005,8 @@ PTRACE_GETEVENTMSG
20052005
PTRACE_GETREGSET
20062006
PTRACE_GETSIGINFO
20072007
PTRACE_GETSIGMASK
2008+
PTRACE_GET_SYSCALL_INFO
2009+
PTRACE_GET_RSEQ_CONFIGURATION
20082010
PTRACE_INTERRUPT
20092011
PTRACE_KILL
20102012
PTRACE_LISTEN
@@ -2026,13 +2028,19 @@ PTRACE_PEEKUSER
20262028
PTRACE_POKEDATA
20272029
PTRACE_POKETEXT
20282030
PTRACE_POKEUSER
2031+
PTRACE_SECCOMP_GET_FILTER
2032+
PTRACE_SECCOMP_GET_METADATA
20292033
PTRACE_SEIZE
20302034
PTRACE_SETOPTIONS
20312035
PTRACE_SETREGSET
20322036
PTRACE_SETSIGINFO
20332037
PTRACE_SETSIGMASK
20342038
PTRACE_SINGLESTEP
20352039
PTRACE_SYSCALL
2040+
PTRACE_SYSCALL_INFO_ENTRY
2041+
PTRACE_SYSCALL_INFO_EXIT
2042+
PTRACE_SYSCALL_INFO_NONE
2043+
PTRACE_SYSCALL_INFO_SECCOMP
20362044
PTRACE_TRACEME
20372045
PT_HIOS
20382046
PT_HISUNW
@@ -3707,6 +3715,9 @@ pthread_barrier_t
37073715
pthread_once
37083716
pthread_once_t
37093717
ptrace
3718+
ptrace_rseq_configuration
3719+
ptrace_peeksiginfo_args
3720+
ptrace_syscall_info
37103721
ptsname_r
37113722
pwrite64
37123723
pwritev
@@ -3747,6 +3758,7 @@ sched_setparam
37473758
sched_setscheduler
37483759
sctp_assoc_t
37493760
seccomp_data
3761+
seccomp_metadata
37503762
seed48
37513763
seekdir
37523764
sem_close

src/unix/linux_like/android/mod.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -352,17 +352,6 @@ s! {
352352
pub args: [::__u64; 6],
353353
}
354354

355-
pub struct seccomp_metadata {
356-
pub filter_off: ::__u64,
357-
pub flags: ::__u64,
358-
}
359-
360-
pub struct ptrace_peeksiginfo_args {
361-
pub off: ::__u64,
362-
pub flags: ::__u32,
363-
pub nr: ::__s32,
364-
}
365-
366355
// linux/input.h
367356
pub struct input_event {
368357
pub time: ::timeval,
@@ -1511,31 +1500,6 @@ pub const EXTPROC: ::tcflag_t = 0o200000;
15111500

15121501
pub const MAP_HUGETLB: ::c_int = 0x040000;
15131502

1514-
pub const PTRACE_TRACEME: ::c_int = 0;
1515-
pub const PTRACE_PEEKTEXT: ::c_int = 1;
1516-
pub const PTRACE_PEEKDATA: ::c_int = 2;
1517-
pub const PTRACE_PEEKUSER: ::c_int = 3;
1518-
pub const PTRACE_POKETEXT: ::c_int = 4;
1519-
pub const PTRACE_POKEDATA: ::c_int = 5;
1520-
pub const PTRACE_POKEUSER: ::c_int = 6;
1521-
pub const PTRACE_CONT: ::c_int = 7;
1522-
pub const PTRACE_KILL: ::c_int = 8;
1523-
pub const PTRACE_SINGLESTEP: ::c_int = 9;
1524-
pub const PTRACE_GETREGS: ::c_int = 12;
1525-
pub const PTRACE_SETREGS: ::c_int = 13;
1526-
pub const PTRACE_ATTACH: ::c_int = 16;
1527-
pub const PTRACE_DETACH: ::c_int = 17;
1528-
pub const PTRACE_SYSCALL: ::c_int = 24;
1529-
pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
1530-
pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
1531-
pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
1532-
pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
1533-
pub const PTRACE_GETREGSET: ::c_int = 0x4204;
1534-
pub const PTRACE_SETREGSET: ::c_int = 0x4205;
1535-
pub const PTRACE_SECCOMP_GET_METADATA: ::c_int = 0x420d;
1536-
1537-
pub const PTRACE_EVENT_STOP: ::c_int = 128;
1538-
15391503
pub const F_GETLK: ::c_int = 5;
15401504
pub const F_GETOWN: ::c_int = 9;
15411505
pub const F_SETOWN: ::c_int = 8;

src/unix/linux_like/emscripten/mod.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,37 +1250,6 @@ pub const CPU_SETSIZE: ::c_int = 128;
12501250

12511251
pub const QFMT_VFS_V1: ::c_int = 4;
12521252

1253-
pub const PTRACE_TRACEME: ::c_int = 0;
1254-
pub const PTRACE_PEEKTEXT: ::c_int = 1;
1255-
pub const PTRACE_PEEKDATA: ::c_int = 2;
1256-
pub const PTRACE_PEEKUSER: ::c_int = 3;
1257-
pub const PTRACE_POKETEXT: ::c_int = 4;
1258-
pub const PTRACE_POKEDATA: ::c_int = 5;
1259-
pub const PTRACE_POKEUSER: ::c_int = 6;
1260-
pub const PTRACE_CONT: ::c_int = 7;
1261-
pub const PTRACE_KILL: ::c_int = 8;
1262-
pub const PTRACE_SINGLESTEP: ::c_int = 9;
1263-
pub const PTRACE_ATTACH: ::c_int = 16;
1264-
pub const PTRACE_DETACH: ::c_int = 17;
1265-
pub const PTRACE_SYSCALL: ::c_int = 24;
1266-
pub const PTRACE_SETOPTIONS: ::c_int = 0x4200;
1267-
pub const PTRACE_GETEVENTMSG: ::c_int = 0x4201;
1268-
pub const PTRACE_GETSIGINFO: ::c_int = 0x4202;
1269-
pub const PTRACE_SETSIGINFO: ::c_int = 0x4203;
1270-
pub const PTRACE_GETREGSET: ::c_int = 0x4204;
1271-
pub const PTRACE_SETREGSET: ::c_int = 0x4205;
1272-
pub const PTRACE_SEIZE: ::c_int = 0x4206;
1273-
pub const PTRACE_INTERRUPT: ::c_int = 0x4207;
1274-
pub const PTRACE_LISTEN: ::c_int = 0x4208;
1275-
pub const PTRACE_PEEKSIGINFO: ::c_int = 0x4209;
1276-
1277-
pub const PTRACE_GETFPREGS: ::c_uint = 14;
1278-
pub const PTRACE_SETFPREGS: ::c_uint = 15;
1279-
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
1280-
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
1281-
pub const PTRACE_GETREGS: ::c_uint = 12;
1282-
pub const PTRACE_SETREGS: ::c_uint = 13;
1283-
12841253
pub const EFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
12851254

12861255
pub const SFD_NONBLOCK: ::c_int = ::O_NONBLOCK;

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ cfg_if! {
176176

177177
pub const SA_ONSTACK: ::c_int = 1;
178178

179-
pub const PTRACE_DETACH: ::c_uint = 11;
180-
181179
pub const F_SETLK: ::c_int = 8;
182180
pub const F_SETLKW: ::c_int = 9;
183181

@@ -222,8 +220,6 @@ cfg_if! {
222220

223221
pub const SA_ONSTACK: ::c_int = 0x08000000;
224222

225-
pub const PTRACE_DETACH: ::c_uint = 17;
226-
227223
pub const F_SETLK: ::c_int = 6;
228224
pub const F_SETLKW: ::c_int = 7;
229225

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,6 @@ pub const POLLWRBAND: ::c_short = 0x200;
352352
pub const O_ASYNC: ::c_int = 0x2000;
353353
pub const O_NDELAY: ::c_int = 0x800;
354354

355-
pub const PTRACE_DETACH: ::c_uint = 17;
356-
357355
pub const EFD_NONBLOCK: ::c_int = 0x800;
358356

359357
pub const F_GETLK: ::c_int = 5;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@ pub const POLLWRBAND: ::c_short = 0x200;
774774

775775
pub const PTRACE_GETFPREGS: ::c_uint = 14;
776776
pub const PTRACE_SETFPREGS: ::c_uint = 15;
777-
pub const PTRACE_DETACH: ::c_uint = 17;
778777
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
779778
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
780779
pub const PTRACE_GETREGS: ::c_uint = 12;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ pub const TCSAFLUSH: ::c_int = 0x5410;
795795

796796
pub const PTRACE_GETFPREGS: ::c_uint = 14;
797797
pub const PTRACE_SETFPREGS: ::c_uint = 15;
798-
pub const PTRACE_DETACH: ::c_uint = 17;
799798
pub const PTRACE_GETFPXREGS: ::c_uint = 18;
800799
pub const PTRACE_SETFPXREGS: ::c_uint = 19;
801800
pub const PTRACE_GETREGS: ::c_uint = 12;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,6 @@ pub const POLLWRBAND: ::c_short = 0x200;
345345
pub const O_ASYNC: ::c_int = 0x2000;
346346
pub const O_NDELAY: ::c_int = 0x800;
347347

348-
pub const PTRACE_DETACH: ::c_uint = 17;
349-
350348
pub const EFD_NONBLOCK: ::c_int = 0x800;
351349

352350
pub const F_GETLK: ::c_int = 5;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ pub const POLLWRNORM: ::c_short = 256;
360360
pub const POLLWRBAND: ::c_short = 512;
361361
pub const O_ASYNC: ::c_int = 8192;
362362
pub const O_NDELAY: ::c_int = 2048;
363-
pub const PTRACE_DETACH: ::c_uint = 17;
364363
pub const EFD_NONBLOCK: ::c_int = 2048;
365364
pub const F_GETLK: ::c_int = 5;
366365
pub const F_GETOWN: ::c_int = 9;

src/unix/linux_like/linux/gnu/b64/s390x.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@ pub const FLUSHO: ::tcflag_t = 0x00001000;
477477

478478
pub const EXTPROC: ::tcflag_t = 0x00010000;
479479

480-
pub const PTRACE_DETACH: ::c_uint = 17;
481-
482480
pub const MCL_CURRENT: ::c_int = 0x0001;
483481
pub const MCL_FUTURE: ::c_int = 0x0002;
484482
pub const MCL_ONFAULT: ::c_int = 0x0004;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,6 @@ pub const POLLWRBAND: ::c_short = 0x100;
346346
pub const O_ASYNC: ::c_int = 0x40;
347347
pub const O_NDELAY: ::c_int = 0x4004;
348348

349-
pub const PTRACE_DETACH: ::c_uint = 17;
350-
351349
pub const EFD_NONBLOCK: ::c_int = 0x4000;
352350

353351
pub const F_GETLK: ::c_int = 7;

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,6 @@ s! {
265265
pub seccomp_notif_resp: ::__u16,
266266
pub seccomp_data: ::__u16,
267267
}
268-
269-
pub struct ptrace_rseq_configuration {
270-
pub rseq_abi_pointer: ::__u64,
271-
pub rseq_abi_size: ::__u32,
272-
pub signature: ::__u32,
273-
pub flags: ::__u32,
274-
pub pad: ::__u32,
275-
}
276268
}
277269

278270
s_no_extra_traits! {
@@ -542,9 +534,6 @@ pub const POLLWRBAND: ::c_short = 0x200;
542534
pub const O_ASYNC: ::c_int = 0x2000;
543535
pub const O_NDELAY: ::c_int = 0x800;
544536

545-
pub const PTRACE_DETACH: ::c_uint = 17;
546-
pub const PTRACE_GET_RSEQ_CONFIGURATION: ::c_uint = 0x420f;
547-
548537
pub const EFD_NONBLOCK: ::c_int = 0x800;
549538

550539
pub const F_GETLK: ::c_int = 5;

0 commit comments

Comments
 (0)