1/*
2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993 Ulrich Pegelow <pegelow@moorea.uni-muenster.de>
5 * Copyright (c) 1995, 1996 Michael Elizabeth Chastain <mec@duracef.shout.net>
6 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
7 * Copyright (C) 1998-2001 Wichert Akkerman <wakkerma@deephackmode.org>
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31*/
32// flag bit 7 is set 0, as const char*;
33// flag bit 7 is set 1, as void*, size indicate in next-arg;
34unsigned char syscall_param_flags[] = {
350x82, 3, //read=0
360x82, 3, //write=1
371, 3, //open=2
380, 1, //close=3
391, 2, //stat=4
400, 2, //fstat=5
411, 2, //lstat=6
420, 3, //poll=7
430, 3, //lseek=8
440, 6, //mmap=9
450, 3, //mprotect=10
460, 2, //munmap=11
470, 1, //brk=12
480, 4, //rt_sigaction=13
490, 4, //rt_sigprocmask=14
500, 0, //rt_sigreturn=15
510, 3, //ioctl=16
520x82, 4, //pread64=17
530x82, 4, //pwrite64=18
540, 3, //readv=19
550, 3, //writev=20
561, 2, //access=21
570, 1, //pipe=22
580, 5, //select=23
590, 0, //sched_yield=24
600, 5, //mremap=25
610, 3, //msync=26
620, 3, //mincore=27
630, 3, //madvise=28
640, 3, //shmget=29
650, 3, //shmat=30
660, 3, //shmctl=31
670, 1, //dup=32
680, 2, //dup2=33
690, 0, //pause=34
700, 2, //nanosleep=35
710, 2, //getitimer=36
720, 1, //alarm=37
730, 3, //setitimer=38
740, 0, //getpid=39
750, 4, //sendfile=40
760, 3, //socket=41
770, 3, //connect=42
780, 3, //accept=43
790x82, 6, //sendto=44
800x82, 6, //recvfrom=45
810, 3, //sendmsg=46
820, 3, //recvmsg=47
830, 2, //shutdown=48
840, 3, //bind=49
850, 2, //listen=50
860, 3, //getsockname=51
870, 3, //getpeername=52
880, 4, //socketpair=53
890, 5, //setsockopt=54
900, 5, //getsockopt=55
910, 5, //clone=56
920, 0, //fork=57
930, 0, //vfork=58
940, 3, //execve=59
950, 1, //exit=60
960, 4, //wait4=61
970, 2, //kill=62
980, 1, //uname=63
990, 3, //semget=64
1000, 3, //semop=65
1010, 4, //semctl=66
1020, 1, //shmdt=67
1030, 2, //msgget=68
1040, 4, //msgsnd=69
1050, 5, //msgrcv=70
1060, 3, //msgctl=71
1070, 3, //fcntl=72
1080, 2, //flock=73
1090, 1, //fsync=74
1100, 1, //fdatasync=75
1111, 2, //truncate=76
1120, 2, //ftruncate=77
1130, 3, //getdents=78
1140, 2, //getcwd=79
1151, 1, //chdir=80
1160, 1, //fchdir=81
1173, 2, //rename=82
1181, 2, //mkdir=83
1191, 1, //rmdir=84
1201, 2, //creat=85
1213, 2, //link=86
1221, 1, //unlink=87
1233, 2, //symlink=88
1241, 3, //readlink=89
1251, 2, //chmod=90
1260, 2, //fchmod=91
1271, 3, //chown=92
1280, 3, //fchown=93
1291, 3, //lchown=94
1300, 1, //umask=95
1310, 2, //gettimeofday=96
1320, 2, //getrlimit=97
1330, 2, //getrusage=98
1340, 1, //sysinfo=99
1350, 1, //times=100
1360, 4, //ptrace=101
1370, 0, //getuid=102
1380, 3, //syslog=103
1390, 0, //getgid=104
1400, 1, //setuid=105
1410, 1, //setgid=106
1420, 0, //geteuid=107
1430, 0, //getegid=108
1440, 2, //setpgid=109
1450, 0, //getppid=110
1460, 0, //getpgrp=111
1470, 0, //setsid=112
1480, 2, //setreuid=113
1490, 2, //setregid=114
1500, 2, //getgroups=115
1510, 2, //setgroups=116
1520, 3, //setresuid=117
1530, 3, //getresuid=118
1540, 3, //setresgid=119
1550, 3, //getresgid=120
1560, 1, //getpgid=121
1570, 1, //setfsuid=122
1580, 1, //setfsgid=123
1590, 1, //getsid=124
1600, 2, //capget=125
1610, 2, //capset=126
1620, 2, //rt_sigpending=127
1630, 4, //rt_sigtimedwait=128
1640, 3, //rt_sigqueueinfo=129
1650, 2, //rt_sigsuspend=130
1660, 2, //sigaltstack=131
1671, 2, //utime=132
1681, 3, //mknod=133
1691, 1, //uselib=134
1700, 1, //personality=135
1710, 2, //ustat=136
1721, 2, //statfs=137
1730, 2, //fstatfs=138
1740, 3, //sysfs=139
1750, 2, //getpriority=140
1760, 3, //setpriority=141
1770, 2, //sched_setparam=142
1780, 2, //sched_getparam=143
1790, 3, //sched_setscheduler=144
1800, 1, //sched_getscheduler=145
1810, 1, //sched_get_priority_max=146
1820, 1, //sched_get_priority_min=147
1830, 2, //sched_rr_get_interval=148
1840, 2, //mlock=149
1850, 2, //munlock=150
1860, 1, //mlockall=151
1870, 0, //munlockall=152
1880, 0, //vhangup=153
1890, 3, //modify_ldt=154
1903, 2, //pivot_root=155
1910, 1, //_sysctl=156
1920, 5, //prctl=157
1930, 2, //arch_prctl=158
1940, 1, //adjtimex=159
1950, 2, //setrlimit=160
1961, 1, //chroot=161
1970, 0, //sync=162
1981, 1, //acct=163
1990, 2, //settimeofday=164
2007, 5, //mount=165
2011, 2, //umount2=166
2021, 2, //swapon=167
2031, 1, //swapoff=168
2040, 4, //reboot=169
2051, 2, //sethostname=170
2061, 2, //setdomainname=171
2070, 1, //iopl=172
2080, 3, //ioperm=173
2091, 2, //create_module=174
2104, 3, //init_module=175
2111, 2, //delete_module=176
2120, 1, //get_kernel_syms=177
2131, 5, //query_module=178
2142, 4, //quotactl=179
2150, 3, //nfsservctl=180
2160, 5, //getpmsg=181
2170, 5, //putpmsg=182
2180, 5, //afs_syscall=183
2190, 3, //tuxcall=184
2200, 3, //security=185
2210, 0, //gettid=186
2220, 3, //readahead=187
2233, 5, //setxattr=188
2243, 5, //lsetxattr=189
2252, 5, //fsetxattr=190
2263, 4, //getxattr=191
2273, 4, //lgetxattr=192
2282, 4, //fgetxattr=193
2291, 3, //listxattr=194
2301, 3, //llistxattr=195
2310, 3, //flistxattr=196
2323, 2, //removexattr=197
2333, 2, //lremovexattr=198
2342, 2, //fremovexattr=199
2350, 2, //tkill=200
2360, 1, //time=201
2370, 6, //futex=202
2380, 3, //sched_setaffinity=203
2390, 3, //sched_getaffinity=204
2400, 1, //set_thread_area=205
2410, 2, //io_setup=206
2420, 1, //io_destroy=207
2430, 5, //io_getevents=208
2440, 3, //io_submit=209
2450, 3, //io_cancel=210
2460, 1, //get_thread_area=211
2470, 3, //lookup_dcookie=212
2480, 1, //epoll_create=213
2490, 4, //epoll_ctl_old=214
2500, 4, //epoll_wait_old=215
2510, 5, //remap_file_pages=216
2520, 3, //getdents64=217
2530, 1, //set_tid_address=218
2540, 0, //restart_syscall=219
2550, 4, //semtimedop=220
2560, 4, //fadvise64=221
2570, 3, //timer_create=222
2580, 4, //timer_settime=223
2590, 2, //timer_gettime=224
2600, 1, //timer_getoverrun=225
2610, 1, //timer_delete=226
2620, 2, //clock_settime=227
2630, 2, //clock_gettime=228
2640, 2, //clock_getres=229
2650, 4, //clock_nanosleep=230
2660, 1, //exit_group=231
2670, 4, //epoll_wait=232
2680, 4, //epoll_ctl=233
2690, 3, //tgkill=234
2701, 2, //utimes=235
2710, 5, //vserver=236
2720, 6, //mbind=237
2730, 3, //set_mempolicy=238
2740, 5, //get_mempolicy=239
2751, 4, //mq_open=240
2761, 1, //mq_unlink=241
2772, 5, //mq_timedsend=242
2780, 5, //mq_timedreceive=243
2790, 2, //mq_notify=244
2800, 3, //mq_getsetattr=245
2810, 4, //kexec_load=246
2820, 5, //waitid=247
2833, 5, //add_key=248
2847, 4, //request_key=249
2850, 5, //keyctl=250
2860, 3, //ioprio_set=251
2870, 2, //ioprio_get=252
2880, 0, //inotify_init=253
2892, 3, //inotify_add_watch=254
2900, 2, //inotify_rm_watch=255
2910, 4, //migrate_pages=256
2922, 4, //openat=257
2932, 3, //mkdirat=258
2942, 4, //mknodat=259
2952, 5, //fchownat=260
2962, 3, //futimesat=261
2972, 4, //newfstatat=262
2982, 3, //unlinkat=263
29910, 4, //renameat=264
30010, 5, //linkat=265
3015, 3, //symlinkat=266
3022, 4, //readlinkat=267
3032, 4, //fchmodat=268
3042, 4, //faccessat=269
3050, 6, //pselect6=270
3060, 5, //ppoll=271
3070, 1, //unshare=272
3080, 2, //set_robust_list=273
3090, 3, //get_robust_list=274
3100, 6, //splice=275
3110, 4, //tee=276
3120, 4, //sync_file_range=277
3130, 4, //vmsplice=278
3140, 6, //move_pages=279
3152, 4, //utimensat=280
3160, 6, //epoll_pwait=281
3170, 3, //signalfd=282
3180, 2, //timerfd_create=283
3190, 1, //eventfd=284
3200, 4, //fallocate=285
3210, 4, //timerfd_settime=286
3220, 2, //timerfd_gettime=287
3230, 4, //accept4=288
3240, 4, //signalfd4=289
3250, 2, //eventfd2=290
3260, 1, //epoll_create1=291
3270, 3, //dup3=292
3280, 2, //pipe2=293
3290, 1, //inotify_init1=294
3300, 4, //preadv=295
3310, 4, //pwritev=296
3320, 4, //rt_tgsigqueueinfo=297
3330, 5, //perf_event_open=298
3340, 5, //recvmmsg=299
3350, 2, //fanotify_init=300
33616, 5, //fanotify_mark=301
3370, 4, //prlimit64=302
3382, 5, //name_to_handle_at=303
3390, 3, //open_by_handle_at=304
3400, 2, //clock_adjtime=305
3410, 1, //syncfs=306
3420, 4, //sendmmsg=307
3430, 2, //setns=308
3440, 3, //getcpu=309
3450, 6, //process_vm_readv=310
3460, 6, //process_vm_writev=311
3470, 5, //kcmp=312
3482, 3, //finit_module=313
3490, 3, //sched_setattr=314
3500, 4, //sched_getattr=315
35110, 5, //renameat2=316
3520, 3, //seccomp=317
3530, 3, //getrandom=318
3541, 2, //memfd_create=319
3558, 5, //kexec_file_load=320
3560, 3, //bpf=321
3570, 5, //execveat=322
3580, 1, //userfaultfd=323
3590, 2, //membarrier=324
3600, 3, //mlock2=325
3610, 6, //copy_file_range=326
3620, 6, //preadv2=327
3630, 6, //pwritev2=328
3640, 4, //pkey_mprotect=329
3650, 2, //pkey_alloc=330
3660, 1, //pkey_free=331
367};
368