• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // This file automatically generated by gen_kernel_syscalls_translation.py
2 // DO NOT EDIT!
3 
RunGuestSyscallImpl(long guest_nr,long arg_1,long arg_2,long arg_3,long arg_4,long arg_5,long arg_6)4 long RunGuestSyscallImpl(long guest_nr,
5                          long arg_1,
6                          long arg_2,
7                          long arg_3,
8                          long arg_4,
9                          long arg_5,
10                          long arg_6) {
11   switch (guest_nr) {
12     case 202:  // __NR_accept
13       return syscall(43, arg_1, arg_2, arg_3);
14     case 242:  // __NR_accept4
15       return syscall(288, arg_1, arg_2, arg_3, arg_4);
16     case 89:  // __NR_acct
17       return syscall(163, arg_1);
18     case 217:  // __NR_add_key
19       return syscall(248, arg_1, arg_2, arg_3, arg_4, arg_5);
20     case 171:  // __NR_adjtimex
21       return syscall(159, arg_1);
22     case 200:  // __NR_bind
23       return syscall(49, arg_1, arg_2, arg_3);
24     case 280:  // __NR_bpf
25       return syscall(321, arg_1, arg_2, arg_3);
26     case 214:  // __NR_brk
27       return syscall(12, arg_1);
28     case 90:  // __NR_capget
29       return syscall(125, arg_1, arg_2);
30     case 91:  // __NR_capset
31       return syscall(126, arg_1, arg_2);
32     case 49:  // __NR_chdir
33       return syscall(80, arg_1);
34     case 51:  // __NR_chroot
35       return syscall(161, arg_1);
36     case 266:  // __NR_clock_adjtime
37       return syscall(305, arg_1, arg_2);
38     case 114:  // __NR_clock_getres
39       return syscall(229, arg_1, arg_2);
40     case 113:  // __NR_clock_gettime
41       return syscall(228, arg_1, arg_2);
42     case 115:  // __NR_clock_nanosleep
43       return syscall(230, arg_1, arg_2, arg_3, arg_4);
44     case 112:  // __NR_clock_settime
45       return syscall(227, arg_1, arg_2);
46     case 220:  // __NR_clone
47       // custom syscall
48       return RunGuestSyscall___NR_clone(arg_1, arg_2, arg_3, arg_4, arg_5);
49     case 435:  // __NR_clone3
50       // custom syscall
51       return RunGuestSyscall___NR_clone3(arg_1, arg_2);
52     case 57:  // __NR_close
53       return syscall(3, arg_1);
54     case 436:  // __NR_close_range
55       return syscall(436, arg_1, arg_2, arg_3);
56     case 203:  // __NR_connect
57       return syscall(42, arg_1, arg_2, arg_3);
58     case 285:  // __NR_copy_file_range
59       return syscall(326, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
60     case 106:  // __NR_delete_module
61       return syscall(176, arg_1, arg_2);
62     case 23:  // __NR_dup
63       return syscall(32, arg_1);
64     case 24:  // __NR_dup3
65       return syscall(292, arg_1, arg_2, arg_3);
66     case 20:  // __NR_epoll_create1
67       return syscall(291, arg_1);
68     case 21:  // __NR_epoll_ctl
69       // incompatible prototype
70       return RunGuestSyscall___NR_epoll_ctl(arg_1, arg_2, arg_3, arg_4);
71     case 22:  // __NR_epoll_pwait
72       // incompatible prototype
73       return RunGuestSyscall___NR_epoll_pwait(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
74     case 441:  // __NR_epoll_pwait2
75       // incompatible prototype
76       return RunGuestSyscall___NR_epoll_pwait2(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
77     case 19:  // __NR_eventfd2
78       return syscall(290, arg_1, arg_2);
79     case 221:  // __NR_execve
80       // custom syscall
81       return RunGuestSyscall___NR_execve(arg_1, arg_2, arg_3);
82     case 281:  // __NR_execveat
83       // custom syscall
84       return RunGuestSyscall___NR_execveat(arg_1, arg_2, arg_3, arg_4, arg_5);
85     case 93:  // __NR_exit
86       // cleans guest thread
87       return RunGuestSyscall___NR_exit(arg_1);
88     case 94:  // __NR_exit_group
89       return syscall(231, arg_1);
90     case 48:  // __NR_faccessat
91       // follows symlinks
92       return RunGuestSyscall___NR_faccessat(arg_1, arg_2, arg_3);
93     case 439:  // __NR_faccessat2
94       return syscall(439, arg_1, arg_2, arg_3, arg_4);
95     case 223:  // __NR_fadvise64
96       // sys_fadvise64_64 on riscv64 but sys_fadvise64 on x86_64
97       return RunGuestSyscall___NR_fadvise64(arg_1, arg_2, arg_3, arg_4);
98     case 47:  // __NR_fallocate
99       return syscall(285, arg_1, arg_2, arg_3, arg_4);
100     case 262:  // __NR_fanotify_init
101       // missing prototype
102       KAPI_TRACE("unsupported syscall __NR_fanotify_init");
103       errno = ENOSYS;
104       return -1;
105     case 263:  // __NR_fanotify_mark
106       // missing prototype
107       KAPI_TRACE("unsupported syscall __NR_fanotify_mark");
108       errno = ENOSYS;
109       return -1;
110     case 50:  // __NR_fchdir
111       return syscall(81, arg_1);
112     case 52:  // __NR_fchmod
113       return syscall(91, arg_1, arg_2);
114     case 53:  // __NR_fchmodat
115       return syscall(268, arg_1, arg_2, arg_3);
116     case 55:  // __NR_fchown
117       return syscall(93, arg_1, arg_2, arg_3);
118     case 54:  // __NR_fchownat
119       return syscall(260, arg_1, arg_2, arg_3, arg_4, arg_5);
120     case 25:  // __NR_fcntl
121       // custom syscall
122       return RunGuestSyscall___NR_fcntl(arg_1, arg_2, arg_3);
123     case 83:  // __NR_fdatasync
124       return syscall(75, arg_1);
125     case 10:  // __NR_fgetxattr
126       return syscall(193, arg_1, arg_2, arg_3, arg_4);
127     case 273:  // __NR_finit_module
128       return syscall(313, arg_1, arg_2, arg_3);
129     case 13:  // __NR_flistxattr
130       return syscall(196, arg_1, arg_2, arg_3);
131     case 32:  // __NR_flock
132       return syscall(73, arg_1, arg_2);
133     case 16:  // __NR_fremovexattr
134       return syscall(199, arg_1, arg_2);
135     case 431:  // __NR_fsconfig
136       return syscall(431, arg_1, arg_2, arg_3, arg_4, arg_5);
137     case 7:  // __NR_fsetxattr
138       return syscall(190, arg_1, arg_2, arg_3, arg_4, arg_5);
139     case 432:  // __NR_fsmount
140       return syscall(432, arg_1, arg_2, arg_3);
141     case 430:  // __NR_fsopen
142       return syscall(430, arg_1, arg_2);
143     case 433:  // __NR_fspick
144       return syscall(433, arg_1, arg_2, arg_3);
145     case 80:  // __NR_fstat
146       // incompatible prototype
147       return RunGuestSyscall___NR_fstat(arg_1, arg_2);
148     case 44:  // __NR_fstatfs
149       return syscall(138, arg_1, arg_2);
150     case 82:  // __NR_fsync
151       return syscall(74, arg_1);
152     case 46:  // __NR_ftruncate
153       return syscall(77, arg_1, arg_2);
154     case 98:  // __NR_futex
155       return syscall(202, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
156     case 449:  // __NR_futex_waitv
157       return syscall(449, arg_1, arg_2, arg_3, arg_4, arg_5);
158     case 236:  // __NR_get_mempolicy
159       // missing prototype
160       KAPI_TRACE("unsupported syscall __NR_get_mempolicy");
161       errno = ENOSYS;
162       return -1;
163     case 100:  // __NR_get_robust_list
164       return syscall(274, arg_1, arg_2, arg_3);
165     case 168:  // __NR_getcpu
166       return syscall(309, arg_1, arg_2, arg_3);
167     case 17:  // __NR_getcwd
168       return syscall(79, arg_1, arg_2);
169     case 61:  // __NR_getdents64
170       return syscall(217, arg_1, arg_2, arg_3);
171     case 177:  // __NR_getegid
172       return syscall(108);
173     case 175:  // __NR_geteuid
174       return syscall(107);
175     case 176:  // __NR_getgid
176       return syscall(104);
177     case 158:  // __NR_getgroups
178       return syscall(115, arg_1, arg_2);
179     case 102:  // __NR_getitimer
180       return syscall(36, arg_1, arg_2);
181     case 205:  // __NR_getpeername
182       return syscall(52, arg_1, arg_2, arg_3);
183     case 155:  // __NR_getpgid
184       return syscall(121, arg_1);
185     case 172:  // __NR_getpid
186       return syscall(39);
187     case 173:  // __NR_getppid
188       return syscall(110);
189     case 141:  // __NR_getpriority
190       return syscall(140, arg_1, arg_2);
191     case 278:  // __NR_getrandom
192       return syscall(318, arg_1, arg_2, arg_3);
193     case 150:  // __NR_getresgid
194       return syscall(120, arg_1, arg_2, arg_3);
195     case 148:  // __NR_getresuid
196       return syscall(118, arg_1, arg_2, arg_3);
197     case 163:  // __NR_getrlimit
198       return syscall(97, arg_1, arg_2);
199     case 165:  // __NR_getrusage
200       return syscall(98, arg_1, arg_2);
201     case 156:  // __NR_getsid
202       return syscall(124, arg_1);
203     case 204:  // __NR_getsockname
204       return syscall(51, arg_1, arg_2, arg_3);
205     case 209:  // __NR_getsockopt
206       return syscall(55, arg_1, arg_2, arg_3, arg_4, arg_5);
207     case 178:  // __NR_gettid
208       return syscall(186);
209     case 169:  // __NR_gettimeofday
210       return syscall(96, arg_1, arg_2);
211     case 174:  // __NR_getuid
212       return syscall(102);
213     case 8:  // __NR_getxattr
214       return syscall(191, arg_1, arg_2, arg_3, arg_4);
215     case 105:  // __NR_init_module
216       return syscall(175, arg_1, arg_2, arg_3);
217     case 27:  // __NR_inotify_add_watch
218       return syscall(254, arg_1, arg_2, arg_3);
219     case 26:  // __NR_inotify_init1
220       return syscall(294, arg_1);
221     case 28:  // __NR_inotify_rm_watch
222       return syscall(255, arg_1, arg_2);
223     case 3:  // __NR_io_cancel
224       return syscall(210, arg_1, arg_2, arg_3);
225     case 1:  // __NR_io_destroy
226       return syscall(207, arg_1);
227     case 4:  // __NR_io_getevents
228       return syscall(208, arg_1, arg_2, arg_3, arg_4, arg_5);
229     case 292:  // __NR_io_pgetevents
230       return syscall(333, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
231     case 0:  // __NR_io_setup
232       return syscall(206, arg_1, arg_2);
233     case 2:  // __NR_io_submit
234       return syscall(209, arg_1, arg_2, arg_3);
235     case 426:  // __NR_io_uring_enter
236       return syscall(426, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
237     case 427:  // __NR_io_uring_register
238       return syscall(427, arg_1, arg_2, arg_3, arg_4);
239     case 425:  // __NR_io_uring_setup
240       return syscall(425, arg_1, arg_2);
241     case 29:  // __NR_ioctl
242       // custom syscall
243       return RunGuestSyscall___NR_ioctl(arg_1, arg_2, arg_3);
244     case 31:  // __NR_ioprio_get
245       return syscall(252, arg_1, arg_2);
246     case 30:  // __NR_ioprio_set
247       return syscall(251, arg_1, arg_2, arg_3);
248     case 272:  // __NR_kcmp
249       return syscall(312, arg_1, arg_2, arg_3, arg_4, arg_5);
250     case 294:  // __NR_kexec_file_load
251       // missing prototype
252       KAPI_TRACE("unsupported syscall __NR_kexec_file_load");
253       errno = ENOSYS;
254       return -1;
255     case 104:  // __NR_kexec_load
256       // missing prototype
257       KAPI_TRACE("unsupported syscall __NR_kexec_load");
258       errno = ENOSYS;
259       return -1;
260     case 219:  // __NR_keyctl
261       return syscall(250, arg_1, arg_2, arg_3, arg_4, arg_5);
262     case 129:  // __NR_kill
263       return syscall(62, arg_1, arg_2);
264     case 445:  // __NR_landlock_add_rule
265       // missing prototype
266       KAPI_TRACE("unsupported syscall __NR_landlock_add_rule");
267       errno = ENOSYS;
268       return -1;
269     case 444:  // __NR_landlock_create_ruleset
270       // missing prototype
271       KAPI_TRACE("unsupported syscall __NR_landlock_create_ruleset");
272       errno = ENOSYS;
273       return -1;
274     case 446:  // __NR_landlock_restrict_self
275       // missing prototype
276       KAPI_TRACE("unsupported syscall __NR_landlock_restrict_self");
277       errno = ENOSYS;
278       return -1;
279     case 9:  // __NR_lgetxattr
280       return syscall(192, arg_1, arg_2, arg_3, arg_4);
281     case 37:  // __NR_linkat
282       return syscall(265, arg_1, arg_2, arg_3, arg_4, arg_5);
283     case 201:  // __NR_listen
284       return syscall(50, arg_1, arg_2);
285     case 11:  // __NR_listxattr
286       return syscall(194, arg_1, arg_2, arg_3);
287     case 12:  // __NR_llistxattr
288       return syscall(195, arg_1, arg_2, arg_3);
289     case 18:  // __NR_lookup_dcookie
290       return syscall(212, arg_1, arg_2, arg_3);
291     case 15:  // __NR_lremovexattr
292       return syscall(198, arg_1, arg_2);
293     case 62:  // __NR_lseek
294       return syscall(8, arg_1, arg_2, arg_3);
295     case 6:  // __NR_lsetxattr
296       return syscall(189, arg_1, arg_2, arg_3, arg_4, arg_5);
297     case 233:  // __NR_madvise
298       return syscall(28, arg_1, arg_2, arg_3);
299     case 235:  // __NR_mbind
300       // missing prototype
301       KAPI_TRACE("unsupported syscall __NR_mbind");
302       errno = ENOSYS;
303       return -1;
304     case 283:  // __NR_membarrier
305       return syscall(324, arg_1, arg_2, arg_3);
306     case 279:  // __NR_memfd_create
307       return syscall(319, arg_1, arg_2);
308     case 447:  // __NR_memfd_secret
309       return syscall(447, arg_1);
310     case 238:  // __NR_migrate_pages
311       // missing prototype
312       KAPI_TRACE("unsupported syscall __NR_migrate_pages");
313       errno = ENOSYS;
314       return -1;
315     case 232:  // __NR_mincore
316       return syscall(27, arg_1, arg_2, arg_3);
317     case 34:  // __NR_mkdirat
318       return syscall(258, arg_1, arg_2, arg_3);
319     case 33:  // __NR_mknodat
320       return syscall(259, arg_1, arg_2, arg_3, arg_4);
321     case 228:  // __NR_mlock
322       return syscall(149, arg_1, arg_2);
323     case 284:  // __NR_mlock2
324       return syscall(325, arg_1, arg_2, arg_3);
325     case 230:  // __NR_mlockall
326       return syscall(151, arg_1);
327     case 222:  // __NR_mmap
328       // changes memory protection
329       return RunGuestSyscall___NR_mmap(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
330     case 40:  // __NR_mount
331       return syscall(165, arg_1, arg_2, arg_3, arg_4, arg_5);
332     case 442:  // __NR_mount_setattr
333       return syscall(442, arg_1, arg_2, arg_3, arg_4, arg_5);
334     case 429:  // __NR_move_mount
335       return syscall(429, arg_1, arg_2, arg_3, arg_4, arg_5);
336     case 239:  // __NR_move_pages
337       // missing prototype
338       KAPI_TRACE("unsupported syscall __NR_move_pages");
339       errno = ENOSYS;
340       return -1;
341     case 226:  // __NR_mprotect
342       // changes memory protection
343       return RunGuestSyscall___NR_mprotect(arg_1, arg_2, arg_3);
344     case 185:  // __NR_mq_getsetattr
345       // missing prototype
346       KAPI_TRACE("unsupported syscall __NR_mq_getsetattr");
347       errno = ENOSYS;
348       return -1;
349     case 184:  // __NR_mq_notify
350       // missing prototype
351       KAPI_TRACE("unsupported syscall __NR_mq_notify");
352       errno = ENOSYS;
353       return -1;
354     case 180:  // __NR_mq_open
355       // missing prototype
356       KAPI_TRACE("unsupported syscall __NR_mq_open");
357       errno = ENOSYS;
358       return -1;
359     case 183:  // __NR_mq_timedreceive
360       // missing prototype
361       KAPI_TRACE("unsupported syscall __NR_mq_timedreceive");
362       errno = ENOSYS;
363       return -1;
364     case 182:  // __NR_mq_timedsend
365       // missing prototype
366       KAPI_TRACE("unsupported syscall __NR_mq_timedsend");
367       errno = ENOSYS;
368       return -1;
369     case 181:  // __NR_mq_unlink
370       // missing prototype
371       KAPI_TRACE("unsupported syscall __NR_mq_unlink");
372       errno = ENOSYS;
373       return -1;
374     case 216:  // __NR_mremap
375       // changes memory protection
376       return RunGuestSyscall___NR_mremap(arg_1, arg_2, arg_3, arg_4, arg_5);
377     case 187:  // __NR_msgctl
378       // missing prototype
379       KAPI_TRACE("unsupported syscall __NR_msgctl");
380       errno = ENOSYS;
381       return -1;
382     case 186:  // __NR_msgget
383       // missing prototype
384       KAPI_TRACE("unsupported syscall __NR_msgget");
385       errno = ENOSYS;
386       return -1;
387     case 188:  // __NR_msgrcv
388       // missing prototype
389       KAPI_TRACE("unsupported syscall __NR_msgrcv");
390       errno = ENOSYS;
391       return -1;
392     case 189:  // __NR_msgsnd
393       // missing prototype
394       KAPI_TRACE("unsupported syscall __NR_msgsnd");
395       errno = ENOSYS;
396       return -1;
397     case 227:  // __NR_msync
398       return syscall(26, arg_1, arg_2, arg_3);
399     case 229:  // __NR_munlock
400       return syscall(150, arg_1, arg_2);
401     case 231:  // __NR_munlockall
402       return syscall(152);
403     case 215:  // __NR_munmap
404       // changes memory protection
405       return RunGuestSyscall___NR_munmap(arg_1, arg_2);
406     case 264:  // __NR_name_to_handle_at
407       // missing prototype
408       KAPI_TRACE("unsupported syscall __NR_name_to_handle_at");
409       errno = ENOSYS;
410       return -1;
411     case 101:  // __NR_nanosleep
412       return syscall(35, arg_1, arg_2);
413     case 79:  // __NR_newfstatat
414       // follows symlinks
415       return RunGuestSyscall___NR_newfstatat(arg_1, arg_2, arg_3, arg_4);
416     case 42:  // __NR_nfsservctl
417       return syscall(180);
418     case 265:  // __NR_open_by_handle_at
419       // missing prototype
420       KAPI_TRACE("unsupported syscall __NR_open_by_handle_at");
421       errno = ENOSYS;
422       return -1;
423     case 428:  // __NR_open_tree
424       return syscall(428, arg_1, arg_2, arg_3);
425     case 56:  // __NR_openat
426       // follows symlinks, open flags value mismatch
427       return RunGuestSyscall___NR_openat(arg_1, arg_2, arg_3, arg_4);
428     case 437:  // __NR_openat2
429       return syscall(437, arg_1, arg_2, arg_3, arg_4);
430     case 241:  // __NR_perf_event_open
431       return syscall(298, arg_1, arg_2, arg_3, arg_4, arg_5);
432     case 92:  // __NR_personality
433       return syscall(135, arg_1);
434     case 438:  // __NR_pidfd_getfd
435       return syscall(438, arg_1, arg_2, arg_3);
436     case 434:  // __NR_pidfd_open
437       return syscall(434, arg_1, arg_2);
438     case 424:  // __NR_pidfd_send_signal
439       return syscall(424, arg_1, arg_2, arg_3, arg_4);
440     case 59:  // __NR_pipe2
441       return syscall(293, arg_1, arg_2);
442     case 41:  // __NR_pivot_root
443       return syscall(155, arg_1, arg_2);
444     case 289:  // __NR_pkey_alloc
445       // missing prototype
446       KAPI_TRACE("unsupported syscall __NR_pkey_alloc");
447       errno = ENOSYS;
448       return -1;
449     case 290:  // __NR_pkey_free
450       // missing prototype
451       KAPI_TRACE("unsupported syscall __NR_pkey_free");
452       errno = ENOSYS;
453       return -1;
454     case 288:  // __NR_pkey_mprotect
455       // missing prototype
456       KAPI_TRACE("unsupported syscall __NR_pkey_mprotect");
457       errno = ENOSYS;
458       return -1;
459     case 73:  // __NR_ppoll
460       return syscall(271, arg_1, arg_2, arg_3, arg_4, arg_5);
461     case 167:  // __NR_prctl
462       // custom syscall
463       return RunGuestSyscall___NR_prctl(arg_1, arg_2, arg_3, arg_4, arg_5);
464     case 67:  // __NR_pread64
465       return syscall(17, arg_1, arg_2, arg_3, arg_4);
466     case 69:  // __NR_preadv
467       return syscall(295, arg_1, arg_2, arg_3, arg_4, arg_5);
468     case 286:  // __NR_preadv2
469       return syscall(327, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
470     case 261:  // __NR_prlimit64
471       return syscall(302, arg_1, arg_2, arg_3, arg_4);
472     case 440:  // __NR_process_madvise
473       return syscall(440, arg_1, arg_2, arg_3, arg_4, arg_5);
474     case 448:  // __NR_process_mrelease
475       return syscall(448, arg_1, arg_2);
476     case 270:  // __NR_process_vm_readv
477       return syscall(310, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
478     case 271:  // __NR_process_vm_writev
479       return syscall(311, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
480     case 72:  // __NR_pselect6
481       return syscall(270, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
482     case 117:  // __NR_ptrace
483       // custom syscall
484       return RunGuestSyscall___NR_ptrace(arg_1, arg_2, arg_3, arg_4);
485     case 68:  // __NR_pwrite64
486       return syscall(18, arg_1, arg_2, arg_3, arg_4);
487     case 70:  // __NR_pwritev
488       return syscall(296, arg_1, arg_2, arg_3, arg_4, arg_5);
489     case 287:  // __NR_pwritev2
490       return syscall(328, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
491     case 60:  // __NR_quotactl
492       return syscall(179, arg_1, arg_2, arg_3, arg_4);
493     case 443:  // __NR_quotactl_fd
494       return syscall(443, arg_1, arg_2, arg_3, arg_4);
495     case 63:  // __NR_read
496       return syscall(0, arg_1, arg_2, arg_3);
497     case 213:  // __NR_readahead
498       return syscall(187, arg_1, arg_2, arg_3);
499     case 78:  // __NR_readlinkat
500       // follows symlinks
501       return RunGuestSyscall___NR_readlinkat(arg_1, arg_2, arg_3, arg_4);
502     case 65:  // __NR_readv
503       return syscall(19, arg_1, arg_2, arg_3);
504     case 142:  // __NR_reboot
505       return syscall(169, arg_1, arg_2, arg_3, arg_4);
506     case 207:  // __NR_recvfrom
507       return syscall(45, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
508     case 243:  // __NR_recvmmsg
509       return syscall(299, arg_1, arg_2, arg_3, arg_4, arg_5);
510     case 212:  // __NR_recvmsg
511       return syscall(47, arg_1, arg_2, arg_3);
512     case 234:  // __NR_remap_file_pages
513       return syscall(216, arg_1, arg_2, arg_3, arg_4, arg_5);
514     case 14:  // __NR_removexattr
515       return syscall(197, arg_1, arg_2);
516     case 38:  // __NR_renameat
517       return syscall(264, arg_1, arg_2, arg_3, arg_4);
518     case 276:  // __NR_renameat2
519       return syscall(316, arg_1, arg_2, arg_3, arg_4, arg_5);
520     case 218:  // __NR_request_key
521       return syscall(249, arg_1, arg_2, arg_3, arg_4);
522     case 128:  // __NR_restart_syscall
523       return syscall(219);
524     case 293:  // __NR_rseq
525       // missing prototype
526       KAPI_TRACE("unsupported syscall __NR_rseq");
527       errno = ENOSYS;
528       return -1;
529     case 134:  // __NR_rt_sigaction
530       // changes signal action
531       return RunGuestSyscall___NR_rt_sigaction(arg_1, arg_2, arg_3, arg_4);
532     case 136:  // __NR_rt_sigpending
533       return syscall(127, arg_1, arg_2);
534     case 135:  // __NR_rt_sigprocmask
535       return syscall(14, arg_1, arg_2, arg_3, arg_4);
536     case 138:  // __NR_rt_sigqueueinfo
537       return syscall(129, arg_1, arg_2, arg_3);
538     case 139:  // __NR_rt_sigreturn
539       // should never be called from guest
540       return RunGuestSyscall___NR_rt_sigreturn(arg_1);
541     case 133:  // __NR_rt_sigsuspend
542       return syscall(130, arg_1, arg_2);
543     case 137:  // __NR_rt_sigtimedwait
544       return syscall(128, arg_1, arg_2, arg_3, arg_4);
545     case 240:  // __NR_rt_tgsigqueueinfo
546       return syscall(297, arg_1, arg_2, arg_3, arg_4);
547     case 125:  // __NR_sched_get_priority_max
548       return syscall(146, arg_1);
549     case 126:  // __NR_sched_get_priority_min
550       return syscall(147, arg_1);
551     case 123:  // __NR_sched_getaffinity
552       return syscall(204, arg_1, arg_2, arg_3);
553     case 275:  // __NR_sched_getattr
554       return syscall(315, arg_1, arg_2, arg_3, arg_4);
555     case 121:  // __NR_sched_getparam
556       return syscall(143, arg_1, arg_2);
557     case 120:  // __NR_sched_getscheduler
558       return syscall(145, arg_1);
559     case 127:  // __NR_sched_rr_get_interval
560       return syscall(148, arg_1, arg_2);
561     case 122:  // __NR_sched_setaffinity
562       return syscall(203, arg_1, arg_2, arg_3);
563     case 274:  // __NR_sched_setattr
564       return syscall(314, arg_1, arg_2, arg_3);
565     case 118:  // __NR_sched_setparam
566       return syscall(142, arg_1, arg_2);
567     case 119:  // __NR_sched_setscheduler
568       return syscall(144, arg_1, arg_2, arg_3);
569     case 124:  // __NR_sched_yield
570       return syscall(24);
571     case 277:  // __NR_seccomp
572       return syscall(317, arg_1, arg_2, arg_3);
573     case 191:  // __NR_semctl
574       // missing prototype
575       KAPI_TRACE("unsupported syscall __NR_semctl");
576       errno = ENOSYS;
577       return -1;
578     case 190:  // __NR_semget
579       // missing prototype
580       KAPI_TRACE("unsupported syscall __NR_semget");
581       errno = ENOSYS;
582       return -1;
583     case 193:  // __NR_semop
584       // missing prototype
585       KAPI_TRACE("unsupported syscall __NR_semop");
586       errno = ENOSYS;
587       return -1;
588     case 192:  // __NR_semtimedop
589       // missing prototype
590       KAPI_TRACE("unsupported syscall __NR_semtimedop");
591       errno = ENOSYS;
592       return -1;
593     case 71:  // __NR_sendfile
594       return syscall(40, arg_1, arg_2, arg_3, arg_4);
595     case 269:  // __NR_sendmmsg
596       return syscall(307, arg_1, arg_2, arg_3, arg_4);
597     case 211:  // __NR_sendmsg
598       return syscall(46, arg_1, arg_2, arg_3);
599     case 206:  // __NR_sendto
600       return syscall(44, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
601     case 237:  // __NR_set_mempolicy
602       // missing prototype
603       KAPI_TRACE("unsupported syscall __NR_set_mempolicy");
604       errno = ENOSYS;
605       return -1;
606     case 450:  // __NR_set_mempolicy_home_node
607       // missing prototype
608       KAPI_TRACE("unsupported syscall __NR_set_mempolicy_home_node");
609       errno = ENOSYS;
610       return -1;
611     case 99:  // __NR_set_robust_list
612       return syscall(273, arg_1, arg_2);
613     case 96:  // __NR_set_tid_address
614       return syscall(218, arg_1);
615     case 162:  // __NR_setdomainname
616       return syscall(171, arg_1, arg_2);
617     case 152:  // __NR_setfsgid
618       return syscall(123, arg_1);
619     case 151:  // __NR_setfsuid
620       return syscall(122, arg_1);
621     case 144:  // __NR_setgid
622       return syscall(106, arg_1);
623     case 159:  // __NR_setgroups
624       return syscall(116, arg_1, arg_2);
625     case 161:  // __NR_sethostname
626       return syscall(170, arg_1, arg_2);
627     case 103:  // __NR_setitimer
628       return syscall(38, arg_1, arg_2, arg_3);
629     case 268:  // __NR_setns
630       return syscall(308, arg_1, arg_2);
631     case 154:  // __NR_setpgid
632       return syscall(109, arg_1, arg_2);
633     case 140:  // __NR_setpriority
634       return syscall(141, arg_1, arg_2, arg_3);
635     case 143:  // __NR_setregid
636       return syscall(114, arg_1, arg_2);
637     case 149:  // __NR_setresgid
638       return syscall(119, arg_1, arg_2, arg_3);
639     case 147:  // __NR_setresuid
640       return syscall(117, arg_1, arg_2, arg_3);
641     case 145:  // __NR_setreuid
642       return syscall(113, arg_1, arg_2);
643     case 164:  // __NR_setrlimit
644       return syscall(160, arg_1, arg_2);
645     case 157:  // __NR_setsid
646       return syscall(112);
647     case 208:  // __NR_setsockopt
648       return syscall(54, arg_1, arg_2, arg_3, arg_4, arg_5);
649     case 170:  // __NR_settimeofday
650       return syscall(164, arg_1, arg_2);
651     case 146:  // __NR_setuid
652       return syscall(105, arg_1);
653     case 5:  // __NR_setxattr
654       return syscall(188, arg_1, arg_2, arg_3, arg_4, arg_5);
655     case 196:  // __NR_shmat
656       // missing prototype
657       KAPI_TRACE("unsupported syscall __NR_shmat");
658       errno = ENOSYS;
659       return -1;
660     case 195:  // __NR_shmctl
661       // missing prototype
662       KAPI_TRACE("unsupported syscall __NR_shmctl");
663       errno = ENOSYS;
664       return -1;
665     case 197:  // __NR_shmdt
666       // missing prototype
667       KAPI_TRACE("unsupported syscall __NR_shmdt");
668       errno = ENOSYS;
669       return -1;
670     case 194:  // __NR_shmget
671       // missing prototype
672       KAPI_TRACE("unsupported syscall __NR_shmget");
673       errno = ENOSYS;
674       return -1;
675     case 210:  // __NR_shutdown
676       return syscall(48, arg_1, arg_2);
677     case 132:  // __NR_sigaltstack
678       // changes signal stack
679       return RunGuestSyscall___NR_sigaltstack(arg_1, arg_2);
680     case 74:  // __NR_signalfd4
681       return syscall(289, arg_1, arg_2, arg_3, arg_4);
682     case 198:  // __NR_socket
683       return syscall(41, arg_1, arg_2, arg_3);
684     case 199:  // __NR_socketpair
685       return syscall(53, arg_1, arg_2, arg_3, arg_4);
686     case 76:  // __NR_splice
687       return syscall(275, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
688     case 43:  // __NR_statfs
689       return syscall(137, arg_1, arg_2);
690     case 291:  // __NR_statx
691       // follows symlinks
692       return RunGuestSyscall___NR_statx(arg_1, arg_2, arg_3, arg_4, arg_5);
693     case 225:  // __NR_swapoff
694       return syscall(168, arg_1);
695     case 224:  // __NR_swapon
696       return syscall(167, arg_1, arg_2);
697     case 36:  // __NR_symlinkat
698       return syscall(266, arg_1, arg_2, arg_3);
699     case 81:  // __NR_sync
700       return syscall(162);
701     case 84:  // __NR_sync_file_range
702       return syscall(277, arg_1, arg_2, arg_3, arg_4);
703     case 267:  // __NR_syncfs
704       return syscall(306, arg_1);
705     case 179:  // __NR_sysinfo
706       return syscall(99, arg_1);
707     case 116:  // __NR_syslog
708       return syscall(103, arg_1, arg_2, arg_3);
709     case 77:  // __NR_tee
710       return syscall(276, arg_1, arg_2, arg_3, arg_4);
711     case 131:  // __NR_tgkill
712       return syscall(234, arg_1, arg_2, arg_3);
713     case 107:  // __NR_timer_create
714       // incompatible prototype
715       return RunGuestSyscall___NR_timer_create(arg_1, arg_2, arg_3);
716     case 111:  // __NR_timer_delete
717       return syscall(226, arg_1);
718     case 109:  // __NR_timer_getoverrun
719       return syscall(225, arg_1);
720     case 108:  // __NR_timer_gettime
721       return syscall(224, arg_1, arg_2);
722     case 110:  // __NR_timer_settime
723       return syscall(223, arg_1, arg_2, arg_3, arg_4);
724     case 85:  // __NR_timerfd_create
725       return syscall(283, arg_1, arg_2);
726     case 87:  // __NR_timerfd_gettime
727       return syscall(287, arg_1, arg_2);
728     case 86:  // __NR_timerfd_settime
729       return syscall(286, arg_1, arg_2, arg_3, arg_4);
730     case 153:  // __NR_times
731       return syscall(100, arg_1);
732     case 130:  // __NR_tkill
733       return syscall(200, arg_1, arg_2);
734     case 45:  // __NR_truncate
735       return syscall(76, arg_1, arg_2);
736     case 166:  // __NR_umask
737       return syscall(95, arg_1);
738     case 39:  // __NR_umount2
739       return syscall(166, arg_1, arg_2);
740     case 160:  // __NR_uname
741       return syscall(63, arg_1);
742     case 35:  // __NR_unlinkat
743       return syscall(263, arg_1, arg_2, arg_3);
744     case 97:  // __NR_unshare
745       return syscall(272, arg_1);
746     case 282:  // __NR_userfaultfd
747       return syscall(323, arg_1);
748     case 88:  // __NR_utimensat
749       return syscall(280, arg_1, arg_2, arg_3, arg_4);
750     case 58:  // __NR_vhangup
751       return syscall(153);
752     case 75:  // __NR_vmsplice
753       return syscall(278, arg_1, arg_2, arg_3, arg_4);
754     case 260:  // __NR_wait4
755       return syscall(61, arg_1, arg_2, arg_3, arg_4);
756     case 95:  // __NR_waitid
757       return syscall(247, arg_1, arg_2, arg_3, arg_4, arg_5);
758     case 64:  // __NR_write
759       return syscall(1, arg_1, arg_2, arg_3);
760     case 66:  // __NR_writev
761       return syscall(20, arg_1, arg_2, arg_3);
762     default:
763       return RunUnknownGuestSyscall(guest_nr, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6);
764   }
765 }
766