FreeBSD regtest: add fakes for older versions in scalar
[valgrind.git] / memcheck / tests / freebsd / scalar.c
blob5aecfebacfcb6b22fe31bbcfa9edd2dcdabfd6c0
1 /* Basic syscall test, see memcheck/tests/x86-linux/scalar.c for more info. */
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include <sys/types.h>
6 #include <sys/ptrace.h>
7 #include <ufs/ufs/quota.h>
8 #include <machine/sysarch.h>
9 #include <sys/mman.h>
10 #include <sys/sem.h>
11 #include <sys/procctl.h>
12 #include <mqueue.h>
13 #include <sys/types.h>
14 #include <sys/socket.h>
15 #include <poll.h>
16 #include "scalar.h"
17 #include "config.h"
18 #include "../../memcheck.h"
20 /* Helper functions. These are necessary if we've got two tests for a single
21 syscall. In that case, Memcheck can sometimes merge error messages. Doing
22 each test in its own function prevents that. */
25 int main(void)
27 /* Uninitialised, but we know px[0] is 0x0. */
28 long *px = malloc(2*sizeof(long));
29 x0 = px[0];
30 const char* running_in_vgtest = getenv("RUNNING_IN_VGTEST");
32 /* SYS_syscall 0 */
33 /* does this need a specific test? There are two diffeent IDs for syscall, see 198 */
35 /* SYS_exit 1 */
36 /* obviously an exit syscall needs to be last */
37 GO(SYS_exit, "below");
39 /* SYS_fork 2 */
40 GO(SYS_fork, "other");
42 /* SYS_read 3 */
43 GO(SYS_read, "1+3s 0m");
44 SY(SYS_read+x0, 0, x0, x0 + 1); FAILx(EFAULT);
46 /* SYS_write 4 */
47 GO(SYS_write, "3s 1m");
48 SY(SYS_write, x0 + 2, x0, x0 + 1); FAIL;
50 /* SYS_open 5 */
51 GO(SYS_open, "(2-args) 2s 1m");
52 SY(SYS_open, x0, x0); FAIL;
54 // Only 1s 0m errors -- the other 2s 1m have been checked in the previous
55 // open test, and if we test them they may be commoned up but they also
56 // may not.
57 GO(SYS_open, "(3-args) 1s 0m");
58 SY(SYS_open, "scalar.c", O_CREAT|O_EXCL, x0); FAIL;
60 /* SYS_close 6 */
61 GO(SYS_close, "1s 0m");
62 SY(SYS_close, x0-1); FAIL;
64 /* SYS_wait4 7 */
65 GO(SYS_wait4, "4s 2m");
66 SY(SYS_wait4, x0, x0+1, x0, x0+1); FAIL;
68 /* old creat 8 */
70 /* SYS_link 9 */
71 GO(SYS_link, "2s 2m");
72 SY(SYS_link, x0, x0); FAIL;
74 /* SYS_unlink 10 */
75 GO(SYS_unlink, "1s 1m");
76 SY(SYS_unlink, x0); FAIL;
78 /* obs execv 11 */
80 /* chdir 12 */
81 GO(SYS_chdir, "1s 1m");
82 SY(SYS_chdir, x0); FAIL;
84 /* fchdir 13 */
85 GO(SYS_fchdir, "1s 0m");
86 SY(SYS_fchdir, x0-1); FAIL;
88 /* SYS_freebsd11_mknod 14 */
89 #if defined(SYS_freebsd11_mknod)
90 GO(SYS_freebsd11_mknod, "3s 1m");
91 SY(SYS_freebsd11_mknod, x0, x0, x0); FAIL;
92 #else
93 GO(SYS_mknod, "3s 1m");
94 SY(SYS_mknod, x0, x0, x0); FAIL;
95 #endif
97 /* chmod 15 */
98 GO(SYS_chmod, "2s 1m");
99 SY(SYS_chmod, x0, x0); FAIL;
101 /* chown 16 */
102 GO(SYS_chown, "3s 1m");
103 SY(SYS_chown, x0, x0, x0); FAIL;
105 /* break 17 */
106 GO(SYS_break, "1s 1m");
107 SY(SYS_break, x0+1);
108 #if defined(VGP_arm64_freebsd)
109 FAILx(ENOSYS);
110 #else
111 SUCC;
112 #endif
114 /* freebsd4 getfsstat 18 */
116 /* old lseek 19 */
118 /* getpid 20 */
119 GO(SYS_getpid, "0s 0m");
120 SY(SYS_getpid); SUCC;
122 /* mount 21 */
123 /* data not read otherwise this would ne 3m */
124 GO(SYS_mount, "4s 2m");
125 SY(SYS_mount, x0, x0, x0, x0); FAIL;
127 /* unmount 22 */
128 GO(SYS_unmount, "2s 1m");
129 SY(SYS_unmount, x0+1, x0); FAIL;
131 /* setuid 23 */
132 GO(SYS_setuid, "1s 0m");
133 SY(SYS_setuid, x0-1); FAIL;
135 /* getuid 24 */
136 GO(SYS_getuid, "0s 0m");
137 SY(SYS_getuid); SUCC;
139 /* geteuid 25 */
140 GO(SYS_geteuid, "0s 0m");
141 SY(SYS_geteuid); SUCC;
143 /* ptrace 26 */
144 // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 1m
145 GO(SYS_ptrace, "4s 0m");
146 SY(SYS_ptrace, x0+PTRACE_EXEC, x0, x0, x0); FAIL;
148 /* recvmsg 27 */
149 GO(SYS_recvmsg, "3s 0m");
150 SY(SYS_recvmsg, x0, x0, x0); FAIL;
152 /* sendmsg 28 */
153 GO(SYS_sendmsg, "3s 0m");
154 SY(SYS_sendmsg, x0, x0, x0); FAIL;
156 /* recvfrom 29 */
157 GO(SYS_recvfrom, "6+1s 0m");
158 SY(SYS_recvfrom, x0-1, x0+1, x0+16, x0+2, x0+3, x0+4); FAIL;
160 /* accept 30 */
161 GO(SYS_accept, "3+1s 0m");
162 SY(SYS_accept, x0-1, x0+1, x0+1); FAIL;
164 /* getpeername 31 */
165 GO(SYS_getpeername, "3s 1m");
166 SY(SYS_getpeername, x0, x0, x0); FAIL;
168 /* getsockname 32 */
169 GO(SYS_getsockname, "3s 1m");
170 SY(SYS_getsockname, x0, x0, x0); FAIL;
172 /* access 33 */
173 GO(SYS_geteuid, "0s 0m");
174 SY(SYS_geteuid); SUCC;
176 /* chflags 34 */
177 GO(SYS_chflags, "2s 1m");
178 SY(SYS_chflags, x0, x0); FAIL;
180 /* fchflags 35 */
181 GO(SYS_fchflags, "2s 0m");
182 SY(SYS_fchflags, x0+10, x0); FAIL;
184 /* sync 36 */
185 GO(SYS_sync, "0s 0m");
186 SY(SYS_sync); SUCC;
188 /* kill 37 */
189 GO(SYS_kill, "2s 0m");
190 SY(SYS_kill, x0, x0); SUCC;
192 /* old stat 38 */
194 /* getppid 39 */
195 GO(SYS_getppid, "0s 0m");
196 SY(SYS_getppid); SUCC;
198 /* old lstat 40 */
200 /* dup 41 */
201 GO(SYS_dup, "1s 0m");
202 SY(SYS_dup, x0-1); FAIL;
204 #if !defined(VGP_arm64_freebsd)
205 /* freebsd10_pipe 42 */
206 #if defined(SYS_freebsd10_pipe)
207 GO(SYS_freebsd10_pipe, "0s 0m");
208 SY(SYS_freebsd10_pipe, x0); SUCC;
209 #else
210 GO(SYS_pipe, "0s 0m");
211 SY(SYS_pipe, x0); SUCC;
212 #endif
213 #else
214 FAKE_GO(" 42: SYS_freebsd10_pipe 0s 0m");
215 #endif
217 /* getegid 43 */
218 GO(SYS_getegid, "0s 0m");
219 SY(SYS_getegid); SUCC;
221 /* profil 44 */
222 GO(SYS_profil, "ni");
223 SY(SYS_profil, x0, x0, x0, x0);
225 /* ktrace 45 */
226 GO(SYS_ktrace, "ni");
227 SY(SYS_ktrace, x0, x0, x0, x0);
229 /* old sigaction 46 */
231 /* getgid 47 */
232 GO(SYS_getgid, "0s 0m");
233 SY(SYS_getgid); SUCC;
235 /* old sigprocmask 48 */
237 /* getlogin 49 */
238 GO(SYS_getlogin, "2s 1m");
239 SY(SYS_getlogin, x0, x0+20); FAIL;
241 /* setlogin 50 */
242 GO(SYS_setlogin, "1s 1m");
243 SY(SYS_setlogin, x0); FAIL;
245 /* acct 51 */
246 GO(SYS_acct, "1s 1m");
247 SY(SYS_acct, x0-1); FAIL;
249 /* 4.3 sigpending 52 */
250 /* sigaltstack 53 */
252 struct our_sigaltstack {
253 char *ss_sp;
254 size_t ss_size;
255 int ss_flags;
256 } ss = { NULL, 0, 0};
257 struct our_sigaltstack oss;
258 VALGRIND_MAKE_MEM_NOACCESS(&ss, sizeof(struct our_sigaltstack));
259 VALGRIND_MAKE_MEM_NOACCESS(&oss, sizeof(struct our_sigaltstack));
260 GO(SYS_sigaltstack, "2s 4m");
261 SY(SYS_sigaltstack, x0+&ss, x0+&oss); FAIL;
264 /* SYS_ioctl 54 */
265 #include <termios.h>
266 GO(SYS_ioctl, "3s 1m");
267 SY(SYS_ioctl, x0, x0+TIOCGWINSZ, x0); FAIL;
269 /* SYS_reboot 55 */
270 /* how to test that and be sure of not rebooting? */
272 /* SYS_revoke 56 */
273 GO(SYS_revoke, "1s 1m");
274 SY(SYS_revoke, x0); FAIL;
276 /* SYS_symlink 57 */
277 GO(SYS_symlink, "2s 2m");
278 SY(SYS_symlink, x0, x0); FAIL;
280 /* SYS_readlink 58 */
281 GO(SYS_readlink, "3s 2m");
282 SY(SYS_readlink, x0+1, x0+1, x0+1); FAIL;
284 /* SYS_execve 59 */
285 GO(SYS_execve, "3s 1m");
286 SY(SYS_execve, x0 + 1, x0 + 1, x0); FAIL;
288 /* SYS_umask 60 */
289 GO(SYS_umask, "1s 0m");
290 SY(SYS_umask, x0+022); SUCC;
292 /* SYS_chroot 61 */
293 GO(SYS_chroot, "1s 1m");
294 SY(SYS_chroot, x0); FAIL;
296 /* 4.3 fstat 62 */
298 /* 4.3 getgerninfo 63 */
300 /* 4.3 getpagesize 64 */
302 /* SYS_msync 65 */
303 GO(SYS_msync, "3s 1m");
304 SY(SYS_msync, x0, x0+1, x0); FAIL;
306 /* SYS_vfork 66 */
307 GO(SYS_vfork, "other");
308 // (see scalar_vfork.c)
310 /* obsol vread 67 */
312 /* obsol vwrite 68 */
314 /* SYS_sbrk 69 */
315 #if defined(SYS_sbrk)
316 GO(SYS_sbrk, "1s 1m");
317 SY(SYS_sbrk, x0); FAIL;
318 #else
319 FAKE_GO(" 69: SYS_sbrk 1s 1m");
320 FAKE_SY("Syscall param sbrk(incr) contains uninitialised byte(s)\n")
321 FAKE_SY(" ...\n");
322 FAKE_SY("\n");
323 #endif
325 /* not implemented on OS SYS_sstk 70 */
327 /* 4.3 mmap 71 */
329 /* 4.2 vadvise 72 */
331 /* SYS_munmap 73 */
332 GO(SYS_munmap, "2s 0m");
333 SY(SYS_munmap, x0, x0); FAIL;
335 /* SYS_mprotect 74 */
336 GO(SYS_mprotect, "3s 0m");
337 SY(SYS_mprotect, x0+1, x0-10, x0+9999); FAIL;
339 /* SYS_madvise 75 */
340 GO(SYS_madvise, "3s 0m");
341 SY(SYS_madvise, x0, x0+1, x0); FAILx(EINVAL);
343 /* obsol vhangup 76 */
345 /* obsol vlimit 77 */
347 /* SYS_mincore 78 */
348 GO(SYS_mincore, "3s 1m");
349 SY(SYS_mincore, x0, x0+40960, x0); FAIL;
351 /* SYS_getgroups 79 */
352 GO(SYS_getgroups, "2s 1m");
353 SY(SYS_getgroups, x0+1, x0+1); FAIL;
355 /* SYS_setgroups 80 */
356 GO(SYS_setgroups, "2s 1m");
357 SY(SYS_setgroups, x0+1, x0+1); FAIL;
359 /* SYS_getpgrp 81 */
360 GO(SYS_getpgrp, "0s 0m");
361 SY(SYS_getpgrp); SUCC;
363 /* SYS_setpgid 82 */
364 GO(SYS_setpgid, "2s 0m");
365 SY(SYS_setpgid, x0, x0-1); FAIL;
367 /* SYS_setitimer 83 */
368 GO(SYS_setitimer, "3s 2m");
369 SY(SYS_setitimer, x0, x0+1, x0+1); FAIL;
371 /* 4.3 wait 84 */
373 /* SYS_swapon 85 */
374 GO(SYS_swapon, "1s 1m");
375 SY(SYS_swapon, x0+1); FAIL;
377 /* SYS_getitimer 86 */
378 GO(SYS_getitimer, "2s 1m");
379 SY(SYS_getitimer, x0+4, x0+1); FAIL;
381 /* 4.3 gethostname 87 */
383 /* 4.3 sethostname 88 */
385 /* SYS_getdtablesize 89 */
386 GO(SYS_getdtablesize, "0s 0m");
387 SY(SYS_getdtablesize); SUCC;
389 /* SYS_dup2 90 */
390 GO(SYS_dup2, "2s 0m");
391 SY(SYS_dup2, x0-1, x0); FAIL;
393 /* unimpl getdopt 91 */
395 /* SYS_fcntl 92 */
396 /* takes varargs so two versions of test */
397 GO(SYS_fcntl, "(GETFD) 2s 0m");
398 SY(SYS_fcntl, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
400 GO(SYS_fcntl, "(DUPFD) 1s 0m");
401 SY(SYS_fcntl, -1, F_DUPFD, x0); FAILx(EBADF);
403 /* SYS_select 93 */
404 GO(SYS_select, "5s 4m");
405 SY(SYS_select, x0+8, x0+0xffffffee, x0+1, x0+1, x0+1); FAIL;
407 /* unimpl setdopt 94 */
409 /* SYS_fsync 95 */
410 GO(SYS_fsync, "1s 0m");
411 SY(SYS_fsync, x0-1); FAIL;
413 /* SYS_setpriority 96 */
414 GO(SYS_setpriority, "3s 0m");
415 SY(SYS_setpriority, x0-1, x0, x0); FAIL;
417 /* SYS_socket 97 */
418 GO(SYS_socket, "3s 0m");
419 SY(SYS_socket, x0, x0, x0); FAIL;
421 /* SYS_connect 98 */
422 /* needs a socket for the 1m ? */
423 GO(SYS_connect, "3s 0m");
424 SY(SYS_connect, x0, x0, x0); FAIL;
426 /* 4.3 accept 99 */
428 /* SYS_getpriority 100 */
429 GO(SYS_getpriority, "2s 0m");
430 SY(SYS_getpriority, x0-1, x0); FAIL;
432 /* 4.3 send 101 */
433 /* 4.3 recv 102 */
434 /* 4.3 sigreturn 103 */
436 /* SYS_bind 104 */
437 GO(SYS_bind, "3s 0m");
438 /* as connect, needs a socket */
439 SY(SYS_bind, x0, x0, x0); FAIL;
441 /* SYS_setsockopt 105 */
442 GO(SYS_setsockopt, "5s 0m");
443 SY(SYS_setsockopt, x0, x0, x0, x0, x0); FAIL;
445 /* SYS_listen 106 */
446 GO(SYS_listen, "2s 0m");
447 SY(SYS_listen, x0, x0); FAIL;
449 /* obsol vtimes 107 */
451 /* 4.3 sigvec 108 */
453 /* 4.3 sigblock 109 */
455 /* 4.3 sigsetmask 110 */
457 /* 4.3 sigsuspend 111 */
459 /* 4.3 sigstack 112 */
461 /* 4.3 recvmsg 113 */
463 /* 4.3 sendmsg 114 */
465 /* 4.3 vtrace 115 */
467 /* SYS_gettimeofday 116 */
468 GO(SYS_gettimeofday, "2s 2m");
469 SY(SYS_gettimeofday, x0+1, x0+1); FAIL;
471 /* SYS_getrusage 117 */
472 GO(SYS_getrusage, "2s 1m");
473 SY(SYS_getrusage, x0, x0); FAIL;
475 /* SYS_getsockopt 118 */
476 GO(SYS_setsockopt, "5s 1m");
477 SY(SYS_setsockopt, x0, x0, x0, x0, x0); FAIL;
479 /* unimpl resuba 119 */
481 /* SYS_readv 120 */
482 GO(SYS_readv, "3s 1m");
483 SY(SYS_readv, x0, x0, x0+1); FAIL;
485 /* SYS_writev 121 */
486 GO(SYS_writev, "3s 1m");
487 SY(SYS_writev, x0, x0, x0+1); FAIL;
489 /* SYS_settimeofday 122 */
490 GO(SYS_settimeofday, "2s 2m");
491 SY(SYS_settimeofday, x0+1, x0+1); FAIL;
493 /* SYS_fchown 123 */
494 GO(SYS_fchown, "3s 0m");
495 SY(SYS_fchown, x0-1, x0, x0); FAIL;
497 /* SYS_fchmod 124 */
498 GO(SYS_fchmod, "2s 0m");
499 SY(SYS_fchmod, x0-1, x0); FAIL;
501 /* 4.3 recvfrom 125 */
503 /* SYS_setreuid 126 */
504 GO(SYS_setreuid, "2s 0m");
505 SY(SYS_setreuid, x0+1, x0+1); FAIL;
507 /* SYS_setregid 127 */
508 GO(SYS_setregid, "2s 0m");
509 SY(SYS_setregid, x0+1, x0+1); FAIL;
511 /* SYS_rename 128 */
512 GO(SYS_rename, "2s 2m");
513 SY(SYS_rename, x0, x0); FAIL;
515 /* 4.3 truncate 129 */
517 /* 4.3 ftruncate 130 */
519 /* SYS_flock 131 */
520 GO(SYS_flock, "2s 0m");
521 SY(SYS_flock, x0, x0); FAIL;
523 /* SYS_mkfifo 132 */
524 GO(SYS_mkfifo, "2s 1m");
525 SY(SYS_mkfifo, x0, x0); FAIL;
527 /* SYS_sendto 133 */
528 GO(SYS_sendto, "6s 0m");
529 SY(SYS_sendto, x0, x0, x0, x0, x0, x0); FAIL;
531 /* SYS_shutdown 134 */
532 /* don't really want to to this */
534 /* SYS_socketpair 135 */
535 GO(SYS_socketpair, "4s 1m");
536 SY(SYS_socketpair, x0, x0, x0, x0); FAIL;
538 /* SYS_mkdir 136 */
539 GO(SYS_mkdir, "2s 1m");
540 SY(SYS_mkdir, x0, x0); FAIL;
542 /* SYS_rmdir 137 */
543 GO(SYS_rmdir, "1s 1m");
544 SY(SYS_rmdir, x0); FAIL;
546 /* SYS_utimes 138 */
547 GO(SYS_utimes, "2s 2m");
548 SY(SYS_utimes, x0, x0+1); FAIL;
550 /* 4.2 sigreturn 139 */
552 /* SYS_adjtime 140 */
553 GO(SYS_adjtime, "2s 1m");
554 SY(SYS_adjtime, x0+1, x0); FAIL;
556 GO(SYS_adjtime, "2s 2m");
557 SY(SYS_adjtime, x0+1, x0+1); FAIL;
559 /* 4.3 getpeername 141 */
561 /* 4.3 gethostid 142 */
563 /* 4.3 sethostid 143 */
565 /* 4.3 getrlimit` 144 */
567 /* 4.3 setrlimit 145 */
569 /* 4.3 killpg 146 */
571 /* SYS_setsid 147 */
572 GO(SYS_setsid, "0s 0m");
573 SY(SYS_setsid);
574 if (running_in_vgtest) {
575 SUCC;
576 } else {
577 FAIL;
580 /* SYS_quotactl 148 */
581 GO(SYS_quotactl, "(Q_QUOTAOFF) 2s 0m");
582 SY(SYS_quotactl, x0, x0+Q_QUOTAOFF, x0, x0); FAIL;
584 GO(SYS_quotactl, "(Q_QUOTAON) 4s 2m");
585 SY(SYS_quotactl, x0, x0+Q_QUOTAON, x0, x0); FAIL;
587 /* 4.3 quota 149 */
589 /* 4.3 getsockname 150 */
591 /* bsd/os sem_lock 151 */
593 /* bsd/os sem_wakeup 152 */
595 /* bsd/os asyncdaemon 153 */
597 /* SYS_nlm_syscall 154 */
599 // BSDXY(__NR_nfssvc, sys_nfssvc), // 155
601 /* 4.3 getdirentries 156 */
603 /* freebsd 4 statfs 157 */
605 /* freebsd 4 fstatfs 158 */
607 /* SYS_lgetfh 160 */
608 GO(SYS_lgetfh, "2s 2m");
609 SY(SYS_lgetfh, x0, x0); FAIL;
611 /* SYS_getfh 161 */
612 GO(SYS_getfh, "2s 2m");
613 SY(SYS_getfh, x0, x0); FAIL;
615 /* SYS_freebsd4_getdomainname 162 */
616 /* SYS_freebsd4_setdomainname 163 */
617 /* SYS_freebsd_4uname 164 */
619 /* SYS_sysarch 165 */
620 #if defined (VGP_x86_freebsd)
621 GO(SYS_sysarch, "2s 1m");
622 SY(SYS_sysarch, x0+I386_GET_GSBASE, x0); FAIL;
624 GO(SYS_sysarch, "2s 0m");
625 SY(SYS_sysarch, x0+I386_SET_GSBASE, x0); FAIL;
626 #elif defined(VGP_amd64_freebsd)
627 GO(SYS_sysarch, "2s 1m");
628 SY(SYS_sysarch, x0+AMD64_GET_FSBASE, x0); FAIL;
630 GO(SYS_sysarch, "2s 0m");
631 SY(SYS_sysarch, x0+AMD64_SET_FSBASE, x0); FAIL;
632 #elif defined(VGP_arm64_freebsd)
633 // does not exist
634 FAKE_GO("165: SYS_sysarch 2s 1m");
635 FAKE_SY("Syscall param sysarch(number) contains uninitialised byte(s)\n");
636 FAKE_SY(" ...\n");
637 FAKE_SY("\n");
638 FAKE_SY("Syscall param sysarch(args) contains uninitialised byte(s)\n");
639 FAKE_SY(" ...\n");
640 FAKE_SY("\n");
641 FAKE_SY("Syscall param amd64_get_fsbase(basep) points to unaddressable byte(s)\n");
642 FAKE_SY(" ...\n");
643 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
644 FAKE_SY("\n");
645 FAKE_GO("165: SYS_sysarch 2s 0m");
646 FAKE_SY("Syscall param sysarch(number) contains uninitialised byte(s)\n");
647 FAKE_SY(" ...\n");
648 FAKE_SY("\n");
649 FAKE_SY("Syscall param sysarch(args) contains uninitialised byte(s)\n");
650 FAKE_SY(" ...\n");
651 FAKE_SY("\n");
653 #else
654 #error "freebsd platform not defined"
655 #endif
657 /* SYS_rtprio 166 */
658 GO(SYS_rtprio, "(GET) 3s 1m");
659 SY(SYS_rtprio, x0, x0, x0); FAIL;
661 GO(SYS_rtprio, "(SET) 3s 1m");
662 SY(SYS_rtprio, x0+1, x0, x0); FAIL;
664 /* following 3 not implemented in OS */
665 /* SYS_semsys 169 */
666 /* SYS_msgsys 170 */
667 /* SYS_shmsys 171 */
669 /* SYS_freebsd6_pread 173 */
670 /* SYS_freebsd6_pwrite 174 */
672 /* SYS_setfib 175 */
673 GO(SYS_setfib, "1s 0m");
674 SY(SYS_setfib, x0+10); FAIL;
676 // BSDXY(__NR_ntp_adjtime, sys_ntp_adjtime), // 176
678 /* bsd/os sfork 177 */
679 /* bsd/os getdescriptor 178 */
680 /* bsd/os setdescriptor 179 */
682 /* SYS_setgid, 181 */
683 GO(SYS_setgid, "1s 0m");
684 SY(SYS_setgid, x0-1); FAIL;
686 /* SYS_setegid 182 */
687 GO(SYS_setegid, "1s 0m");
688 SY(SYS_setegid, x0-1); FAIL;
690 /* SYS_seteuid 183 */
691 GO(SYS_seteuid, "1s 0m");
692 SY(SYS_seteuid, x0-1); FAIL;
695 /* unimpl lfs_bmapv 184 */
697 /* unimpl lfs_markv 185 */
699 /* unimpl lfs_segclean 186 */
701 /* unimpl lfs_segwait 187 */
703 #if defined(SYS_freebsd11_stat)
704 /* SYS_freebsd11_stat 188 */
705 GO(SYS_freebsd11_stat, "2s 2m");
706 SY(SYS_freebsd11_stat, x0, x0); FAIL;
707 #else
708 /* SYS_stat 188 */
709 GO(SYS_stat, "2s 2m");
710 SY(SYS_stat, x0, x0); FAIL;
711 #endif
713 #if defined(SYS_freebsd11_fstat)
714 /* SYS_freebsd11_fstat 189 */
715 GO(SYS_freebsd11_fstat, "2s 1m");
716 SY(SYS_freebsd11_fstat, x0, x0); FAIL;
717 #else
718 /* SYS_fstat 189 */
719 GO(SYS_fstat, "2s 1m");
720 SY(SYS_fstat, x0, x0); FAIL;
721 #endif
723 #if defined(SYS_freebsd11_lstat)
724 /* SYS_freebsd11_lstat 190 */
725 GO(SYS_freebsd11_lstat, "2s 2m");
726 SY(SYS_freebsd11_lstat, x0, x0); FAIL;
727 #else
728 /* SYS_lstat 190 */
729 GO(SYS_lstat, "2s 2m");
730 SY(SYS_lstat, x0, x0); FAIL;
731 #endif
733 /* SYS_pathconf 191 */
734 GO(SYS_pathconf, "2s 1m");
735 SY(SYS_pathconf, x0, x0); FAIL;
737 /* SYS_fpathconf 192 */
738 GO(SYS_fpathconf, "2s 0m");
739 SY(SYS_fpathconf, x0, x0); FAIL;
741 /* nosys 193 */
743 /* SYS_getrlimit 194 */
744 GO(SYS_getrlimit, "2s 1m");
745 SY(SYS_getrlimit, x0, x0); FAIL;
747 /* SYS_3etrlimit 195 */
748 GO(SYS_setrlimit, "2s 1m");
749 SY(SYS_setrlimit, x0, x0); FAIL;
751 /* SYS_freebsd11_getdirentries 196 */
752 #if defined(SYS_freebsd11_getdirentries)
753 GO(SYS_freebsd11_getdirentries, "4s 2m");
754 SY(SYS_freebsd11_getdirentries, x0, x0, x0+3, x0+1); FAIL;
755 #else
756 GO(SYS_getdirentries, "4s 2m");
757 SY(SYS_getdirentries, x0, x0, x0+3, x0+1); FAIL;
758 #endif
760 /* SYS_freebsd6_mmap 197*/
762 /* __syscall (handled specially) 198 */
764 /* SYS_freebsd6_lseek 199 */
765 /* SYS_freebsd6_truncate 200 */
766 /* SYS_freebsd6_ftruncate 201 */
768 /* SYS___sysctl 202 */
769 GO(SYS___sysctl, "(getoldlen) 3s 2m");
770 SY(SYS___sysctl, x0, x0+1, NULL, x0+1, NULL, x0); FAIL;
772 GO(SYS___sysctl, "(getold) 4s 2m");
773 SY(SYS___sysctl, x0, x0+1, x0+1, x0+1, NULL, x0); FAIL;
775 GO(SYS___sysctl, "(putnew) 4s 2m");
776 SY(SYS___sysctl, x0, x0+1, NULL, NULL, x0+1, x0+2); FAIL;
778 /* SYS_mlock 203 */
779 GO(SYS_mlock, "2s 0m");
780 SY(SYS_mlock, x0, x0+1); FAIL;
782 /* SYS_munlock 204 */
783 GO(SYS_munlock, "2s 0m");
784 SY(SYS_munlock, x0, x0+1); FAIL;
786 /* SYS_undelete 205 */
787 GO(SYS_undelete, "1s 1m");
788 SY(SYS_undelete, x0); FAIL;
790 /* SYS_futimes 206 */
791 GO(SYS_futimes, "2s 0m");
792 /* not 1m? */
793 SY(SYS_futimes, x0+5, x0); FAIL;
795 /* SYS_getpgid 207 */
796 GO(SYS_getpgid, "1s 0m");
797 SY(SYS_getpgid, x0-1); FAIL;
799 /* netbsd newreboot 208 */
801 /* SYS_poll 209 */
802 GO(SYS_poll, "2s 2m");
803 SY(SYS_poll, x0, x0+1, x0); FAIL;
806 struct pollfd fds = { x0, x0, x0 };
807 GO(SYS_poll, "0s 2m");
808 SY(SYS_poll, &fds, 1, 1); SUCC;
811 // On aarch64 this is defined in the header but
812 // the kernel returns ENOSYS
813 // The aarch64 port postdates FreeBSD 7
814 #if !defined(VGP_arm64_freebsd)
815 #if defined(SYS_freebsd7___semctl)
816 /* SYS_freebsd7___semctl 220 */
817 GO(SYS_freebsd7___semctl, "(IPC_STAT) 4s 1m");
818 SY(SYS_freebsd7___semctl, x0, x0, x0+IPC_STAT, x0+1); FAIL;
820 GO(SYS_freebsd7___semctl, "(bogus cmd) 3s 0m");
821 SY(SYS_freebsd7___semctl, x0, x0, x0-1, x0+1); FAIL;
822 #endif
823 #else
824 FAKE_GO("220: SYS_freebsd7___semctl (IPC_STAT) 4s 1m");
825 FAKE_SY("Syscall param semctl(semid) contains uninitialised byte(s)\n");
826 FAKE_SY(" ...\n");
827 FAKE_SY("\n");
828 FAKE_SY("Syscall param semctl(semnum) contains uninitialised byte(s)\n");
829 FAKE_SY(" ...\n");
830 FAKE_SY("\n");
831 FAKE_SY("Syscall param semctl(cmd) contains uninitialised byte(s)\n");
832 FAKE_SY(" ...\n");
833 FAKE_SY("\n");
834 FAKE_SY("Syscall param semctl(arg) contains uninitialised byte(s)\n");
835 FAKE_SY(" ...\n");
836 FAKE_SY("\n");
837 FAKE_SY("Syscall param sys_freebsd7___semctl(arg) points to unaddressable byte(s)\n");
838 FAKE_SY(" ...\n");
839 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
840 FAKE_SY("\n");
841 FAKE_GO("220: SYS_freebsd7___semctl (bogus cmd) 3s 0m");
842 FAKE_SY("Syscall param semctl(semid) contains uninitialised byte(s)\n");
843 FAKE_SY(" ...\n");
844 FAKE_SY("\n");
845 FAKE_SY("Syscall param semctl(semnum) contains uninitialised byte(s)\n");
846 FAKE_SY(" ...\n");
847 FAKE_SY("\n");
848 FAKE_SY("Syscall param semctl(cmd) contains uninitialised byte(s)\n");
849 FAKE_SY(" ...\n");
850 FAKE_SY("\n");
851 #endif
853 /* SYS_semget 221 */
854 GO(SYS_semget, "3s 0m");
855 SY(SYS_semget, x0, x0, x0); FAIL;
857 /* SYS_semop 222 */
858 GO(SYS_semop, "3s 0m");
859 SY(SYS_semop, x0, x0, x0); FAIL;
861 /* unimpl semconfig 223 */
863 #if !defined(VGP_arm64_freebsd)
864 #if defined(SYS_freebsd7_msgctl)
865 /* SYS_freebsd7_msgctl 224 */
866 GO(SYS_freebsd7_msgctl, "(set) 3s 1m");
867 SY(SYS_freebsd7_msgctl, x0, x0+1, x0); FAIL;
869 GO(SYS_freebsd7_msgctl, "(stat) 3s 1m");
870 SY(SYS_freebsd7_msgctl, x0, x0+2, x0); FAIL;
871 #endif
872 #else
873 FAKE_GO("224: SYS_freebsd7_msgctl (set) 3s 1m");
874 FAKE_SY("Syscall param msgctl(msqid) contains uninitialised byte(s)\n");
875 FAKE_SY(" ...\n");
876 FAKE_SY("\n");
877 FAKE_SY("Syscall param msgctl(cmd) contains uninitialised byte(s)\n");
878 FAKE_SY(" ...\n");
879 FAKE_SY("\n");
880 FAKE_SY("Syscall param msgctl(buf) contains uninitialised byte(s)\n");
881 FAKE_SY(" ...\n");
882 FAKE_SY("\n");
883 FAKE_SY("Syscall param msgctl(IPC_SET, buf) points to unaddressable byte(s)\n");
884 FAKE_SY(" ...\n");
885 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
886 FAKE_SY("\n");
888 FAKE_GO("224: SYS_freebsd7_msgctl (stat) 3s 1m");
889 FAKE_SY("Syscall param msgctl(msqid) contains uninitialised byte(s)\n");
890 FAKE_SY(" ...\n");
891 FAKE_SY("\n");
892 FAKE_SY("Syscall param msgctl(cmd) contains uninitialised byte(s)\n");
893 FAKE_SY(" ...\n");
894 FAKE_SY("\n");
895 FAKE_SY("Syscall param msgctl(buf) contains uninitialised byte(s)\n");
896 FAKE_SY(" ...\n");
897 FAKE_SY("\n");
898 FAKE_SY("Syscall param msgctl(IPC_STAT, buf) points to unaddressable byte(s)\n");
899 FAKE_SY(" ...\n");
900 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
901 FAKE_SY("\n");
902 #endif
904 /* SYS_msgget 225 */
905 GO(SYS_msgget, "2s 0m");
906 SY(SYS_msgget, x0-1, x0); FAIL;
908 /* SYS_msgsnd 226 */
909 GO(SYS_msgsnd, "4s 1m");
910 SY(SYS_msgsnd, x0, x0, x0, x0); FAIL;
912 /* SYS_msgrcv 227 */
913 GO(SYS_msgrcv, "4+1s 1m");
914 SY(SYS_msgrcv, x0-1, x0+1, x0+4, x0, x0); FAIL;
916 /* SYS_shmat 228 */
917 GO(SYS_shmat, "3s 0m");
918 SY(SYS_shmat, x0, x0, x0); FAIL;
920 #if !defined(VGP_arm64_freebsd)
921 #if defined(SYS_freebsd7_shmctl)
922 /* SYS_freebsd7_shmctl 229 */
923 GO(SYS_freebsd7_shmctl, "3s 0m");
924 SY(SYS_freebsd7_shmctl, x0, x0, x0); FAIL;
926 GO(SYS_freebsd7_shmctl, "(bogus cmd) 3s 0m");
927 SY(SYS_freebsd7_shmctl, x0, x0-1, x0+1); FAIL;
928 #endif
929 #else
930 FAKE_GO("229: SYS_freebsd7_shmctl 3s 0m");
931 FAKE_SY("Syscall param shmctl(shmid) contains uninitialised byte(s)\n");
932 FAKE_SY(" ...\n");
933 FAKE_SY("\n");
934 FAKE_SY("Syscall param shmctl(cmd) contains uninitialised byte(s)\n");
935 FAKE_SY(" ...\n");
936 FAKE_SY("\n");
937 FAKE_SY("Syscall param shmctl(buf) contains uninitialised byte(s)\n");
938 FAKE_SY(" ...\n");
939 FAKE_SY("\n");
941 FAKE_GO("229: SYS_freebsd7_shmctl (bogus cmd) 3s 0m");
942 FAKE_SY("Syscall param shmctl(shmid) contains uninitialised byte(s)\n");
943 FAKE_SY(" ...\n");
944 FAKE_SY("\n");
945 FAKE_SY("Syscall param shmctl(cmd) contains uninitialised byte(s)\n");
946 FAKE_SY(" ...\n");
947 FAKE_SY("\n");
948 FAKE_SY("Syscall param shmctl(buf) contains uninitialised byte(s)\n");
949 FAKE_SY(" ...\n");
950 FAKE_SY("\n");
952 #endif
954 /* SYS_shmdt 230 */
955 GO(SYS_shmdt, "1s 0m");
956 SY(SYS_shmdt, x0); FAIL;
958 /* SYS_shmget 231 */
959 GO(SYS_shmget, "3s 0m");
960 SY(SYS_shmget, x0, x0, x0); FAIL;
962 /* SYS_clock_gettime 232 */
963 GO(SYS_clock_gettime, "2s 1m");
964 SY(SYS_clock_gettime, x0, x0+1); FAIL;
966 /* SYS_clock_settime 233 */
967 GO(SYS_clock_settime, "2s 1m");
968 SY(SYS_clock_settime, x0, x0); FAIL;
970 /* SYS_clock_getres 234 */
971 GO(SYS_clock_getres, "2s 1m");
972 SY(SYS_clock_getres, x0, x0+1); FAIL;
974 /* SYS_ktimer_create 235 */
975 GO(SYS_ktimer_create, "3s 2m");
976 SY(SYS_ktimer_create, x0-1, x0+1, x0+1); FAIL;
978 /* SYS_ktimer_delete 236 */
979 GO(SYS_ktimer_delete, "1s 0m");
980 SY(SYS_ktimer_delete, x0); FAIL;
982 /* SYS_ktimer_settime 237 */
983 GO(SYS_ktimer_settime, "4s 2m");
984 SY(SYS_ktimer_settime, x0-1, x0+1, x0+1, x0+1); FAIL;
986 /* SYS_ktimer_gettime 238 */
987 GO(SYS_ktimer_gettime, "2s 1m");
988 SY(SYS_ktimer_gettime, x0-1, x0+1); FAIL;
990 /* SYS_ktimer_getoverrun 239 */
991 GO(SYS_ktimer_getoverrun, "1s 0m");
992 SY(SYS_ktimer_getoverrun, x0+1); FAIL;
994 /* SYS_nanosleep 240 */
995 GO(SYS_nanosleep, "2s 2m");
996 SY(SYS_nanosleep, x0, x0+1); FAIL;
998 // unimpl SYS_ffclock_getcounter 241
1000 // unimpl SYS_ffclock_setestimate 242
1002 // unimpl SYS_ffclock_getestimate 243
1004 #if defined(SYS_clock_nanosleep)
1005 /* SYS_clock_nanosleep 244 */
1006 GO(SYS_clock_nanosleep, "4s 2m");
1007 SY(SYS_clock_nanosleep, x0+5000, x0+3000, x0+3, x0+1); SUCC;
1008 assert(res == EFAULT);
1009 #endif
1011 // SYS_clock_getcpuclockid2 247
1012 GO(SYS_clock_getcpuclockid2, "3s 1m");
1013 SY(SYS_clock_getcpuclockid2, x0+1, x0+1, x0+1); FAIL;
1015 // BSDXY(__NR_ntp_gettime, sys_ntp_gettime), // 248
1017 /* SYS_minherit 250 */
1018 // @todo PJF causes Valgrind to crash
1019 //GO(SYS_minherit, "3s 1m");
1020 //SY(SYS_minherit, x0, x0+1024, x0+1); SUCC;
1021 GO(SYS_minherit, "@todo");
1023 /* SYS_rfork 251 */
1024 GO(SYS_rfork, "other");
1026 /* openbsd_poll 252 */
1028 /* SYS_issetugid 253 */
1029 GO(SYS_issetugid, "0s 0m");
1030 SY(SYS_issetugid); SUCC;
1032 /* SYS_lchown 254 */
1033 GO(SYS_lchown, "3s 1m");
1034 SY(SYS_lchown, x0, x0+1234, x0+2345); FAIL;
1036 /* SYS_aio_read 255 */
1037 GO(SYS_aio_read, "1s 1m");
1038 SY(SYS_aio_read, x0+1); FAIL;
1040 /* SYS_aio_write 256 */
1041 GO(SYS_aio_write, "1s 1m");
1042 SY(SYS_aio_write, x0+1); FAIL;
1044 /* SYS_lio_listio 257 */
1045 GO(SYS_lio_listio, "4s 2m");
1046 SY(SYS_lio_listio, x0+0, x0+1, x0+10, x0+1); FAIL;
1048 /* SYS_freebsd11_getdents 272 */
1049 #if defined(SYS_freebsd11_getdents)
1050 GO(SYS_freebsd11_getdents, "3s 1m");
1051 SY(SYS_freebsd11_getdents, x0+9, x0+1, x0+2); FAIL;
1052 #else
1053 GO(SYS_getdents, "3s 1m");
1054 SY(SYS_getdents, x0+9, x0+1, x0+2); FAIL;
1055 #endif
1057 /* SYS_lchmod 274 */
1058 GO(SYS_lchmod, "2s 1m");
1059 SY(SYS_lchmod, x0, x0+1234); FAIL;
1061 /* netbsd_lchown 275 */
1063 /* SYS_lutimes 276 */
1064 GO(SYS_lutimes, "3s 2m");
1065 SY(SYS_lutimes, x0+9, x0+1, x0+2); FAIL;
1067 /* netbsd msync 277 */
1069 /* netbsd stat 278 */
1071 /* netbsd fstat 279 */
1073 /* netbsd lstat 280 */
1075 /* SYS_preadv 289 */
1076 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1077 GO(SYS_preadv, "4s 0m");
1078 /* 0m because of the bogus fd */
1079 SY(SYS_preadv, x0+9999999, x0+1, x0+16, x0+20); FAIL;
1080 #else
1081 GO(SYS_preadv, "5s 0m");
1082 SY(SYS_preadv, x0+9999999, x0+1, x0+16, x0, x0+20); FAIL;
1083 #endif
1085 /* SYS_pwritev 290 */
1086 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1087 GO(SYS_pwritev, "4s 0m");
1088 SY(SYS_pwritev, x0+9999999, x0+1, x0+16, x0+20); FAIL;
1089 #else
1090 GO(SYS_pwritev, "5s 0m");
1091 SY(SYS_pwritev, x0+9999999, x0+1, x0+16, x0, x0+20); FAIL;
1092 #endif
1094 /* freebsd 4 fhstatfs 297 */
1096 /* SYS_fhopen 298 */
1097 GO(SYS_fhopen, "2s 1m");
1098 SY(SYS_fhopen, x0+1, x0); FAIL;
1100 /* SYS_fhstat 299 */
1101 GO(SYS_fhstat, "2s 2m");
1102 SY(SYS_fhstat, x0+1, x0+2); FAIL;
1104 /* SYS_modnext 300 */
1105 GO(SYS_modnext, "1s 0m");
1106 SY(SYS_modnext, x0+100000); FAIL;
1108 /* SYS_modstat 301 */
1109 GO(SYS_modstat, "2s 1m");
1110 SY(SYS_modstat, x0+1234, x0+1); FAIL;
1112 /* SYS_modfnext 302 */
1113 GO(SYS_modfnext, "1s 0m");
1114 SY(SYS_modfnext, x0+100000); FAIL;
1116 /* SYS_modfind 303 */
1117 GO(SYS_modfind, "1s 1m");
1118 SY(SYS_modfind, x0+1234, x0+1); FAIL;
1120 /* SYS_kldload 304 */
1121 GO(SYS_kldload, "1s 1m");
1122 SY(SYS_kldload, x0+1); FAIL;
1124 /* SYS_kldunload 305 */
1125 GO(SYS_kldunload, "1s 0m");
1126 SY(SYS_kldunload, x0+1); FAIL;
1128 /* SYS_kldfind 306 */
1129 GO(SYS_kldfind, "1s 1m");
1130 SY(SYS_kldfind, x0+1); FAIL;
1132 /* SYS_kldnext 307 */
1133 GO(SYS_kldnext, "1s 0m");
1134 SY(SYS_kldnext, x0+1000); FAIL;
1136 /* SYS_kldstat 308 */
1137 GO(SYS_kldstat, "2s 1m");
1138 SY(SYS_kldstat, x0+1234, x0+1); FAIL;
1140 /* SYS_kldfirstmod 309 */
1141 GO(SYS_kldfirstmod, "1s 0m");
1142 SY(SYS_kldfirstmod, x0+1000); FAIL;
1144 /* SYS_getsid 310 */
1145 GO(SYS_getsid, "1s 0m");
1146 SY(SYS_getsid, x0-1); FAIL;
1148 /* SYS_setresuid 311 */
1149 GO(SYS_setresuid, "3s 0m");
1150 SY(SYS_setresuid, x0+1, x0+2, x0+3); FAIL;
1152 /* SYS_setresgid 312 */
1153 GO(SYS_setresgid, "3s 0m");
1154 SY(SYS_setresgid, x0+1, x0+2, x0+3); FAIL;
1156 /* obsol signanosleep 313 */
1158 /* SYS_aio_return 314 */
1159 GO(SYS_aio_return, "1s 1m");
1160 SY(SYS_aio_return, x0+1); FAIL;
1162 /* SYS_aio_suspend 315 */
1163 GO(SYS_aio_suspend, "3s 2m");
1164 SY(SYS_aio_suspend, x0+1, x0+1, x0+1); FAIL;
1166 /* SYS_aio_cancel 316 */
1167 GO(SYS_aio_cancel, "2s 1m");
1168 SY(SYS_aio_cancel, x0-1, x0+1); FAIL;
1170 /* SYS_aio_error 317 */
1171 GO(SYS_aio_error, "1s 1m");
1172 SY(SYS_aio_error, x0+1); FAIL;
1174 /* freebsd 6 aio_read 318 */
1176 /* freebsd 6 aio_write 319 */
1178 /* freebsd 6 lio_listio 320 */
1180 /* SYS_yield 321 */
1181 GO(SYS_yield, "0s 0m");
1182 SY(SYS_yield); SUCC;
1184 /* obs thr_sleep 322 */
1186 /* obs thr_wakeup 323 */
1188 /* SYS_mlockall 324 */
1189 GO(SYS_mlockall, "1s 0m");
1190 SY(SYS_mlockall, x0-1); FAIL;
1192 /* SYS_munlockall 325 */
1193 GO(SYS_munlockall, "0s 0m");
1194 SY(SYS_munlockall); SUCC;
1196 /* SYS___getcwd 326 */
1197 GO(SYS___getcwd, "2s 1m");
1198 SY(SYS___getcwd, x0+1, x0+1); FAIL;
1200 /* SYS_sched_setparam 327 */
1201 GO(SYS_sched_setparam, "2s 1m");
1202 SY(SYS_sched_setparam, x0+1, x0+1); FAIL;
1204 /* SYS_sched_getparam 328 */
1205 GO(SYS_sched_getparam, "2s 1m");
1206 SY(SYS_sched_getparam, x0+1, x0+1); FAIL;
1208 /* SYS_sched_setscheduler 329 */
1209 GO(SYS_sched_setscheduler, "3s 1m");
1210 SY(SYS_sched_setscheduler, x0+1, x0+1, x0+1); FAIL;
1212 /* SYS_sched_getscheduler 330*/
1213 GO(SYS_sched_getscheduler, "1s 0m");
1214 SY(SYS_sched_getscheduler, x0+486486); FAIL;
1216 /* SYS_sched_yield 331 */
1217 GO(SYS_sched_yield, "0s 0m");
1218 SY(SYS_sched_yield); SUCC;
1220 /* SYS_sched_get_priority_max 332 */
1221 GO(SYS_sched_get_priority_max, "1s 0m");
1222 SY(SYS_sched_get_priority_max, x0+5678); FAIL;
1224 /* SYS_sched_get_priority_min 333 */
1225 GO(SYS_sched_get_priority_min, "1s 0m");
1226 SY(SYS_sched_get_priority_min, x0+9876); FAIL;
1228 /* SYS_sched_rr_get_interval 334 */
1229 GO(SYS_sched_rr_get_interval, "2s 1m");
1230 SY(SYS_sched_rr_get_interval, x0+999999, x0+1); FAIL;
1232 /* SYS_utrace 335*/
1233 /* only works if process is being traced */
1234 GO(SYS_utrace, "2s 1m");
1235 SY(SYS_utrace, x0+1, x0+16); SUCC;
1237 // freebsd 4 sendfile 336
1239 /* SYS_kldsym 337 */
1240 GO(SYS_kldsym, "3s 1m");
1241 SY(SYS_kldsym, x0-1, x0+16, x0+1); FAIL;
1243 /* SYS_jail 338 */
1244 GO(SYS_jail, "1s 1m");
1245 SY(SYS_jail, x0+1); FAIL;
1247 // unimpl pioctl 339
1249 /* SYS_sigprocmask 340 */
1250 GO(SYS_sigprocmask, "2s 1m");
1251 SY(SYS_sigprocmask, x0+13, NULL, x0+1); FAIL;
1253 GO(SYS_sigprocmask, "3s 2m");
1254 SY(SYS_sigprocmask, x0+13, x0+2, x0+1); FAIL;
1256 /* SYS_sigsuspend 341 */
1257 GO(SYS_sigsuspend, "1s 1m");
1258 SY(SYS_sigsuspend, x0+1); FAIL;
1260 // freebsd 4 sigaction 342
1262 /* SYS_sigpending 343 */
1263 GO(SYS_sigpending, "1s 1m");
1264 SY(SYS_sigpending, x0+1); FAIL;
1266 /* freebsd 4 sigreturn 344 */
1268 /* SYS_sigtimedwait 345 */
1269 GO(SYS_sigtimedwait, "3s 3m");
1270 SY(SYS_sigtimedwait, x0+1, x0+2, x0+3); FAIL;
1272 /* SYS_sigwaitinfo 346 */
1273 GO(SYS_sigwaitinfo, "2s 2m");
1274 SY(SYS_sigwaitinfo, x0+1, x0+2, x0+3); FAIL;
1276 /* SYS___acl_get_file 347 */
1277 GO(SYS___acl_get_file, "3s 2m");
1278 SY(SYS___acl_get_file, x0+1, x0+4567, x0+3); FAIL;
1280 /* SYS___acl_set_file 348 */
1281 GO(SYS___acl_set_file, "3s 2m");
1282 SY(SYS___acl_set_file, x0+1, x0+4567, x0+3); FAIL;
1284 /* SYS___acl_get_fd 349 */
1285 GO(SYS___acl_get_fd, "3s 1m");
1286 SY(SYS___acl_get_fd, x0-1, x0+4567, x0+3); FAIL;
1288 /* SYS___acl_set_fd 350 */
1289 GO(SYS___acl_set_fd, "3s 1m");
1290 SY(SYS___acl_set_fd, x0-1, x0+4567, x0+3); FAIL;
1292 /* SYS___acl_delete_file 351 */
1293 GO(SYS___acl_delete_file, "2s 1m");
1294 SY(SYS___acl_delete_file, x0+1, x0+3); FAIL;
1296 /* SYS___acl_delete_fd 352 */
1297 GO(SYS___acl_delete_fd, "2s 0m");
1298 SY(SYS___acl_delete_fd, x0-1, x0+3); FAIL;
1300 /* SYS___acl_aclcheck_file 353 */
1301 GO(SYS___acl_aclcheck_file, "3s 2m");
1302 SY(SYS___acl_aclcheck_file, x0+1, x0+4567, x0+3); FAIL;
1304 /* SYS___acl_aclcheck_fd 354 */
1305 GO(SYS___acl_aclcheck_fd, "3s 1m");
1306 SY(SYS___acl_aclcheck_fd, x0-1, x0+4567, x0+3); FAIL;
1308 /* SYS_extattrctl 355 */
1309 GO(SYS_extattrctl, "5s 3m");
1310 SY(SYS_extattrctl, x0+1, x0, x0+2, x0, x0+3); FAIL;
1312 /* SYS_extattr_set_file 356 */
1313 GO(SYS_extattr_set_file, "5s 3m");
1314 SY(SYS_extattr_set_file, x0+1, x0, x0+2, x0+3, x0); FAIL;
1316 /* SYS_extattr_get_file 357 */
1317 GO(SYS_extattr_get_file, "5s 3m");
1318 SY(SYS_extattr_get_file, x0+1, x0+2, x0+3, x0+4, x0+5); FAIL;
1320 /* SYS_extattr_delete_file 358 */
1321 GO(SYS_extattr_delete_file, "3s 2m");
1322 SY(SYS_extattr_delete_file, x0+1, x0+2, x0+3); FAIL;
1324 /* SYS_aio_waitcomplete 359 */
1325 GO(SYS_aio_waitcomplete, "2s 2m");
1326 SY(SYS_aio_waitcomplete, x0+1, x0+1); FAIL;
1328 /* SYS_getresuid 360 */
1329 GO(SYS_getresuid, "3s 3m");
1330 SY(SYS_getresuid, x0+1, x0+4567, x0+3); FAIL;
1332 /* SYS_getresgid 361 */
1333 GO(SYS_getresgid, "3s 3m");
1334 SY(SYS_getresgid, x0+1, x0+4567, x0+3); FAIL;
1336 /* SYS_kqueue 362 */
1337 GO(SYS_kqueue, "0s 0m");
1338 SY(SYS_kqueue); SUCC;
1340 /* SYS_freebsd11_kevent 363 */
1341 #if defined(SYS_freebsd11_kevent)
1342 GO(SYS_freebsd11_kevent, "6s 3m");
1343 SY(SYS_freebsd11_kevent, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6); FAIL;
1344 #else
1345 GO(SYS_kevent, "6s 3m");
1346 SY(SYS_kevent, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6); FAIL;
1347 #endif
1349 /* obs __cap_get* / __cap_set* 364 to 369 */
1351 /* SYS_extattr_set_fd 371 */
1352 GO(SYS_extattr_set_fd, "5s 2m");
1353 SY(SYS_extattr_set_fd, x0+999999, x0, x0+1, x0+1, x0+16); FAIL;
1355 /* SYS_extattr_get_fd 372 */
1356 GO(SYS_extattr_get_fd, "5s 2m");
1357 SY(SYS_extattr_get_fd, x0+999999, x0, x0+1, x0+1, x0+16); FAIL;
1359 /* SYS_extattr_delete_fd 373 */
1360 GO(SYS_extattr_delete_fd, "3s 1m");
1361 SY(SYS_extattr_delete_fd, x0+999999, x0, x0+1); FAIL;
1363 /* SYS___setugid 374 */
1364 GO(SYS___setugid, "1s 0m");
1365 SY(SYS___setugid, x0); FAIL;
1367 // nfsclnt 375
1369 /* SYS_eaccess 376 */
1370 GO(SYS_eaccess, "2s 1m");
1371 SY(SYS_eaccess, x0+1, x0+3); FAIL;
1373 // afs_syscall 377
1375 /* SYS_nmount 378 */
1376 GO(SYS_nmount, "3s 1m");
1377 SY(SYS_nmount, x0+1, x0+3, x0); FAIL;
1379 // kse_exit 379
1381 // kse_wakeup 380
1383 // kse_create 381
1385 // kse_thr_interrupt 382
1387 // kse_release 383
1389 // __mac_get_proc 384
1391 // __mac_set_proc 385
1393 // __mac_get_fd 386
1395 // __mac_get_file 387
1397 // __mac_set_fd 388
1399 // __mac_set_file 389
1401 /* SYS_kenv 390 */
1402 GO(SYS_kenv, "(KENV_GET) 4s 1m");
1403 SY(SYS_kenv, x0+0, x0+2, x0+3, x0+4); FAIL;
1405 GO(SYS_kenv, "(KENV_DUMP) 4s 0m");
1406 SY(SYS_kenv, x0+3, x0+2, x0+3, x0+4); FAIL;
1408 GO(SYS_kenv, "(bogus) 4s 0m");
1409 SY(SYS_kenv, x0+20, x0+2, x0+3, x0+4); FAIL;
1411 /* SYS_lchflags 391 */
1412 GO(SYS_lchflags, "2s 1m");
1413 SY(SYS_lchflags, x0+1, x0+2); FAIL;
1415 /* SYS_uuidgen 392 */
1416 GO(SYS_uuidgen, "2s 1m");
1417 SY(SYS_uuidgen, x0+1, x0+2); FAIL;
1419 /* SYS_sendfile 393 */
1420 GO(SYS_sendfile, "7s 2m");
1421 SY(SYS_sendfile, x0-1, x0+2, x0+3, x0+4, x0+1, x0+1, x0+3); FAIL;
1423 // mac_syscall 394
1425 #if defined(SYS_freebsd11_getfsstat)
1426 /* SYS_freebsd11_getfsstat 395*/
1427 GO(SYS_freebsd11_getfsstat, "3s 1m");
1428 SY(SYS_freebsd11_getfsstat, x0+1, x0+2, x0+3); FAIL;
1429 #else
1430 /* SYS_getfsstat 395*/
1431 GO(SYS_getfsstat, "3s 1m");
1432 SY(SYS_getfsstat, x0+1, x0+2, x0+3); FAIL;
1433 #endif
1435 #if defined(SYS_freebsd11_statfs)
1436 /* SYS_freebsd11_statfs 396 */
1437 GO(SYS_freebsd11_statfs, "2s 2m");
1438 SY(SYS_freebsd11_statfs, x0+1, x0+2); FAIL;
1439 #else
1440 /* SYS_statfs 396 */
1441 GO(SYS_statfs, "2s 2m");
1442 SY(SYS_statfs, x0+1, x0+2); FAIL;
1443 #endif
1445 #if defined(SYS_freebsd11_fstatfs)
1446 /* SYS_freebsd11_fstatfs 397 */
1447 GO(SYS_freebsd11_fstatfs, "2s 1m");
1448 SY(SYS_freebsd11_fstatfs, x0+1, x0+2); FAIL;
1449 #else
1450 /* SYS_fstatfs 397 */
1451 GO(SYS_fstatfs, "2s 1m");
1452 SY(SYS_fstatfs, x0+1, x0+2); FAIL;
1453 #endif
1455 #if defined(SYS_freebsd11_fhstatfs)
1456 /* SYS_freebsd11_fhstatfs 398 */
1457 GO(SYS_freebsd11_fhstatfs, "2s 2m");
1458 SY(SYS_freebsd11_fhstatfs, x0+1, x0+2); FAIL;
1459 #else
1460 /* SYS_fhstatfs 398 */
1461 GO(SYS_fhstatfs, "2s 2m");
1462 SY(SYS_fhstatfs, x0+1, x0+2); FAIL;
1463 #endif
1465 // ksem_close 400
1467 // ksem_post 401
1469 // ksem_wait 402
1471 // ksem_trywait 403
1473 // ksem_init 404
1475 // ksem_open 405
1477 // ksem_unlink 406
1479 // ksem_getvalue 407
1481 // ksem_destroy 408
1483 // __mac_get_pid 409
1485 // __mac_get_link 410
1487 // __mac_set_link 411
1489 /* SYS_extattr_set_link 412 */
1490 GO(SYS_extattr_set_link, "5s 3m");
1491 SY(SYS_extattr_set_file, x0+1, x0, x0+2, x0+3, x0); FAIL;
1493 /* SYS_extattr_get_link 413 */
1494 GO(SYS_extattr_get_link, "5s 3m");
1495 SY(SYS_extattr_get_link, x0+1, x0+2, x0+3, x0+4, x0+5); FAIL;
1497 /* SYS_extattr_delete_link 414 */
1498 GO(SYS_extattr_delete_link, "3s 2m");
1499 SY(SYS_extattr_delete_link, x0+1, x0+2, x0+3); FAIL;
1501 // __mac_execve 415
1503 /* SYSR_sigaction 416 */
1504 GO(SYS_sigaction, "3s 2+2m");
1505 SY(SYS_sigaction, x0+1000, x0+2, x0+3); FAIL;
1507 /* SYS_sigreturn 417 */
1508 /* hope it fails because we're not in a signal context */
1509 GO(SYS_sigreturn, "1s 1m");
1510 SY(SYS_sigreturn, x0+1); FAIL;
1512 /* SYS_getcontext 421 */
1513 GO(SYS_getcontext, "1s 1m");
1514 SY(SYS_getcontext, x0+1); FAIL;
1516 /* SYS_setcontext 422 */
1517 GO(SYS_setcontext, "1s 1m");
1518 SY(SYS_setcontext, x0+1); FAIL;
1520 /* SYS_swapcontext 423 */
1521 GO(SYS_swapcontext, "2s 2m");
1522 SY(SYS_swapcontext, x0+1, x0+2); FAIL;
1524 #if defined(SYS_freebsd13_swapoff)
1525 /* SYS_freebsd13_swapoff 424 */
1526 GO(SYS_freebsd13_swapoff, "1s 1m");
1527 SY(SYS_freebsd13_swapoff, x0+1); FAIL;
1528 #else
1529 /* SYS_swapoff 424 */
1530 GO(SYS_swapoff, "1s 1m");
1531 SY(SYS_swapoff, x0+1); FAIL;
1532 #endif
1534 /* SYS___acl_get_link 425 */
1535 GO(SYS___acl_get_link, "3s 2m");
1536 SY(SYS___acl_get_link, x0+1, x0+2, x0+3); FAIL;
1538 /* SYS___acl_set_link 426 */
1539 GO(SYS___acl_set_link, "3s 2m");
1540 SY(SYS___acl_set_link, x0+1, x0+2, x0+3); FAIL;
1542 /* SYS___acl_delete_link 427 */
1543 GO(SYS___acl_delete_link, "2s 1m");
1544 SY(SYS___acl_delete_link, x0+1, x0+2); FAIL;
1546 /* SYS___acl_aclcheck_link 428 */
1547 GO(SYS___acl_aclcheck_link, "3s 2m");
1548 SY(SYS___acl_aclcheck_link, x0+1, x0+2, x0+3); FAIL;
1550 /* SYS_sigwait 429 */
1551 GO(SYS_sigwait, "2s 2m");
1552 SY(SYS_sigwait, x0+1, x0+2); SUCC;
1553 assert(res == EFAULT);
1555 // thr_create 430
1557 /* SYS_thr_exit 431 */
1558 GO(SYS_thr_exit, "other");
1560 /* SYS_thr_self 432 */
1561 GO(SYS_thr_self, "1s 1m");
1562 SY(SYS_thr_self, x0+1); FAIL;
1564 /* SYS_thr_kill 433 */
1565 GO(SYS_thr_kill, "2s 0m");
1566 SY(SYS_thr_kill, x0-10, x0-20); FAIL;
1568 /* SYS_freebsd10__umtx_lock 434 */
1569 /* SYS_freebsd10__umtx_unlock 435 */
1571 /* SYS_jail_attach 436 */
1572 GO(SYS_jail_attach, "1s 0m");
1573 SY(SYS_jail_attach, x0-1); FAIL;
1575 /* SYS_extattr_list_fd 437 */
1576 GO(SYS_extattr_list_fd, "4s 1m");
1577 SY(SYS_extattr_list_fd, x0+999999, x0+1, x0+1, x0+16); FAIL;
1579 /* SYS_extattr_list_file 438 */
1580 GO(SYS_extattr_list_file, "4s 2m");
1581 SY(SYS_extattr_list_file, x0+1, x0+1, x0+1, x0+16); FAIL;
1583 /* SYS_extattr_list_link 439 */
1584 GO(SYS_extattr_list_link, "4s 2m");
1585 SY(SYS_extattr_list_link, x0+1, x0+1, x0+1, x0+16); FAIL;
1588 // kse_switchin 440
1590 // ksem_timedwait 441
1592 // thr_suspend 442
1594 /* SYS_thr_wake 443 */
1595 GO(SYS_thr_wake, "1s 0m");
1596 SY(SYS_thr_wake, x0+99); FAIL;
1598 /* SYS_kldunloadf 444 */
1599 GO(SYS_kldunloadf, "1s 0m");
1600 SY(SYS_kldunloadf, x0+1, x0); FAIL;
1602 // audit 445
1604 // auditon 446
1606 // getauid 447
1608 // setauid 448
1610 // getaudit 449
1612 // setaudit 450
1614 // getaudit_addr 451
1616 // setaudit_addr 452
1618 // auditctl 453
1620 // int _umtx_op(void *obj, int op, u_long val, void *uaddr, void *uaddr2);
1622 /* SYS__umtx_op 454 */
1623 GO(SYS__umtx_op, "5s 2m");
1624 SY(SYS__umtx_op, x0+1, x0+15, x0+3, x0+4, x0+5); FAIL;
1626 /* SYS_thr_new 455 */
1627 /* @todo needs some special testing, VG hangs if we go spawning threads willy-nilly */
1629 GO(SYS_thr_new, "2s 1m");
1630 SY(SYS_thr_new, x0+1, x0+2); FAIL;
1633 /* SYS_sigqueue 456 */
1634 GO(SYS_sigqueue, "3s 0m");
1635 SY(SYS_sigqueue, x0+9999999, x0+2000, x0); FAIL;
1637 /* SYS_kmq_open 457 */
1638 GO(SYS_kmq_open, "4s 2m");
1639 SY(SYS_kmq_open, x0+1, x0+O_CREAT, x0, x0+1); FAIL;
1641 GO(SYS_kmq_open, "3s 1m");
1642 SY(SYS_kmq_open, x0+1, x0, x0); FAIL;
1645 struct mq_attr mqa = { x0+1, x0+1 };
1646 GO(SYS_kmq_open, "3s 2m");
1647 SY(SYS_kmq_open, x0+1, x0+O_CREAT, x0, &mqa); FAIL;
1650 /* SYS_kmq_setattr 458 */
1651 GO(SYS_kmq_setattr, "3s 2m");
1652 SY(SYS_kmq_setattr, x0+1, x0+2, x0+3); FAIL;
1654 /* SYS_kmq_timedreceive 459 */
1655 GO(SYS_kmq_timedreceive, "5s 2m");
1656 SY(SYS_kmq_timedreceive, x0+1, x0+2, x0+3, x0+4, x0+5); FAIL;
1658 /* SYS_kmq_timedsend 460 */
1659 GO(SYS_kmq_timedsend, "5s 1m");
1660 SY(SYS_kmq_timedsend, x0+1, x0+2, x0+3, x0+4, x0+5); FAIL;
1662 /* SYS_kmq_notify 461 */
1663 GO(SYS_kmq_notify, "2s 1m");
1664 SY(SYS_kmq_notify, x0+1, x0+2); FAIL;
1666 /* SYS_kmq_unlink 462 */
1667 GO(SYS_kmq_unlink, "1s 1m");
1668 SY(SYS_kmq_unlink, x0+1); FAIL;
1670 /* abort2 463 */
1671 GO(SYS_abort2, "other");
1673 /* SYS_thr_set_name 464 */
1674 /* @todo PJF VG doesn't like this. Causes a SIGSEGV. Runs OK standalone */
1676 GO(SYS_thr_set_name, "2s 1m");
1677 SY(SYS_thr_set_name, x0+999999, x0+2); FAIL;
1680 /* aio_fsync 465 */
1681 GO(SYS_aio_fsync, "2s 1m");
1682 SY(SYS_aio_fsync, x0+1, x0+2); FAIL;
1684 /* SYS_rtprio_thread 466 */
1685 GO(SYS_rtprio_thread, "3s 1m");
1686 SY(SYS_rtprio_thread, x0+1, x0-2, x0+1); FAIL;
1688 // __getpath_fromfd 469
1690 // __getpath_fromaddr 470
1692 // sctp_peeloff 471
1694 // sctp_generic_sendmsg 472
1695 GO(SYS_sctp_generic_sendmsg, "7s 1m");
1696 SY(SYS_sctp_generic_sendmsg, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6, x0+7); FAIL;
1698 // sctp_generic_sendmsg_iov 473
1700 // sctp_generic_recvmsg 474
1701 GO(SYS_sctp_generic_recvmsg, "7s 4m");
1702 SY(SYS_sctp_generic_recvmsg, x0+1, x0+2, x0+300, x0+4, x0+5, x0+6, x0+7); FAIL;
1705 socklen_t fromlen = 64;
1706 struct iovec iov;
1707 GO(SYS_sctp_generic_recvmsg, "6s 4m");
1708 SY(SYS_sctp_generic_recvmsg, x0+1, x0+2, x0+300, x0+4, &fromlen, x0+6, x0+7); FAIL;
1710 iov.iov_base = (void*)(x0+8);
1711 iov.iov_len = x0+9;
1713 GO(SYS_sctp_generic_recvmsg, "6s 6m");
1714 SY(SYS_sctp_generic_recvmsg, x0+1, &iov, 1, x0+4, x0+5, x0+6, x0+7); FAIL;
1717 /* SYS_pread 475 */
1718 GO(SYS_pread, "4s 1m");
1719 SY(SYS_pread, x0+99, x0+1, x0+1, x0+2); FAIL;
1721 /* SYS_pwrite 476 */
1722 GO(SYS_pwrite, "4s 1m");
1723 SY(SYS_pwrite, x0+99, x0+1, x0+1, x0+2); FAIL;
1725 /* SYS_mmap 477 */
1726 GO(SYS_mmap, "6s 1m");
1727 SY(SYS_mmap, x0+1, x0, x0+123456, x0+234567, x0+99, x0+3); FAIL;
1729 /* SYS_lseek 478 */
1730 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1731 GO(SYS_lseek, "3s 0m");
1732 SY(SYS_lseek, x0+99, x0+1, x0+55); FAIL;
1733 #else
1734 GO(SYS_lseek, "4s 0m");
1735 SY(SYS_lseek, x0+99, x0+1, x0+1, x0+55); FAIL;
1736 #endif
1738 /* SYS_truncate 479 */
1739 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1740 GO(SYS_truncate, "2s 1m");
1741 SY(SYS_truncate, x0+1, x0+1); FAIL;
1742 #else
1743 GO(SYS_truncate, "3s 1m");
1744 SY(SYS_truncate, x0+1, x0, x0+1); FAIL;
1745 #endif
1747 /* SYS_ftruncate 480 */
1748 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1749 GO(SYS_ftruncate, "2s 0m");
1750 SY(SYS_ftruncate, x0+99, x0+1); FAIL;
1751 #else
1752 GO(SYS_ftruncate, "3s 0m");
1753 SY(SYS_ftruncate, x0+99, x0, x0+1); FAIL;
1754 #endif
1756 /* SYS_thr_kill2 481 */
1757 GO(SYS_thr_kill2, "3s 0m");
1758 SY(SYS_thr_kill2, x0-1, x0-1, x0+9999); FAIL;
1760 /* SYS_shm_open 482 */
1761 #if defined(SYS_freebsd12_shm_open)
1762 GO(SYS_freebsd12_shm_open, "(SHM_ANON) 3s 0m");
1763 SY(SYS_freebsd12_shm_open, x0+SHM_ANON, x0+2, x0+9); SUCC;
1765 GO(SYS_freebsd12_shm_open, "3s 1m");
1766 SY(SYS_freebsd12_shm_open, x0+2, x0+2, x0+9); FAIL;
1767 #else
1768 GO(SYS_shm_open, "(SHM_ANON) 3s 0m");
1769 SY(SYS_shm_open, x0+SHM_ANON, x0+2, x0+9); SUCC;
1771 GO(SYS_shm_open, "3s 1m");
1772 SY(SYS_shm_open, x0+2, x0+2, x0+9); FAIL;
1773 #endif
1775 /* SYS_shm_unlink 483 */
1776 GO(SYS_shm_unlink, "1s 1m");
1777 SY(SYS_shm_unlink, x0+1); FAIL;
1779 /* cpuset 484 */
1780 GO(SYS_cpuset, "1s 1m");
1781 SY(SYS_cpuset, x0+1); FAIL;
1783 /* cpuset_setid 485 */
1784 #if defined (VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1785 GO(SYS_cpuset_setid, "3s 0m");
1786 SY(SYS_cpuset_setid, x0, x0, x0); FAIL;
1787 #else
1788 GO(SYS_cpuset_setid, "4s 0m");
1789 SY(SYS_cpuset_setid, x0, x0, x0, x0); FAIL;
1790 #endif
1792 /* cpuset_getid 486 */
1793 GO(SYS_cpuset_getid, "4s 1m");
1794 SY(SYS_cpuset_getid, x0, x0, x0, x0+1); FAIL;
1796 /* SYS_cpuset_getaffinity 487 */
1797 GO(SYS_cpuset_getaffinity, "5s 1m");
1798 SY(SYS_cpuset_getaffinity, x0+100, x0+100, x0+200, x0+500, x0+1); FAIL;
1800 /* SYS_cpuset_setaffinity 488 */
1801 GO(SYS_cpuset_setaffinity, "5s 1m");
1802 SY(SYS_cpuset_setaffinity, x0+100, x0+100, x0+200, x0+500, x0+1); FAIL;
1804 /* SYS_faccessat 489 */
1805 GO(SYS_faccessat, "3s 1m");
1806 SY(SYS_faccessat, x0+1, x0, x0); FAIL;
1808 /* SYS_fchmodat 490 */
1809 GO(SYS_fchmodat, "4s 1m");
1810 SY(SYS_fchmodat, x0, x0+1, x0, x0); FAIL;
1812 /* SYS_fchownat 491 */
1813 GO(SYS_fchownat, "5s 1m");
1814 SY(SYS_fchownat, x0, x0+1, x0, x0, x0); FAIL;
1816 /* SYS_fexecve 492 */
1817 GO(SYS_fexecve, "3s 2m");
1818 SY(SYS_fexecve, x0-1, x0+1, x0+1); FAIL;
1820 /* SYS_freebsd11_fstatat 493 */
1821 #if defined(SYS_freebsd11_fstatat)
1822 GO(SYS_freebsd11_fstatat, "4s 2m");
1823 SY(SYS_freebsd11_fstatat, x0, x0+1, x0+1, x0); FAIL;
1824 #else
1825 GO(SYS_fstatat, "4s 2m");
1826 SY(SYS_fstatat, x0, x0+1, x0+1, x0); FAIL;
1827 #endif
1829 /* SYS_futimesat 494 */
1830 GO(SYS_futimesat, "3s 2m");
1831 SY(SYS_futimesat, x0, x0+1, x0+1); FAIL;
1833 /* SYS_linkat 495 */
1834 GO(SYS_linkat, "5s 2m");
1835 SY(SYS_linkat, x0, x0+1, x0, x0+1, x0); FAIL;
1837 /* SYS_mkdirat 496 */
1838 GO(SYS_mkdirat, "3s 1m");
1839 SY(SYS_mkdirat, x0, x0+1, x0+1); FAIL;
1841 /* SYS_mkfifoat 497 */
1842 GO(SYS_mkfifoat, "3s 1m");
1843 SY(SYS_mkfifoat, x0, x0, x0); FAIL;
1845 /* SYS_freebsd11_mknodat 498 */
1846 #if defined(SYS_freebsd11_mknodat)
1847 GO(SYS_freebsd11_mknodat, "4s 1m");
1848 SY(SYS_freebsd11_mknodat, x0, x0+1, x0, x0); FAIL;
1849 #else
1850 GO(SYS_mknodat, "4s 1m");
1851 SY(SYS_mknodat, x0, x0+1, x0, x0); FAIL;
1852 #endif
1854 /* SYS_openat 499 */
1855 GO(SYS_openat, "3s 1m");
1856 SY(SYS_openat, x0, x0+1, x0); FAIL;
1858 GO(SYS_openat, "4s 1m");
1859 SY(SYS_openat, x0, x0+1, x0+O_CREAT, x0); FAIL;
1861 /* SYS _readlinkat 500 */
1862 GO(SYS_readlinkat, "4s 2m");
1863 SY(SYS_readlinkat, x0, x0+1, x0+1, x0+4); FAIL;
1865 /* SYS_renameat 501 */
1866 GO(SYS_renameat, "4s 2m");
1867 SY(SYS_renameat, x0, x0+1, x0+1, x0+1); FAIL;
1869 /* SYS_symlinkat 502 */
1870 GO(SYS_symlinkat, "3s 2m");
1871 SY(SYS_symlinkat, x0+1, x0, x0+1); FAIL;
1873 /* SYS_unlinkat 503 */
1874 GO(SYS_unlinkat, "3s 1m");
1875 SY(SYS_unlinkat, x0+9999999, x0+1, x0); FAIL;
1877 /* SYS_posix_openpt 504 */
1878 GO(SYS_posix_openpt, "1s 1m");
1879 SY(SYS_posix_openpt, x0+0x8); FAIL;
1881 // gssd_syscall 505
1883 /* SYS_jail_get 506 */
1884 GO(SYS_jail_get, "3s 1m");
1885 SY(SYS_jail_get, x0+1, x0+10, x0); FAIL;
1887 /* SYS_jail_set 507 */
1888 GO(SYS_jail_set, "3s 1m");
1889 SY(SYS_jail_set, x0+1, x0+10, x0); FAIL;
1891 /* SYS_jail_remove 508 */
1892 GO(SYS_jail_remove, "1s 0m");
1893 SY(SYS_jail_remove, x0+1); FAIL;
1895 /* SYS_closefrom 509 */
1896 #if defined(SYS_freebsd12_closefrom)
1897 GO(SYS_freebsd12_closefrom, "1s 0m");
1898 SY(SYS_freebsd12_closefrom, x0+100000); SUCC;
1899 #else
1900 GO(SYS_closefrom, "1s 0m");
1901 SY(SYS_closefrom, x0+100000); SUCC;
1902 #endif
1904 /* SYS___semctl 510 */
1905 GO(SYS___semctl, "(IPC_STAT) 4s 1m");
1906 SY(SYS___semctl, x0, x0, x0+IPC_STAT, x0+1); FAIL;
1908 GO(SYS___semctl, "(other) 3s 0m");
1909 SY(SYS___semctl, x0, x0, x0+3000, x0+1); FAIL;
1911 /* msgctl 511 */
1912 GO(SYS_msgctl, "3s 1m");
1913 SY(SYS_msgctl, x0, x0+IPC_STAT, x0+1); FAIL;
1915 /* SYS_shmctl 512 */
1916 GO(SYS_shmctl, "3s 1m");
1917 SY(SYS_shmctl, x0, x0+IPC_STAT, x0+1); FAIL;
1919 /* lpathconf 513 */
1920 GO(SYS_lpathconf, "2s 1m");
1921 SY(SYS_lpathconf, x0+1, x0); FAIL;
1923 // 514 is obsolete cap_new
1925 /* __cap_rights_get 515 */
1926 GO(SYS___cap_rights_get, "3s 1m");
1927 SY(SYS___cap_rights_get, x0+1, x0, x0+1); FAIL;
1929 /* SYS_cap_enter 516 */
1930 GO(SYS_cap_enter, "other");
1932 /* SYS_cap_getmode 517 */
1933 GO(SYS_cap_getmode, "1s 1m");
1934 SY(SYS_cap_getmode, x0+1); FAIL;
1936 /* SYS_pdfork 518 */
1937 GO(SYS_pdfork, "other");
1939 /* SYS_pdkill 519 */
1940 GO(SYS_pdkill, "2s 0m");
1941 SY(SYS_pdkill, x0-1, x0+1000); FAIL;
1943 /* SYS_pdgetpid 520 */
1944 GO(SYS_pdgetpid, "2s 1m");
1945 SY(SYS_pdgetpid, x0+100000, x0+1); FAIL;
1947 /* SYS_pselect 522 */
1948 GO(SYS_pselect, "6s 5m");
1949 SY(SYS_pselect, x0+64, x0+1, x0+2, x0+3, x0+4, x0+5); FAIL;
1951 /* SYS_getloginclass 523 */
1952 GO(SYS_getloginclass, "2s 1m");
1953 SY(SYS_getloginclass, x0+1, x0+16); FAIL;
1955 /* SYS_setloginclass 524 */
1956 GO(SYS_setloginclass, "1s 1m");
1957 SY(SYS_setloginclass, x0+1); FAIL;
1959 /* SYS_rctl_get_racct 525 */
1960 GO(SYS_rctl_get_racct, "4s 2m");
1961 SY(SYS_rctl_get_racct, x0+1, x0+1, x0+2, x0+16); FAIL;
1963 /* SYS_rctl_get_rules 526 */
1964 GO(SYS_rctl_get_rules, "4s 2m");
1965 SY(SYS_rctl_get_rules, x0+1, x0+1, x0+2, x0+16); FAIL;
1967 /* SYS_rctl_get_limits 527 */
1968 GO(SYS_rctl_get_limits, "4s 2m");
1969 SY(SYS_rctl_get_limits, x0+1, x0+1, x0+2, x0+16); FAIL;
1971 /* SYS_rctl_add_rule 528 */
1972 /* note arg3 and ar4 are not used as per the manpage */
1973 GO(SYS_rctl_add_rule, "2s 1m");
1974 SY(SYS_rctl_add_rule, x0+1, x0+1, x0+2, x0+16); FAIL;
1976 /* SYS_rctl_remove_rule 529 */
1977 GO(SYS_rctl_remove_rule, "2s 1m");
1978 /* note arg3 and ar4 are not used as per the manpage */
1979 SY(SYS_rctl_remove_rule, x0+1, x0+1, x0+2, x0+16); FAIL;
1981 /* SYS_posix_fallocate 530 */
1982 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
1983 GO(SYS_posix_fallocate, "3s 0m");
1984 SY(SYS_posix_fallocate, x0+99999, x0+10, x0+20); SUCC;
1985 #else
1986 GO(SYS_posix_fallocate, "5s 0m");
1987 SY(SYS_posix_fallocate, x0+99999, x0, x0+10, x0, x0+20); SUCC;
1988 #endif
1989 assert(res == EBADF);
1991 /* SYS_posix_fadvise 531 */
1992 GO(SYS_posix_fadvise, "4s 0m");
1993 SY(SYS_posix_fadvise, x0+99999, x0+10, x0+20, x0); SUCC;
1994 assert(res == EBADF);
1996 /* SYS_wait6 532 */
1997 GO(SYS_wait6, "6s 3m");
1998 SY(SYS_wait6, x0, x0, x0+1, x0, x0+1, x0+1); FAIL;
2000 /* SYS_cap_rights_limit 533 */
2001 GO(SYS_cap_rights_limit, "2s 1m");
2002 SY(SYS_cap_rights_limit, x0+99999, x0+1); FAIL;
2004 /* SYS_cap_ioctls_limit 534 */
2005 GO(SYS_cap_ioctls_limit, "3s 1m");
2006 SY(SYS_cap_ioctls_limit, x0+99999, x0+1, x0+2); FAIL;
2008 /* cap_ioctls_get 535 */
2009 GO(SYS_cap_ioctls_get, "3s 1m");
2010 SY(SYS_cap_ioctls_get, x0+99999, x0+1, x0+10); FAIL;
2012 /* SYS_cap_fcntls_limit 536 */
2013 GO(SYS_cap_fcntls_limit, "2s 0m");
2014 SY(SYS_cap_fcntls_limit, x0+99999, x0); FAIL;
2016 /* SYS_cap_fcntls_get 537 */
2017 GO(SYS_cap_fcntls_get, "2s 1m");
2018 SY(SYS_cap_fcntls_get, x0+99999, x0+1); FAIL;
2020 /* SYS_bindat 538 */
2021 GO(SYS_bindat, "4s 1m");
2022 SY(SYS_bindat, x0+99999, x0+1, x0+2, x0+16); FAIL;
2024 /* SYS_connectat 539 */
2025 GO(SYS_connectat, "4s 1m");
2026 SY(SYS_connectat, x0+99999, x0+1, x0+2, x0+16); FAIL;
2028 /* SYS_chflagsat 540*/
2029 GO(SYS_chflagsat, "4s 1m");
2030 SY(SYS_chflagsat, x0+99999, x0+1, x0+2, x0+3); FAIL;
2032 /* SYS_accept4 541 */
2033 GO(SYS_accept4, "4s 1m");
2034 SY(SYS_accept4, x0+999999, x0+1, x0+16, x0); FAIL;
2037 socklen_t socklen = 42;
2038 GO(SYS_accept4, "3s 1m");
2039 SY(SYS_accept4, x0+999999, x0+1, &socklen, x0); FAIL;
2042 /* SYS_pipe2 542 */
2043 GO(SYS_pipe2, "2s 1m");
2044 SY(SYS_pipe2, x0+1, x0); FAIL;
2046 /* SYS_aio_mlock 543*/
2047 GO(SYS_aio_mlock, "1s 1m");
2048 SY(SYS_aio_mlock, x0+1); FAIL;
2050 /* SYS_procctl 544 */
2051 #if defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
2052 GO(SYS_procctl, "(PROC_REAP_RELEASE) 3s 0m");
2053 SY(SYS_procctl, x0+9999, x0+9999, x0+PROC_REAP_RELEASE, NULL); FAIL;
2055 GO(SYS_procctl, "(PROC_REAP_GETPIDS) 4s 1m");
2056 SY(SYS_procctl, x0+9999, x0+9999, x0+PROC_REAP_GETPIDS, x0+1); FAIL;
2057 #else
2058 GO(SYS_procctl, "(PROC_REAP_RELEASE) 4s 0m");
2059 SY(SYS_procctl, x0+9999, x0, x0+9999, x0+PROC_REAP_RELEASE); FAIL;
2061 GO(SYS_procctl, "(PROC_REAP_GETPIDS) 5s 1m");
2062 SY(SYS_procctl, x0+9999, x0, x0+9999, x0+PROC_REAP_GETPIDS, x0+1); FAIL;
2063 #endif
2065 // 544 is the highest syscall on FreeBSD 9
2067 /* SYS_ppoll 545 */
2068 GO(SYS_ppoll, "4s 2m");
2069 SY(SYS_ppoll, x0+8, x0+1, x0+1, x0+1); FAIL;
2072 struct pollfd arg1;
2073 arg1.fd = arg1.events = arg1.revents = x0;
2074 GO(SYS_ppoll, "2s 2+2m");
2075 SY(SYS_ppoll, &arg1, 1, x0+1, x0+1); FAIL;
2078 /* SYS_futimens 546 */
2079 GO(SYS_futimens, "2s 1m");
2080 SY(SYS_futimens, x0+99999999, x0+1); FAIL;
2082 /* SYS_utimensat 547 */
2083 GO(SYS_utimensat, "4s 2m");
2084 SY(SYS_utimensat, x0+99999999, x0+1, x0+1, x0); FAIL;
2086 // 548 is obsolete numa_getaffinity
2088 // 549 is obsolete numa_setaffinity
2090 /* SYS_fdatasync 550 */
2091 GO(SYS_fdatasync, "1s 0m");
2092 SY(SYS_fdatasync, x0+99999999); FAIL;
2094 // __FreeBSD_version 1200031
2095 /* SYS_fstat 551 */
2096 GO(SYS_fstat, "2s 1m");
2097 SY(SYS_fstat, x0+99999999, x0+1); FAIL;
2099 /* SYS_fstatat 552 */
2100 GO(SYS_fstatat, "4s 2m");
2101 SY(SYS_fstatat, x0+99999999, x0+1, x0+1, x0); FAIL;
2103 /* SYS_fhstat 553 */
2104 GO(SYS_fhstat, "2s 2m");
2105 SY(SYS_fhstat, x0+1, x0+1); FAIL;
2107 /* SYS_getdirentries 554 */
2108 GO(SYS_getdirentries, "4s 2m");
2109 SY(SYS_getdirentries, x0+999999, x0+1, x0+16, x0+1); FAIL;
2111 /* SYS_statfs 555 */
2112 GO(SYS_statfs, "2s 2m");
2113 SY(SYS_statfs, x0+1, x0+1); FAIL;
2115 /* SYS_fstatfs 556 */
2116 GO(SYS_fstatfs, "2s 1m");
2117 SY(SYS_fstatfs, x0+999999, x0+1); FAIL;
2119 /* SYS_getfsstat 557 */
2120 GO(SYS_getfsstat, "3s 1m");
2121 SY(SYS_getfsstat, x0+999999, x0+1, x0); FAIL;
2123 /* SYS_fhstatfs 558 */
2124 GO(SYS_fhstatfs, "2s 2m");
2125 SY(SYS_fhstatfs, x0+1, x0+1); FAIL;
2127 /* SYS_mknodat 559 */
2128 GO(SYS_mknodat, "4s 1m");
2129 SY(SYS_mknodat, x0+999999, x0+1, x0, x0); FAIL;
2131 // FreeBSD_version 1200033
2132 /* SYS_kevent 560 */
2133 GO(SYS_kevent, "6s 3m");
2134 SY(SYS_kevent, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6); FAIL;
2136 /* SYS_cpuset_getdomain 561 */
2137 GO(SYS_cpuset_getdomain, "6s 2m");
2138 SY(SYS_cpuset_getdomain, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6); FAIL;
2140 /* SYS_cpuset_setdomain 562 */
2141 GO(SYS_cpuset_setdomain, "6s 1m");
2142 SY(SYS_cpuset_setdomain, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6); FAIL;
2144 /* SYS_getrandom 563 */
2145 GO(SYS_getrandom, "3s 1m");
2146 SY(SYS_getrandom, x0+1, x0+1, x0); FAIL;
2148 // __FreeBSD_version 1200031)
2149 /* SYS_getfhat 564 */
2150 GO(SYS_getfhat, "4s 2m");
2151 SY(SYS_getfhat, x0, x0, x0, x0); FAIL;
2153 /* SYS_fhlink 565 */
2154 GO(SYS_fhlink, "2s 2m");
2155 SY(SYS_fhlink, x0+1, x0+1);
2157 /* SYS_fhlinkat 566 */
2158 GO(SYS_fhlinkat, "3s 2m");
2159 SY(SYS_fhlinkat, x0+1, x0+1000, x0+1);
2161 /* SYS_fhreadlink 567 */
2162 GO(SYS_fhreadlink, "3s 2m");
2163 SY(SYS_fhreadlink, x0+1, x0+1, x0+10);
2165 // __FreeBSD_version 1201522
2166 // __FreeBSD_version 1300045
2167 /* SYS___sysctlbyname 570 */
2168 GO(SYS___sysctlbyname, "(getoldlen) 3s 2m");
2169 SY(SYS___sysctlbyname, x0, x0+1, NULL, x0+1, NULL, x0); FAIL;
2171 GO(SYS___sysctlbyname, "(getold) 4s 2m");
2172 SY(SYS___sysctlbyname, x0, x0+1, x0+1, x0+1, NULL, x0); FAIL;
2174 GO(SYS___sysctlbyname, "(putnew) 4s 2m");
2175 SY(SYS___sysctlbyname, x0, x0+1, NULL, NULL, x0+1, x0+2); FAIL;
2177 // FreeBSD 13 (and any backports)
2178 /* SYS_shm_open2 571 */
2179 #if defined(SYS_shm_open2)
2180 GO(SYS_shm_open2, " 5s 2m");
2181 SY(SYS_shm_open2, x0+0xf00c, x0+1, x0+2, x0+3, x0+4); FAIL;
2183 GO(SYS_shm_open2, " 5s 1m");
2184 SY(SYS_shm_open2, x0+SHM_ANON, x0+1, x0+2, x0+3, x0+4); FAIL;
2185 #else
2186 FAKE_GO("571: SYS_shm_open2 5s 2m");
2187 FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n");
2188 FAKE_SY(" ...\n");
2189 FAKE_SY("\n");
2190 FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n");
2191 FAKE_SY(" ...\n");
2192 FAKE_SY("\n");
2193 FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n");
2194 FAKE_SY(" ...\n");
2195 FAKE_SY("\n");
2196 FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n");
2197 FAKE_SY(" ...\n");
2198 FAKE_SY("\n");
2199 FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n");
2200 FAKE_SY(" ...\n");
2201 FAKE_SY("\n");
2202 FAKE_SY("Syscall param shm_open2(path) points to unaddressable byte(s)\n");
2203 FAKE_SY(" ...\n");
2204 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2205 FAKE_SY("\n");
2206 FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n");
2207 FAKE_SY(" ...\n");
2208 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2209 FAKE_SY("\n");
2211 FAKE_GO("571: SYS_shm_open2 5s 1m");
2212 FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n");
2213 FAKE_SY(" ...\n");
2214 FAKE_SY("\n");
2215 FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n");
2216 FAKE_SY(" ...\n");
2217 FAKE_SY("\n");
2218 FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n");
2219 FAKE_SY(" ...\n");
2220 FAKE_SY("\n");
2221 FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n");
2222 FAKE_SY(" ...\n");
2223 FAKE_SY("\n");
2224 FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n");
2225 FAKE_SY(" ...\n");
2226 FAKE_SY("\n");
2227 FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n");
2228 FAKE_SY(" ...\n");
2229 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2230 FAKE_SY("\n");
2231 #endif
2233 /* SYS___realpathat 574 */
2234 #if defined(SYS___realpathat)
2235 GO(SYS___realpathat, " 5s 2m");
2236 SY(SYS___realpathat, x0+0xffff, x0, x0, x0+100, x0+2); FAIL;
2237 #else
2238 FAKE_GO("574: SYS___realpathat 5s 2m");
2239 FAKE_SY("Syscall param __realpathat(fd) contains uninitialised byte(s)\n");
2240 FAKE_SY(" ...\n");
2241 FAKE_SY("\n");
2242 FAKE_SY("Syscall param __realpathat(path) contains uninitialised byte(s)\n");
2243 FAKE_SY(" ...\n");
2244 FAKE_SY("\n");
2245 FAKE_SY("Syscall param __realpathat(buf) contains uninitialised byte(s)\n");
2246 FAKE_SY(" ...\n");
2247 FAKE_SY("\n");
2248 FAKE_SY("Syscall param __realpathat(size) contains uninitialised byte(s)\n");
2249 FAKE_SY(" ...\n");
2250 FAKE_SY("\n");
2251 FAKE_SY("Syscall param __realpathat(flags) contains uninitialised byte(s)\n");
2252 FAKE_SY(" ...\n");
2253 FAKE_SY("\n");
2254 FAKE_SY("Syscall param __realpathat(path) points to unaddressable byte(s)\n");
2255 FAKE_SY(" ...\n");
2256 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2257 FAKE_SY("\n");
2258 FAKE_SY("Syscall param __realpathat(buf) points to unaddressable byte(s)\n");
2259 FAKE_SY(" ...\n");
2260 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2261 FAKE_SY("\n");
2262 #endif
2264 /* SYS_close_range 575 */
2265 #if defined(SYS_close_range)
2266 GO(SYS_close_range, "3s 0m");
2267 SY(SYS_close_range, x0+5, x0+10, x0+12345); FAIL;
2268 #else
2269 #endif
2271 /* SYS___specialfd 577 */
2272 #if defined(SYS___specialfd)
2273 GO(SYS___specialfd, "3s 1m");
2274 SY(SYS___specialfd, x0+0xf000, x0+1, x0+10); FAIL;
2275 #else
2276 FAKE_GO("577: SYS___specialfd 3s 1m");
2277 FAKE_SY("Syscall param __specialfd(type) contains uninitialised byte(s)\n");
2278 FAKE_SY(" ...\n");
2279 FAKE_SY("\n");
2280 FAKE_SY("Syscall param __specialfd(req) contains uninitialised byte(s)\n");
2281 FAKE_SY(" ...\n");
2282 FAKE_SY("\n");
2283 FAKE_SY("Syscall param __specialfd(len) contains uninitialised byte(s)\n");
2284 FAKE_SY(" ...\n");
2285 FAKE_SY("\n");
2286 FAKE_SY("Syscall param __specialfd(req) points to unaddressable byte(s)\n");
2287 FAKE_SY(" ...\n");
2288 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2289 FAKE_SY("\n");
2290 #endif
2292 /* SYS_aio_writev 578 */
2293 #if defined(SYS_aio_writev)
2294 GO(SYS_aio_writev, "1s 1m");
2295 SY(SYS_aio_writev, x0+1); FAIL;
2296 #else
2297 FAKE_GO("578: SYS_aio_writev 1s 1m");
2298 FAKE_SY("Syscall param aio_writev(iocb) contains uninitialised byte(s)\n");
2299 FAKE_SY(" ...\n");
2300 FAKE_SY("\n");
2301 FAKE_SY("Syscall param aio_writev(iocb) points to unaddressable byte(s)\n");
2302 FAKE_SY(" ...\n");
2303 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2304 FAKE_SY("\n");
2305 #endif
2307 /* SYS_aio_readv 579 */
2308 #if defined(SYS_aio_readv)
2309 GO(SYS_aio_readv, "1s 1m");
2310 SY(SYS_aio_readv, x0+1); FAIL;
2311 #else
2312 FAKE_GO("579: SYS_aio_readv 1s 1m");
2313 FAKE_SY("Syscall param aio_readv(iocb) contains uninitialised byte(s)\n");
2314 FAKE_SY(" ...\n");
2315 FAKE_SY("\n");
2316 FAKE_SY("Syscall param aio_readv(iocb) points to unaddressable byte(s)\n");
2317 FAKE_SY(" ...\n");
2318 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2319 FAKE_SY("\n");
2320 #endif
2322 // FreeBSD 15 (and any backports)
2323 /* SYS_kqueuex 583 */
2324 #if defined(SYS_kqueuex)
2325 GO(SYS_kqueuex, " 1s 0m");
2326 SY(SYS_kqueuex, x0+123); FAIL;
2327 #else
2328 FAKE_GO("583: SYS_kqueuex 1s 0m");
2329 FAKE_SY("Syscall param kqueuex(flags) contains uninitialised byte(s)\n");
2330 FAKE_SY(" ...\n");
2331 FAKE_SY("\n");
2332 #endif
2334 /* SYS_membarrier 584 */
2335 #if defined(SYS_membarrier)
2336 GO(SYS_membarrier, " 3s 0m");
2337 SY(SYS_membarrier, x0+123, x0+456, x0+789); FAIL;
2338 #else
2339 FAKE_GO("584: SYS_membarrier 3s 0m");
2340 FAKE_SY("Syscall param membarrier(cmd) contains uninitialised byte(s)\n");
2341 FAKE_SY(" ...\n");
2342 FAKE_SY("\n");
2343 FAKE_SY("Syscall param membarrier(flags) contains uninitialised byte(s)\n");
2344 FAKE_SY(" ...\n");
2345 FAKE_SY("\n");
2346 FAKE_SY("Syscall param membarrier(cpu_id) contains uninitialised byte(s)\n");
2347 FAKE_SY(" ...\n");
2348 FAKE_SY("\n");
2349 #endif
2351 /* SYS_timerfd_create 585 */
2352 #if defined(SYS_timerfd_create)
2353 GO(SYS_timerfd_create, " 2s 0m");
2354 SY(SYS_timerfd_create, x0+123, x0+23456); FAIL;
2355 #else
2356 FAKE_GO("585: SYS_timerfd_create 2s 0m");
2357 FAKE_SY("Syscall param timerfd_create(clockid) contains uninitialised byte(s)\n");
2358 FAKE_SY(" ...\n");
2359 FAKE_SY("\n");
2360 FAKE_SY("Syscall param timerfd_create(flags) contains uninitialised byte(s)\n");
2361 FAKE_SY(" ...\n");
2362 FAKE_SY("\n");
2363 #endif
2365 /* SYS_timerfd_gettime 586 */
2366 #if defined(SYS_timerfd_gettime)
2367 GO(SYS_timerfd_gettime, " 2s 1m");
2368 SY(SYS_timerfd_gettime, x0+100, x0); FAIL;
2369 #else
2370 FAKE_GO("586: SYS_timerfd_gettime 2s 1m");
2371 FAKE_SY("Syscall param timerfd_gettime(fd) contains uninitialised byte(s)\n");
2372 FAKE_SY(" ...\n");
2373 FAKE_SY("\n");
2374 FAKE_SY("Syscall param timerfd_gettime(curr_value) contains uninitialised byte(s)\n");
2375 FAKE_SY(" ...\n");
2376 FAKE_SY("\n");
2377 FAKE_SY("Syscall param timerfd_gettime(curr_value) points to unaddressable byte(s)\n");
2378 FAKE_SY(" ...\n");
2379 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2380 FAKE_SY("\n");
2381 #endif
2383 /* SYS_timerfd_settime 587 */
2384 #if defined(SYS_timerfd_settime)
2385 GO(SYS_timerfd_settime, "4s 2m");
2386 SY(SYS_timerfd_settime, x0+321, x0, x0+10, x0+5); FAIL;
2387 #else
2388 FAKE_GO("587: SYS_timerfd_settime 4s 2m");
2389 FAKE_SY("Syscall param timerfd_settime(fd) contains uninitialised byte(s)\n");
2390 FAKE_SY(" ...\n");
2391 FAKE_SY("\n");
2392 FAKE_SY("Syscall param timerfd_settime(flags) contains uninitialised byte(s)\n");
2393 FAKE_SY(" ...\n");
2394 FAKE_SY("\n");
2395 FAKE_SY("Syscall param timerfd_settime(new_value) contains uninitialised byte(s)\n");
2396 FAKE_SY(" ...\n");
2397 FAKE_SY("\n");
2398 FAKE_SY("Syscall param timerfd_settime(old_value) contains uninitialised byte(s)\n");
2399 FAKE_SY(" ...\n");
2400 FAKE_SY("\n");
2401 FAKE_SY("Syscall param timerfd_settime(new_value) points to unaddressable byte(s)\n");
2402 FAKE_SY(" ...\n");
2403 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2404 FAKE_SY("\n");
2405 FAKE_SY("Syscall param timerfd_settime(old_value) points to unaddressable byte(s)\n");
2406 FAKE_SY(" ...\n");
2407 FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
2408 FAKE_SY("\n");
2409 #endif
2411 /* SYS_exit 1 */
2412 GO(SYS_exit, "1s 0m");
2413 SY(SYS_exit, x0); FAIL;