File: ksysent.sed

package info (click to toggle)
strace 5.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 49,332 kB
  • sloc: ansic: 113,177; sh: 8,831; makefile: 3,108; awk: 364; perl: 267; sed: 9
file content (31 lines) | stat: -rw-r--r-- 1,189 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sed -rnf
#
# Copyright (c) 2015-2019 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later

# should not have been exported at all
/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|arm_sync_file_range|syscalls|syscall_count|syscall_max|available|reserved|unused)/d

# remove new aliases to traditional names on alpha
/#define[[:space:]]+__NR_get[gup]id[[:space:]]+__NR_getx[gup]id$/d

# should not have been named this way
s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/

# legacy names
s/__NR_get_cpu/__NR_getcpu/
s/__NR_madvise1/__NR_madvise/
s/__NR_paccept/__NR_accept4/

# generate

# prioritize __NR_umount over __NR_umount2
s/#define[[:space:]]+__NR_(umount)2([[:space:]].*)?$/#if defined __NR_\12 \&\& (!defined __NR_\1 || __NR_\1 != __NR_\12)\n[__NR_\12 \& 0xffff] = "\12",\n#endif/p

# prioritize __NR_osf_shmat over __NR_shmat
s/#define[[:space:]]+__NR_(shmat)([[:space:]].*)?$/#if defined __NR_\1 \&\& (!defined __NR_osf_\1 || __NR_osf_\1 != __NR_\1)\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p

# generic
s/#define[[:space:]]+__NR_([a-z_][^[:space:]]+)([[:space:]].*)?$/#ifdef __NR_\1\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p