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