scalar.c revision 870f170ccce872764e974b86f55247c0d97dc634
1#include "../../memcheck.h"
2#include "scalar.h"
3#include <unistd.h>
4#include <sched.h>
5#include <signal.h>
6
7
8// Here we are trying to trigger every syscall error (scalar errors and
9// memory errors) for every syscall.  We do this by passing a lot of bogus
10// arguments, mostly 0 and 1 (often it's 1 because NULL ptr args often aren't
11// checked for memory errors, or in order to have a non-zero length used
12// with some buffer).  So most of the syscalls don't actually succeed and do
13// anything.
14//
15// Occasionally we have to be careful not to cause Valgrind to seg fault in
16// its pre-syscall wrappers;  it does so because it can't know in general
17// when memory is unaddressable, and so tries to dereference it when doing
18// PRE_MEM_READ/PRE_MEM_WRITE calls.  (Note that Memcheck will
19// always issue an error message immediately before these seg faults occur).
20
21int main(void)
22{
23   // uninitialised, but we know px[0] is 0x0
24   long* px  = malloc(sizeof(long));
25   long  x0  = px[0];
26   long  res;
27
28   // All __NR_xxx numbers are taken from x86
29
30   // __NR_restart_syscall 0  // XXX: not yet handled, perhaps should be...
31   GO(__NR_restart_syscall, "n/a");
32 //SY(__NR_restart_syscall); // (Not yet handled by Valgrind) FAIL;
33
34   // __NR_exit 1
35   GO(__NR_exit, "below");
36   // (see below)
37
38   // __NR_fork 2
39   GO(__NR_fork, "other");
40   // (sse scalar_fork.c)
41
42   // __NR_read 3
43   // Nb: here we are also getting an error from the syscall arg itself.
44   GO(__NR_read, "1+3s 1m");
45   SY(__NR_read+x0, x0, x0, x0+1); FAILx(EFAULT);
46
47   // __NR_write 4
48   GO(__NR_write, "3s 1m");
49   SY(__NR_write, x0, x0, x0+1); FAIL;
50
51   // __NR_open 5
52   GO(__NR_open, "(2-args) 2s 1m");
53   SY(__NR_open, x0, x0); FAIL;
54
55   // Only 1s 0m errors -- the other 2s 1m have been checked in the previous
56   // open test, and if we test them they may be commoned up but they also
57   // may not.
58   GO(__NR_open, "(3-args) 1s 0m");
59   SY(__NR_open, "scalar.c", O_CREAT|O_EXCL, x0); FAIL;
60
61   // __NR_close 6
62   GO(__NR_close, "1s 0m");
63   SY(__NR_close, x0-1); FAIL;
64
65   // __NR_waitpid 7
66   GO(__NR_waitpid, "3s 1m");
67   SY(__NR_waitpid, x0, x0+1, x0); FAIL;
68
69   // __NR_creat 8
70   GO(__NR_creat, "2s 1m");
71   SY(__NR_creat, x0, x0); FAIL;
72
73   // __NR_link 9
74   GO(__NR_link, "2s 2m");
75   SY(__NR_link, x0, x0); FAIL;
76
77   // __NR_unlink 10
78   GO(__NR_unlink, "1s 1m");
79   SY(__NR_unlink, x0); FAIL;
80
81   // __NR_execve 11
82   // Nb: could have 3 memory errors if we pass x0+1 as the 2nd and 3rd
83   // args, except for bug #93174.
84   GO(__NR_execve, "3s 1m");
85   SY(__NR_execve, x0, x0, x0); FAIL;
86
87   // __NR_chdir 12
88   GO(__NR_chdir, "1s 1m");
89   SY(__NR_chdir, x0); FAIL;
90
91   // __NR_time 13
92   GO(__NR_time, "1s 1m");
93   SY(__NR_time, x0+1); FAIL;
94
95   // __NR_mknod 14
96   GO(__NR_mknod, "3s 1m");
97   SY(__NR_mknod, x0, x0, x0); FAIL;
98
99   // __NR_chmod 15
100   GO(__NR_chmod, "2s 1m");
101   SY(__NR_chmod, x0, x0); FAIL;
102
103   // __NR_lchown 16
104   GO(__NR_lchown, "n/a");
105 //SY(__NR_lchown); // (Not yet handled by Valgrind) FAIL;
106
107   // __NR_break 17
108   GO(__NR_break, "ni");
109   SY(__NR_break); FAIL;
110
111   // __NR_oldstat 18
112   GO(__NR_oldstat, "n/a");
113   // (obsolete, not handled by Valgrind)
114
115   // __NR_lseek 19
116   GO(__NR_lseek, "3s 0m");
117   SY(__NR_lseek, x0-1, x0, x0); FAILx(EBADF);
118
119   // __NR_getpid 20
120   GO(__NR_getpid, "0s 0m");
121   SY(__NR_getpid); SUCC;
122
123   // __NR_mount 21
124   GO(__NR_mount, "5s 3m");
125   SY(__NR_mount, x0, x0, x0, x0, x0); FAIL;
126
127   // __NR_umount 22
128   GO(__NR_umount, "1s 1m");
129   SY(__NR_umount, x0); FAIL;
130
131   // __NR_setuid 23
132   GO(__NR_setuid, "1s 0m");
133   SY(__NR_setuid, x0); FAIL;
134
135   // __NR_getuid 24
136   GO(__NR_getuid, "0s 0m");
137   SY(__NR_getuid); SUCC;
138
139   // __NR_stime 25
140   GO(__NR_stime, "n/a");
141 //SY(__NR_stime); // (Not yet handled by Valgrind) FAIL;
142
143   // __NR_ptrace 26
144   // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 2m
145   GO(__NR_ptrace, "4s 1m");
146   SY(__NR_ptrace, x0+PTRACE_GETREGS, x0, x0, x0); FAIL;
147
148   // __NR_alarm 27
149   GO(__NR_alarm, "1s 0m");
150   SY(__NR_alarm, x0); SUCC;
151
152   // __NR_oldfstat 28
153   GO(__NR_oldfstat, "n/a");
154   // (obsolete, not handled by Valgrind)
155
156   // __NR_pause 29
157   GO(__NR_pause, "ignore");
158   // (hard to test, and no args so not much to be gained -- don't bother)
159
160   // __NR_utime 30
161   GO(__NR_utime, "2s 2m");
162   SY(__NR_utime, x0, x0+1); FAIL;
163
164   // __NR_stty 31
165   GO(__NR_stty, "ni");
166   SY(__NR_stty); FAIL;
167
168   // __NR_gtty 32
169   GO(__NR_gtty, "ni");
170   SY(__NR_gtty); FAIL;
171
172   // __NR_access 33
173   GO(__NR_access, "2s 1m");
174   SY(__NR_access, x0, x0); FAIL;
175
176   // __NR_nice 34
177   GO(__NR_nice, "1s 0m");
178   SY(__NR_nice, x0); SUCC;
179
180   // __NR_ftime 35
181   GO(__NR_ftime, "ni");
182   SY(__NR_ftime); FAIL;
183
184   // __NR_sync 36
185   GO(__NR_sync, "0s 0m");
186   SY(__NR_sync); SUCC;
187
188   // __NR_kill 37
189   GO(__NR_kill, "2s 0m");
190   SY(__NR_kill, x0, x0); SUCC;
191
192   // __NR_rename 38
193   GO(__NR_rename, "2s 2m");
194   SY(__NR_rename, x0, x0); FAIL;
195
196   // __NR_mkdir 39
197   GO(__NR_mkdir, "2s 1m");
198   SY(__NR_mkdir, x0, x0); FAIL;
199
200   // __NR_rmdir 40
201   GO(__NR_rmdir, "1s 1m");
202   SY(__NR_rmdir, x0); FAIL;
203
204   // __NR_dup 41
205   GO(__NR_dup, "1s 0m");
206   SY(__NR_dup, x0-1); FAIL;
207
208   // __NR_pipe 42
209   GO(__NR_pipe, "1s 1m");
210   SY(__NR_pipe, x0); FAIL;
211
212   // __NR_times 43
213   GO(__NR_times, "1s 1m");
214   SY(__NR_times, x0+1); FAIL;
215
216   // __NR_prof 44
217   GO(__NR_prof, "ni");
218   SY(__NR_prof); FAIL;
219
220   // __NR_brk 45
221   GO(__NR_brk, "1s 0m");
222   SY(__NR_brk, x0); SUCC;
223
224   // __NR_setgid 46
225   GO(__NR_setgid, "1s 0m");
226   SY(__NR_setgid, x0); FAIL;
227
228   // __NR_getgid 47
229   GO(__NR_getgid, "0s 0m");
230   SY(__NR_getgid); SUCC;
231
232   // __NR_signal 48
233   GO(__NR_signal, "n/a");
234 //SY(__NR_signal); // (Not yet handled by Valgrind) FAIL;
235
236   // __NR_geteuid 49
237   GO(__NR_geteuid, "0s 0m");
238   SY(__NR_geteuid); SUCC;
239
240   // __NR_getegid 50
241   GO(__NR_getegid, "0s 0m");
242   SY(__NR_getegid); SUCC;
243
244   // __NR_acct 51
245   GO(__NR_acct, "1s 1m");
246   SY(__NR_acct, x0); FAIL;
247
248   // __NR_umount2 52
249   GO(__NR_umount2, "2s 1m");
250   SY(__NR_umount2, x0, x0); FAIL;
251
252   // __NR_lock 53
253   GO(__NR_lock, "ni");
254   SY(__NR_lock); FAIL;
255
256   // __NR_ioctl 54
257   #include <asm/ioctls.h>
258   GO(__NR_ioctl, "3s 1m");
259   SY(__NR_ioctl, x0, x0+TCSETS, x0); FAIL;
260
261   // __NR_fcntl 55
262   // As with sys_open(), the 'fd' error is suppressed for the later ones.
263   // For F_GETFD the 3rd arg is ignored
264   GO(__NR_fcntl, "(GETFD) 2s 0m");
265   SY(__NR_fcntl, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
266
267   // For F_DUPFD the 3rd arg is 'arg'.  We don't check the 1st two args
268   // because any errors may or may not be commoned up with the ones from
269   // the previous fcntl call.
270   GO(__NR_fcntl, "(DUPFD) 1s 0m");
271   SY(__NR_fcntl, -1, F_DUPFD, x0); FAILx(EBADF);
272
273   // For F_GETLK the 3rd arg is 'lock'.  On x86, this fails w/EBADF.  But
274   // on amd64 in 32-bit mode it fails w/EFAULT.  We don't check the 1st two
275   // args for the reason given above.
276   GO(__NR_fcntl, "(GETLK) 1s 0m");
277   SY(__NR_fcntl, -1, F_GETLK, x0); FAIL; //FAILx(EBADF);
278
279   // __NR_mpx 56
280   GO(__NR_mpx, "ni");
281   SY(__NR_mpx); FAIL;
282
283   // __NR_setpgid 57
284   GO(__NR_setpgid, "2s 0m");
285   SY(__NR_setpgid, x0, x0-1); FAIL;
286
287   // __NR_ulimit 58
288   GO(__NR_ulimit, "ni");
289   SY(__NR_ulimit); FAIL;
290
291   // __NR_oldolduname 59
292   GO(__NR_oldolduname, "n/a");
293   // (obsolete, not handled by Valgrind)
294
295   // __NR_umask 60
296   GO(__NR_umask, "1s 0m");
297   SY(__NR_umask, x0+022); SUCC;
298
299   // __NR_chroot 61
300   GO(__NR_chroot, "1s 1m");
301   SY(__NR_chroot, x0); FAIL;
302
303   // __NR_ustat 62
304   GO(__NR_ustat, "n/a");
305   // (deprecated, not handled by Valgrind)
306
307   // __NR_dup2 63
308   GO(__NR_dup2, "2s 0m");
309   SY(__NR_dup2, x0-1, x0); FAIL;
310
311   // __NR_getppid 64
312   GO(__NR_getppid, "0s 0m");
313   SY(__NR_getppid); SUCC;
314
315   // __NR_getpgrp 65
316   GO(__NR_getpgrp, "0s 0m");
317   SY(__NR_getpgrp); SUCC;
318
319   // __NR_setsid 66
320   GO(__NR_setsid, "0s 0m");
321   SY(__NR_setsid); SUCC_OR_FAIL;
322
323   // __NR_sigaction 67
324   GO(__NR_sigaction, "3s 4m");
325   SY(__NR_sigaction, x0, x0+&px[1], x0+&px[1]); FAIL;
326
327   // __NR_sgetmask 68 sys_sgetmask()
328   GO(__NR_sgetmask, "n/a");
329 //SY(__NR_sgetmask); // (Not yet handled by Valgrind) FAIL;
330
331   // __NR_ssetmask 69
332   GO(__NR_ssetmask, "n/a");
333 //SY(__NR_ssetmask); // (Not yet handled by Valgrind) FAIL;
334
335   // __NR_setreuid 70
336   GO(__NR_setreuid, "2s 0m");
337   SY(__NR_setreuid, x0, x0); FAIL;
338
339   // __NR_setregid 71
340   GO(__NR_setregid, "2s 0m");
341   SY(__NR_setregid, x0, x0); FAIL;
342
343   // __NR_sigsuspend 72
344   // XXX: how do you use this function?
345   GO(__NR_sigsuspend, "ignore");
346   // (I don't know how to test this...)
347
348   // __NR_sigpending 73
349   GO(__NR_sigpending, "1s 1m");
350   SY(__NR_sigpending, x0); FAIL;
351
352   // __NR_sethostname 74
353   GO(__NR_sethostname, "n/a");
354 //SY(__NR_sethostname); // (Not yet handled by Valgrind) FAIL;
355
356   // __NR_setrlimit 75
357   GO(__NR_setrlimit, "2s 1m");
358   SY(__NR_setrlimit, x0, x0); FAIL;
359
360   // __NR_getrlimit 76
361   GO(__NR_getrlimit, "2s 1m");
362   SY(__NR_getrlimit, x0, x0); FAIL;
363
364   // __NR_getrusage 77
365   GO(__NR_getrusage, "2s 1m");
366   SY(__NR_getrusage, x0, x0); FAIL;
367
368   // __NR_gettimeofday 78
369   GO(__NR_gettimeofday, "2s 2m");
370   SY(__NR_gettimeofday, x0, x0+1); FAIL;
371
372   // __NR_settimeofday 79
373   GO(__NR_settimeofday, "2s 2m");
374   SY(__NR_settimeofday, x0, x0+1); FAIL;
375
376   // __NR_getgroups 80
377   GO(__NR_getgroups, "2s 1m");
378   SY(__NR_getgroups, x0+1, x0+1); FAIL;
379
380   // __NR_setgroups 81
381   GO(__NR_setgroups, "2s 1m");
382   SY(__NR_setgroups, x0+1, x0+1); FAIL;
383
384   // __NR_select 82
385   {
386      long args[5] = { x0+8, x0+0xffffffee, x0+1, x0+1, x0+1 };
387      GO(__NR_select, "1s 5m");
388      SY(__NR_select, args+x0); FAIL;
389   }
390
391   // __NR_symlink 83
392   GO(__NR_symlink, "2s 2m");
393   SY(__NR_symlink, x0, x0); FAIL;
394
395   // __NR_oldlstat 84
396   GO(__NR_oldlstat, "n/a");
397   // (obsolete, not handled by Valgrind)
398
399   // __NR_readlink 85
400   GO(__NR_readlink, "3s 2m");
401   SY(__NR_readlink, x0+1, x0+1, x0+1); FAIL;
402
403   // __NR_uselib 86
404   GO(__NR_uselib, "n/a");
405 //SY(__NR_uselib); // (Not yet handled by Valgrind) FAIL;
406
407   // __NR_swapon 87
408   GO(__NR_swapon, "n/a");
409 //SY(__NR_swapon); // (Not yet handled by Valgrind) FAIL;
410
411   // __NR_reboot 88
412   GO(__NR_reboot, "n/a");
413 //SY(__NR_reboot); // (Not yet handled by Valgrind) FAIL;
414
415   // __NR_readdir 89
416   GO(__NR_readdir, "n/a");
417   // (superseded, not handled by Valgrind)
418
419   // __NR_mmap 90
420   {
421      long args[6] = { x0, x0, x0, x0, x0-1, x0 };
422      GO(__NR_mmap, "1s 1m");
423      SY(__NR_mmap, args+x0); FAIL;
424   }
425
426   // __NR_munmap 91
427   GO(__NR_munmap, "2s 0m");
428   SY(__NR_munmap, x0, x0); FAIL;
429
430   // __NR_truncate 92
431   GO(__NR_truncate, "2s 1m");
432   SY(__NR_truncate, x0, x0); FAIL;
433
434   // __NR_ftruncate 93
435   GO(__NR_ftruncate, "2s 0m");
436   SY(__NR_ftruncate, x0, x0); FAIL;
437
438   // __NR_fchmod 94
439   GO(__NR_fchmod, "2s 0m");
440   SY(__NR_fchmod, x0-1, x0); FAIL;
441
442   // __NR_fchown 95
443   GO(__NR_fchown, "3s 0m");
444   SY(__NR_fchown, x0, x0, x0); FAIL;
445
446   // __NR_getpriority 96
447   GO(__NR_getpriority, "2s 0m");
448   SY(__NR_getpriority, x0-1, x0); FAIL;
449
450   // __NR_setpriority 97
451   GO(__NR_setpriority, "3s 0m");
452   SY(__NR_setpriority, x0-1, x0, x0); FAIL;
453
454   // __NR_profil 98
455   GO(__NR_profil, "ni");
456   SY(__NR_profil); FAIL;
457
458   // __NR_statfs 99
459   GO(__NR_statfs, "2s 2m");
460   SY(__NR_statfs, x0, x0); FAIL;
461
462   // __NR_fstatfs 100
463   GO(__NR_fstatfs, "2s 1m");
464   SY(__NR_fstatfs, x0, x0); FAIL;
465
466   // __NR_ioperm 101
467   GO(__NR_ioperm, "3s 0m");
468   SY(__NR_ioperm, x0, x0, x0); FAIL;
469
470   // __NR_socketcall 102
471   GO(__NR_socketcall, "XXX");
472   // (XXX: need to do all sub-cases properly)
473
474   // __NR_syslog 103
475   GO(__NR_syslog, "3s 1m");
476   SY(__NR_syslog, x0+2, x0, x0+1); FAIL;
477
478   // __NR_setitimer 104
479   GO(__NR_setitimer, "3s 2m");
480   SY(__NR_setitimer, x0, x0+1, x0+1); FAIL;
481
482   // __NR_getitimer 105
483   GO(__NR_getitimer, "2s 1m");
484   SY(__NR_getitimer, x0, x0, x0); FAIL;
485
486   // __NR_stat 106
487   GO(__NR_stat, "2s 2m");
488   SY(__NR_stat, x0, x0); FAIL;
489
490   // __NR_lstat 107
491   GO(__NR_lstat, "2s 2m");
492   SY(__NR_lstat, x0, x0); FAIL;
493
494   // __NR_fstat 108
495   GO(__NR_fstat, "2s 1m");
496   SY(__NR_fstat, x0, x0); FAIL;
497
498   // __NR_olduname 109
499   GO(__NR_olduname, "n/a");
500   // (obsolete, not handled by Valgrind)
501
502   // __NR_iopl 110
503   GO(__NR_iopl, "1s 0m");
504   SY(__NR_iopl, x0+100); FAIL;
505
506   // __NR_vhangup 111
507   GO(__NR_vhangup, "0s 0m");
508   SY(__NR_vhangup); SUCC_OR_FAIL;  // Will succeed for superuser
509
510   // __NR_idle 112
511   GO(__NR_idle, "ni");
512   SY(__NR_idle); FAIL;
513
514   // __NR_vm86old 113
515   GO(__NR_vm86old, "n/a");
516   // (will probably never be handled by Valgrind)
517
518   // __NR_wait4 114
519   GO(__NR_wait4, "4s 2m");
520   SY(__NR_wait4, x0, x0+1, x0, x0+1); FAIL;
521
522   // __NR_swapoff 115
523   GO(__NR_swapoff, "n/a");
524 //SY(__NR_swapoff); // (Not yet handled by Valgrind) FAIL;
525
526   // __NR_sysinfo 116
527   GO(__NR_sysinfo, "1s 1m");
528   SY(__NR_sysinfo, x0); FAIL;
529
530   // __NR_ipc 117
531   // XXX: This is simplistic -- need to do all the sub-cases properly.
532   // XXX: Also, should be 6 scalar errors, except glibc's syscall() doesn't
533   //      use the 6th one!
534   GO(__NR_ipc, "5s 0m");
535   SY(__NR_ipc, x0+4, x0, x0, x0, x0, x0); FAIL;
536
537   // __NR_fsync 118
538   GO(__NR_fsync, "1s 0m");
539   SY(__NR_fsync, x0-1); FAIL;
540
541   // __NR_sigreturn 119
542   GO(__NR_sigreturn, "n/a");
543 //SY(__NR_sigreturn); // (Not yet handled by Valgrind) FAIL;
544
545   // __NR_clone 120
546#ifndef CLONE_PARENT_SETTID
547#define CLONE_PARENT_SETTID	0x00100000
548#endif
549   // XXX: should really be "4s 2m"?  Not sure... (see PRE(sys_clone))
550   GO(__NR_clone, "4s 0m");
551   SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0); FAIL;
552   if (0 == res) {
553      SY(__NR_exit, 0); FAIL;
554   }
555
556   // __NR_setdomainname 121
557   GO(__NR_setdomainname, "n/a");
558 //SY(__NR_setdomainname); // (Not yet handled by Valgrind) FAIL;
559
560   // __NR_uname 122
561   GO(__NR_uname, "1s 1m");
562   SY(__NR_uname, x0); FAIL;
563
564   // __NR_modify_ldt 123
565   GO(__NR_modify_ldt, "3s 1m");
566   SY(__NR_modify_ldt, x0+1, x0, x0+1); FAILx(EINVAL);
567
568   // __NR_adjtimex 124
569   // XXX: need to do properly, but deref'ing NULL causing Valgrind to crash...
570     GO(__NR_adjtimex, "XXX");
571//   SY(__NR_adjtimex, x0); FAIL;
572
573   // __NR_mprotect 125
574   GO(__NR_mprotect, "3s 0m");
575   SY(__NR_mprotect, x0+1, x0, x0); FAILx(EINVAL);
576
577   // __NR_sigprocmask 126
578   GO(__NR_sigprocmask, "3s 2m");
579   SY(__NR_sigprocmask, x0, x0+&px[1], x0+&px[1]); SUCC;
580
581   // __NR_create_module 127
582   GO(__NR_create_module, "ni");
583   SY(__NR_create_module); FAIL;
584
585   // __NR_init_module 128
586   GO(__NR_init_module, "3s 2m");
587   SY(__NR_init_module, x0, x0+1, x0); FAIL;
588
589   // __NR_delete_module 129
590   GO(__NR_delete_module, "n/a");
591 //SY(__NR_delete_module); // (Not yet handled by Valgrind) FAIL;
592
593   // __NR_get_kernel_syms 130
594   GO(__NR_get_kernel_syms, "ni");
595   SY(__NR_get_kernel_syms); FAIL;
596
597   // __NR_quotactl 131
598   GO(__NR_quotactl, "4s 1m");
599   SY(__NR_quotactl, x0, x0, x0, x0); FAIL;
600
601   // __NR_getpgid 132
602   GO(__NR_getpgid, "1s 0m");
603   SY(__NR_getpgid, x0-1); FAIL;
604
605   // __NR_fchdir 133
606   GO(__NR_fchdir, "1s 0m");
607   SY(__NR_fchdir, x0-1); FAIL;
608
609   // __NR_bdflush 134
610   GO(__NR_bdflush, "n/a");
611 //SY(__NR_bdflush); // (Not yet handled by Valgrind) FAIL;
612
613   // __NR_sysfs 135
614   GO(__NR_sysfs, "n/a");
615 //SY(__NR_sysfs); // (Not yet handled by Valgrind) FAIL;
616
617   // __NR_personality 136
618   GO(__NR_personality, "1s 0m");
619   SY(__NR_personality, x0+0xffffffff); SUCC;
620
621   // __NR_afs_syscall 137
622   GO(__NR_afs_syscall, "ni");
623   SY(__NR_afs_syscall); FAIL;
624
625   // __NR_setfsuid 138
626   GO(__NR_setfsuid, "1s 0m");
627   SY(__NR_setfsuid, x0); SUCC;  // This syscall has a stupid return value
628
629   // __NR_setfsgid 139
630   GO(__NR_setfsgid, "1s 0m");
631   SY(__NR_setfsgid, x0); SUCC;  // This syscall has a stupid return value
632
633   // __NR__llseek 140
634   GO(__NR__llseek, "5s 1m");
635   SY(__NR__llseek, x0, x0, x0, x0, x0); FAIL;
636
637   // __NR_getdents 141
638   GO(__NR_getdents, "3s 1m");
639   SY(__NR_getdents, x0, x0, x0+1); FAIL;
640
641   // __NR__newselect 142
642   GO(__NR__newselect, "5s 4m");
643   SY(__NR__newselect, x0+8, x0+0xffffffff, x0+1, x0+1, x0+1); FAIL;
644
645   // __NR_flock 143
646   GO(__NR_flock, "2s 0m");
647   SY(__NR_flock, x0, x0); FAIL;
648
649   // __NR_msync 144
650   GO(__NR_msync, "3s 1m");
651   SY(__NR_msync, x0, x0+1, x0); FAIL;
652
653   // __NR_readv 145
654   GO(__NR_readv, "3s 1m");
655   SY(__NR_readv, x0, x0, x0+1); FAIL;
656
657   // __NR_writev 146
658   GO(__NR_writev, "3s 1m");
659   SY(__NR_writev, x0, x0, x0+1); FAIL;
660
661   // __NR_getsid 147
662   GO(__NR_getsid, "1s 0m");
663   SY(__NR_getsid, x0-1); FAIL;
664
665   // __NR_fdatasync 148
666   GO(__NR_fdatasync, "1s 0m");
667   SY(__NR_fdatasync, x0-1); FAIL;
668
669   // __NR__sysctl 149
670   GO(__NR__sysctl, "1s 1m");
671   SY(__NR__sysctl, x0); FAIL;
672
673   // __NR_mlock 150
674   GO(__NR_mlock, "2s 0m");
675   SY(__NR_mlock, x0, x0+1); FAIL;
676
677   // __NR_munlock 151
678   GO(__NR_munlock, "2s 0m");
679   SY(__NR_munlock, x0, x0+1); FAIL;
680
681   // __NR_mlockall 152
682   GO(__NR_mlockall, "1s 0m");
683   SY(__NR_mlockall, x0-1); FAIL;
684
685   // __NR_munlockall 153
686   GO(__NR_munlockall, "0s 0m");
687   SY(__NR_munlockall); SUCC_OR_FAILx(EPERM);
688
689   // __NR_sched_setparam 154
690   GO(__NR_sched_setparam, "2s 1m");
691   SY(__NR_sched_setparam, x0, x0); FAIL;
692
693   // __NR_sched_getparam 155
694   GO(__NR_sched_getparam, "2s 1m");
695   SY(__NR_sched_getparam, x0, x0); FAIL;
696
697   // __NR_sched_setscheduler 156
698   GO(__NR_sched_setscheduler, "3s 1m");
699   SY(__NR_sched_setscheduler, x0-1, x0, x0+1); FAIL;
700
701   // __NR_sched_getscheduler 157
702   GO(__NR_sched_getscheduler, "1s 0m");
703   SY(__NR_sched_getscheduler, x0-1); FAIL;
704
705   // __NR_sched_yield 158
706   GO(__NR_sched_yield, "0s 0m");
707   SY(__NR_sched_yield); SUCC;
708
709   // __NR_sched_get_priority_max 159
710   GO(__NR_sched_get_priority_max, "1s 0m");
711   SY(__NR_sched_get_priority_max, x0-1); FAIL;
712
713   // __NR_sched_get_priority_min 160
714   GO(__NR_sched_get_priority_min, "1s 0m");
715   SY(__NR_sched_get_priority_min, x0-1); FAIL;
716
717   // __NR_sched_rr_get_interval 161
718   GO(__NR_sched_rr_get_interval, "n/a");
719 //SY(__NR_sched_rr_get_interval); // (Not yet handled by Valgrind) FAIL;
720
721   // __NR_nanosleep 162
722   GO(__NR_nanosleep, "2s 2m");
723   SY(__NR_nanosleep, x0, x0+1); FAIL;
724
725   // __NR_mremap 163
726   GO(__NR_mremap, "5s 0m");
727   SY(__NR_mremap, x0+1, x0, x0, x0+MREMAP_FIXED, x0); FAILx(EINVAL);
728
729   // __NR_setresuid 164
730   GO(__NR_setresuid, "3s 0m");
731   SY(__NR_setresuid, x0, x0, x0); FAIL;
732
733   // __NR_getresuid 165
734   GO(__NR_getresuid, "3s 3m");
735   SY(__NR_getresuid, x0, x0, x0); FAIL;
736
737   // __NR_vm86 166
738   GO(__NR_vm86, "n/a");
739   // (will probably never be handled by Valgrind)
740
741   // __NR_query_module 167
742   GO(__NR_query_module, "ni");
743   SY(__NR_query_module); FAIL;
744
745   // __NR_poll 168
746   GO(__NR_poll, "3s 1m");
747   SY(__NR_poll, x0, x0+1, x0); FAIL;
748
749   // __NR_nfsservctl 169
750   GO(__NR_nfsservctl, "n/a");
751 //SY(__NR_nfsservctl); // (Not yet handled by Valgrind) FAIL;
752
753   // __NR_setresgid 170
754   GO(__NR_setresgid, "3s 0m");
755   SY(__NR_setresgid, x0, x0, x0); FAIL;
756
757   // __NR_getresgid 171
758   GO(__NR_getresgid, "3s 3m");
759   SY(__NR_getresgid, x0, x0, x0); FAIL;
760
761   // __NR_prctl 172
762   GO(__NR_prctl, "5s 0m");
763   SY(__NR_prctl, x0, x0, x0, x0, x0); FAIL;
764
765   // __NR_rt_sigreturn 173
766   GO(__NR_rt_sigreturn, "n/a");
767 //SY(__NR_rt_sigreturn); // (Not yet handled by Valgrind) FAIL;
768
769   // __NR_rt_sigaction 174
770   GO(__NR_rt_sigaction, "4s 4m");
771   SY(__NR_rt_sigaction, x0, x0+&px[2], x0+&px[2], x0); FAIL;
772
773   // __NR_rt_sigprocmask 175
774   GO(__NR_rt_sigprocmask, "4s 2m");
775   SY(__NR_rt_sigprocmask, x0, x0+1, x0+1, x0); FAIL;
776
777   // __NR_rt_sigpending 176
778   GO(__NR_rt_sigpending, "2s 1m");
779   SY(__NR_rt_sigpending, x0, x0+1); FAIL;
780
781   // __NR_rt_sigtimedwait 177
782   GO(__NR_rt_sigtimedwait, "4s 3m");
783   SY(__NR_rt_sigtimedwait, x0+1, x0+1, x0+1, x0); FAIL;
784
785   // __NR_rt_sigqueueinfo 178
786   GO(__NR_rt_sigqueueinfo, "3s 1m");
787   SY(__NR_rt_sigqueueinfo, x0, x0+1, x0); FAIL;
788
789   // __NR_rt_sigsuspend 179
790   GO(__NR_rt_sigsuspend, "ignore");
791   // (I don't know how to test this...)
792
793   // __NR_pread64 180
794   GO(__NR_pread64, "5s 1m");
795   SY(__NR_pread64, x0, x0, x0+1, x0, x0); FAIL;
796
797   // __NR_pwrite64 181
798   GO(__NR_pwrite64, "5s 1m");
799   SY(__NR_pwrite64, x0, x0, x0+1, x0, x0); FAIL;
800
801   // __NR_chown 182
802   GO(__NR_chown, "3s 1m");
803   SY(__NR_chown, x0, x0, x0); FAIL;
804
805   // __NR_getcwd 183
806   GO(__NR_getcwd, "2s 1m");
807   SY(__NR_getcwd, x0, x0+1); FAIL;
808
809   // __NR_capget 184
810   GO(__NR_capget, "2s 2m");
811   SY(__NR_capget, x0, x0); FAIL;
812
813   // __NR_capset 185
814   GO(__NR_capset, "2s 2m");
815   SY(__NR_capset, x0, x0); FAIL;
816
817   // __NR_sigaltstack 186
818   {
819      struct our_sigaltstack {
820              void *ss_sp;
821              int ss_flags;
822              size_t ss_size;
823      } ss;
824      ss.ss_sp     = NULL;
825      ss.ss_flags  = 0;
826      ss.ss_size   = 0;
827      VALGRIND_MAKE_MEM_NOACCESS(& ss, sizeof(struct our_sigaltstack));
828      GO(__NR_sigaltstack, "2s 2m");
829      SY(__NR_sigaltstack, x0+&ss, x0+&ss); SUCC;
830   }
831
832   // __NR_sendfile 187
833   GO(__NR_sendfile, "4s 1m");
834   SY(__NR_sendfile, x0, x0, x0+1, x0); FAIL;
835
836   // __NR_getpmsg 188
837   // Could do 5s 4m with more effort, but I can't be bothered for this
838   // crappy non-standard syscall.
839   GO(__NR_getpmsg, "5s 0m");
840   SY(__NR_getpmsg, x0, x0, x0, x0); FAIL;
841
842   // __NR_putpmsg 189
843   // Could do 5s 2m with more effort, but I can't be bothered for this
844   // crappy non-standard syscall.
845   GO(__NR_putpmsg, "5s 0m");
846   SY(__NR_putpmsg, x0, x0, x0, x0, x0); FAIL;
847
848   // __NR_vfork 190
849   GO(__NR_vfork, "other");
850   // (sse scalar_vfork.c)
851
852   // __NR_ugetrlimit 191
853   GO(__NR_ugetrlimit, "2s 1m");
854   SY(__NR_ugetrlimit, x0, x0); FAIL;
855
856   // __NR_mmap2 192
857   GO(__NR_mmap2, "6s 0m");
858   SY(__NR_mmap2, x0, x0, x0, x0, x0-1, x0); FAIL;
859
860   // __NR_truncate64 193
861   GO(__NR_truncate64, "3s 1m");
862   SY(__NR_truncate64, x0, x0, x0); FAIL;
863
864   // __NR_ftruncate64 194
865   GO(__NR_ftruncate64, "3s 0m");
866   SY(__NR_ftruncate64, x0, x0, x0); FAIL;
867
868   // __NR_stat64 195
869   GO(__NR_stat64, "2s 2m");
870   SY(__NR_stat64, x0, x0); FAIL;
871
872   // __NR_lstat64 196
873   GO(__NR_lstat64, "2s 2m");
874   SY(__NR_lstat64, x0, x0); FAIL;
875
876   // __NR_fstat64 197
877   GO(__NR_fstat64, "2s 1m");
878   SY(__NR_fstat64, x0, x0); FAIL;
879
880   // __NR_lchown32 198
881   GO(__NR_lchown32, "3s 1m");
882   SY(__NR_lchown32, x0, x0, x0); FAIL;
883
884   // __NR_getuid32 199
885   GO(__NR_getuid32, "0s 0m");
886   SY(__NR_getuid32); SUCC;
887
888   // __NR_getgid32 200
889   GO(__NR_getgid32, "0s 0m");
890   SY(__NR_getgid32); SUCC;
891
892   // __NR_geteuid32 201
893   GO(__NR_geteuid32, "0s 0m");
894   SY(__NR_geteuid32); SUCC;
895
896   // __NR_getegid32 202
897   GO(__NR_getegid32, "0s 0m");
898   SY(__NR_getegid32); SUCC;
899
900   // __NR_setreuid32 203
901   GO(__NR_setreuid32, "2s 0m");
902   SY(__NR_setreuid32, x0, x0); FAIL;
903
904   // __NR_setregid32 204
905   GO(__NR_setregid32, "2s 0m");
906   SY(__NR_setregid32, x0, x0); FAIL;
907
908   // __NR_getgroups32 205
909   GO(__NR_getgroups32, "2s 1m");
910   SY(__NR_getgroups32, x0+1, x0+1); FAIL;
911
912   // __NR_setgroups32 206
913   GO(__NR_setgroups32, "2s 1m");
914   SY(__NR_setgroups32, x0+1, x0+1); FAIL;
915
916   // __NR_fchown32 207
917   GO(__NR_fchown32, "3s 0m");
918   SY(__NR_fchown32, x0, x0, x0); FAIL;
919
920   // __NR_setresuid32 208
921   GO(__NR_setresuid32, "3s 0m");
922   SY(__NR_setresuid32, x0, x0, x0); FAIL;
923
924   // __NR_getresuid32 209
925   GO(__NR_getresuid32, "3s 3m");
926   SY(__NR_getresuid32, x0, x0, x0); FAIL;
927
928   // __NR_setresgid32 210
929   GO(__NR_setresgid32, "3s 0m");
930   SY(__NR_setresgid32, x0, x0, x0); FAIL;
931
932   // __NR_getresgid32 211
933   GO(__NR_getresgid32, "3s 3m");
934   SY(__NR_getresgid32, x0, x0, x0); FAIL;
935
936   // __NR_chown32 212
937   GO(__NR_chown32, "3s 1m");
938   SY(__NR_chown32, x0, x0, x0); FAIL;
939
940   // __NR_setuid32 213
941   GO(__NR_setuid32, "1s 0m");
942   SY(__NR_setuid32, x0); FAIL;
943
944   // __NR_setgid32 214
945   GO(__NR_setgid32, "1s 0m");
946   SY(__NR_setgid32, x0); FAIL;
947
948   // __NR_setfsuid32 215
949   GO(__NR_setfsuid32, "1s 0m");
950   SY(__NR_setfsuid32, x0); SUCC;  // This syscall has a stupid return value
951
952   // __NR_setfsgid32 216
953   GO(__NR_setfsgid32, "1s 0m");
954   SY(__NR_setfsgid32, x0); SUCC;  // This syscall has a stupid return value
955
956   // __NR_pivot_root 217
957   GO(__NR_pivot_root, "n/a");
958 //SY(__NR_pivot_root); // (Not yet handled by Valgrind) FAIL;
959
960   // __NR_mincore 218
961   GO(__NR_mincore, "3s 1m");
962   SY(__NR_mincore, x0, x0+40960, x0); FAIL;
963
964   // __NR_madvise 219
965   GO(__NR_madvise, "3s 0m");
966   SY(__NR_madvise, x0, x0+1, x0); FAILx(ENOMEM);
967
968   // __NR_getdents64 220
969   GO(__NR_getdents64, "3s 1m");
970   SY(__NR_getdents64, x0, x0, x0+1); FAIL;
971
972   // __NR_fcntl64 221
973   // As with sys_open(), we don't trigger errors for the 1st two args for
974   // the later ones.
975   // For F_GETFD the 3rd arg is ignored.
976   GO(__NR_fcntl64, "(GETFD) 2s 0m");
977   SY(__NR_fcntl64, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
978
979   // For F_DUPFD the 3rd arg is 'arg'
980   GO(__NR_fcntl64, "(DUPFD) 1s 0m");
981   SY(__NR_fcntl64, -1, F_DUPFD, x0); FAILx(EBADF);
982
983   // For F_GETLK the 3rd arg is 'lock'.
984   // On x86, this fails w/EBADF.  But on amd64 in 32-bit mode it fails
985   // w/EFAULT.
986   GO(__NR_fcntl64, "(GETLK) 1s 0m");
987   SY(__NR_fcntl64, -1, +F_GETLK, x0); FAIL; //FAILx(EBADF);
988
989   // 222
990   GO(222, "ni");
991   SY(222); FAIL;
992
993   // 223
994   GO(223, "ni");
995   SY(223); FAIL;
996
997   // __NR_gettid 224
998   GO(__NR_gettid, "n/a");
999 //SY(__NR_gettid); // (Not yet handled by Valgrind) FAIL;
1000
1001   // __NR_readahead 225
1002   GO(__NR_readahead, "n/a");
1003 //SY(__NR_readahead); // (Not yet handled by Valgrind) FAIL;
1004
1005   // __NR_setxattr 226
1006   GO(__NR_setxattr, "5s 3m");
1007   SY(__NR_setxattr, x0, x0, x0, x0+1, x0); FAIL;
1008
1009   // __NR_lsetxattr 227
1010   GO(__NR_lsetxattr, "5s 3m");
1011   SY(__NR_lsetxattr, x0, x0, x0, x0+1, x0); FAIL;
1012
1013   // __NR_fsetxattr 228
1014   GO(__NR_fsetxattr, "5s 2m");
1015   SY(__NR_fsetxattr, x0, x0, x0, x0+1, x0); FAIL;
1016
1017   // __NR_getxattr 229
1018   GO(__NR_getxattr, "4s 3m");
1019   SY(__NR_getxattr, x0, x0, x0, x0+1); FAIL;
1020
1021   // __NR_lgetxattr 230
1022   GO(__NR_lgetxattr, "4s 3m");
1023   SY(__NR_lgetxattr, x0, x0, x0, x0+1); FAIL;
1024
1025   // __NR_fgetxattr 231
1026   GO(__NR_fgetxattr, "4s 2m");
1027   SY(__NR_fgetxattr, x0, x0, x0, x0+1); FAIL;
1028
1029   // __NR_listxattr 232
1030   GO(__NR_listxattr, "3s 2m");
1031   SY(__NR_listxattr, x0, x0, x0+1); FAIL;
1032
1033   // __NR_llistxattr 233
1034   GO(__NR_llistxattr, "3s 2m");
1035   SY(__NR_llistxattr, x0, x0, x0+1); FAIL;
1036
1037   // __NR_flistxattr 234
1038   GO(__NR_flistxattr, "3s 1m");
1039   SY(__NR_flistxattr, x0-1, x0, x0+1); FAIL; /* kernel returns EBADF, but both seem correct */
1040
1041   // __NR_removexattr 235
1042   GO(__NR_removexattr, "2s 2m");
1043   SY(__NR_removexattr, x0, x0); FAIL;
1044
1045   // __NR_lremovexattr 236
1046   GO(__NR_lremovexattr, "2s 2m");
1047   SY(__NR_lremovexattr, x0, x0); FAIL;
1048
1049   // __NR_fremovexattr 237
1050   GO(__NR_fremovexattr, "2s 1m");
1051   SY(__NR_fremovexattr, x0, x0); FAIL;
1052
1053   // __NR_tkill 238
1054   GO(__NR_tkill, "n/a");
1055 //SY(__NR_tkill); // (Not yet handled by Valgrind) FAIL;
1056
1057   // __NR_sendfile64 239
1058   GO(__NR_sendfile64, "4s 1m");
1059   SY(__NR_sendfile64, x0, x0, x0+1, x0); FAIL;
1060
1061   // __NR_futex 240
1062   #ifndef FUTEX_WAIT
1063   #define FUTEX_WAIT   0
1064   #endif
1065   // XXX: again, glibc not doing 6th arg means we have only 5s errors
1066   GO(__NR_futex, "5s 2m");
1067   SY(__NR_futex, x0+FUTEX_WAIT, x0, x0, x0+1, x0, x0); FAIL;
1068
1069   // __NR_sched_setaffinity 241
1070   GO(__NR_sched_setaffinity, "3s 1m");
1071   SY(__NR_sched_setaffinity, x0, x0+1, x0); FAIL;
1072
1073   // __NR_sched_getaffinity 242
1074   GO(__NR_sched_getaffinity, "3s 1m");
1075   SY(__NR_sched_getaffinity, x0, x0+1, x0); FAIL;
1076
1077   // __NR_set_thread_area 243
1078   GO(__NR_set_thread_area, "1s 1m");
1079   SY(__NR_set_thread_area, x0); FAILx(EFAULT);
1080
1081   // __NR_get_thread_area 244
1082   GO(__NR_get_thread_area, "1s 1m");
1083   SY(__NR_get_thread_area, x0); FAILx(EFAULT);
1084
1085   // __NR_io_setup 245
1086   GO(__NR_io_setup, "2s 1m");
1087   SY(__NR_io_setup, x0, x0); FAIL;
1088
1089   // __NR_io_destroy 246
1090   {
1091      // jump through hoops to prevent the PRE(io_destroy) wrapper crashing.
1092      struct fake_aio_ring {
1093        unsigned        id;     /* kernel internal index number */
1094        unsigned        nr;     /* number of io_events */
1095        // There are more fields in the real aio_ring, but the 'nr' field is
1096        // the only one used by the PRE() wrapper.
1097      } ring = { 0, 0 };
1098      struct fake_aio_ring* ringptr = &ring;
1099      GO(__NR_io_destroy, "1s 0m");
1100      SY(__NR_io_destroy, x0+&ringptr); FAIL;
1101   }
1102
1103   // __NR_io_getevents 247
1104   GO(__NR_io_getevents, "5s 2m");
1105   SY(__NR_io_getevents, x0, x0, x0+1, x0, x0+1); FAIL;
1106
1107   // __NR_io_submit 248
1108   GO(__NR_io_submit, "3s 1m");
1109   SY(__NR_io_submit, x0, x0+1, x0); FAIL;
1110
1111   // __NR_io_cancel 249
1112   GO(__NR_io_cancel, "3s 2m");
1113   SY(__NR_io_cancel, x0, x0, x0); FAIL;
1114
1115   // __NR_fadvise64 250
1116   GO(__NR_fadvise64, "n/a");
1117 //SY(__NR_fadvise64); // (Not yet handled by Valgrind) FAIL;
1118
1119   // 251
1120   GO(251, "ni");
1121   SY(251); FAIL;
1122
1123   // __NR_exit_group 252
1124   GO(__NR_exit_group, "other");
1125   // (see scalar_exit_group.c)
1126
1127   // __NR_lookup_dcookie 253
1128   GO(__NR_lookup_dcookie, "4s 1m");
1129   SY(__NR_lookup_dcookie, x0, x0, x0, x0+1); FAIL;
1130
1131   // __NR_epoll_create 254
1132   GO(__NR_epoll_create, "1s 0m");
1133   SY(__NR_epoll_create, x0); SUCC_OR_FAIL;
1134
1135   // __NR_epoll_ctl 255
1136   GO(__NR_epoll_ctl, "4s 1m");
1137   SY(__NR_epoll_ctl, x0, x0, x0, x0); FAIL;
1138
1139   // __NR_epoll_wait 256
1140   GO(__NR_epoll_wait, "4s 1m");
1141   SY(__NR_epoll_wait, x0, x0, x0+1, x0); FAIL;
1142
1143   // __NR_remap_file_pages 257
1144   GO(__NR_remap_file_pages, "n/a");
1145 //SY(__NR_remap_file_pages); // (Not yet handled by Valgrind) FAIL;
1146
1147   // __NR_set_tid_address 258
1148   GO(__NR_set_tid_address, "1s 0m");
1149   SY(__NR_set_tid_address, x0); SUCC_OR_FAILx(ENOSYS);
1150
1151   // __NR_timer_create 259
1152   GO(__NR_timer_create, "3s 2m");
1153   SY(__NR_timer_create, x0, x0+1, x0); FAIL;
1154
1155   // __NR_timer_settime (__NR_timer_create+1)
1156   GO(__NR_timer_settime, "4s 2m");
1157   SY(__NR_timer_settime, x0, x0, x0, x0+1); FAIL;
1158
1159   // __NR_timer_gettime (__NR_timer_create+2)
1160   GO(__NR_timer_gettime, "2s 1m");
1161   SY(__NR_timer_gettime, x0, x0); FAIL;
1162
1163   // __NR_timer_getoverrun (__NR_timer_create+3)
1164   GO(__NR_timer_getoverrun, "1s 0m");
1165   SY(__NR_timer_getoverrun, x0); FAIL;
1166
1167   // __NR_timer_delete (__NR_timer_create+4)
1168   GO(__NR_timer_delete, "1s 0m");
1169   SY(__NR_timer_delete, x0); FAIL;
1170
1171   // __NR_clock_settime (__NR_timer_create+5)
1172   GO(__NR_clock_settime, "2s 1m");
1173   SY(__NR_clock_settime, x0, x0);  FAIL; FAIL;
1174
1175   // __NR_clock_gettime (__NR_timer_create+6)
1176   GO(__NR_clock_gettime, "2s 1m");
1177   SY(__NR_clock_gettime, x0, x0); FAIL;
1178
1179   // __NR_clock_getres (__NR_timer_create+7)
1180   GO(__NR_clock_getres, "2s 1m");
1181   SY(__NR_clock_getres, x0+1, x0+1); FAIL; FAIL;
1182
1183   // __NR_clock_nanosleep (__NR_timer_create+8)
1184   GO(__NR_clock_nanosleep, "n/a");
1185 //SY(__NR_clock_nanosleep); // (Not yet handled by Valgrind) FAIL;
1186
1187   // __NR_statfs64 268
1188   GO(__NR_statfs64, "3s 2m");
1189   SY(__NR_statfs64, x0, x0+1, x0); FAIL;
1190
1191   // __NR_fstatfs64 269
1192   GO(__NR_fstatfs64, "3s 1m");
1193   SY(__NR_fstatfs64, x0, x0+1, x0); FAIL;
1194
1195   // __NR_tgkill 270
1196   GO(__NR_tgkill, "n/a");
1197 //SY(__NR_tgkill); // (Not yet handled by Valgrind) FAIL;
1198
1199   // __NR_utimes 271
1200   GO(__NR_utimes, "2s 2m");
1201   SY(__NR_utimes, x0, x0+1); FAIL;
1202
1203   // __NR_fadvise64_64 272
1204   GO(__NR_fadvise64_64, "n/a");
1205 //SY(__NR_fadvise64_64); // (Not yet handled by Valgrind) FAIL;
1206
1207   // __NR_vserver 273
1208   GO(__NR_vserver, "ni");
1209   SY(__NR_vserver); FAIL;
1210
1211   // __NR_mbind 274
1212   GO(__NR_mbind, "n/a");
1213 //SY(__NR_mbind); // (Not yet handled by Valgrind) FAIL;
1214
1215   // __NR_get_mempolicy 275
1216   GO(__NR_get_mempolicy, "n/a");
1217 //SY(__NR_get_mempolicy); // (Not yet handled by Valgrind) FAIL;
1218
1219   // __NR_set_mempolicy 276
1220   GO(__NR_set_mempolicy, "n/a");
1221 //SY(__NR_set_mempolicy); // (Not yet handled by Valgrind) FAIL;
1222
1223   // __NR_mq_open 277
1224   GO(__NR_mq_open, "4s 3m");
1225   SY(__NR_mq_open, x0, x0+O_CREAT, x0, x0+1); FAIL;
1226
1227   // __NR_mq_unlink (__NR_mq_open+1)
1228   GO(__NR_mq_unlink, "1s 1m");
1229   SY(__NR_mq_unlink, x0); FAIL;
1230
1231   // __NR_mq_timedsend (__NR_mq_open+2)
1232   GO(__NR_mq_timedsend, "5s 2m");
1233   SY(__NR_mq_timedsend, x0, x0, x0+1, x0, x0+1); FAIL;
1234
1235   // __NR_mq_timedreceive (__NR_mq_open+3)
1236   GO(__NR_mq_timedreceive, "5s 3m");
1237   SY(__NR_mq_timedreceive, x0, x0, x0+1, x0+1, x0+1); FAIL;
1238
1239   // __NR_mq_notify (__NR_mq_open+4)
1240   GO(__NR_mq_notify, "2s 1m");
1241   SY(__NR_mq_notify, x0, x0+1); FAIL;
1242
1243   // __NR_mq_getsetattr (__NR_mq_open+5)
1244   GO(__NR_mq_getsetattr, "3s 2m");
1245   SY(__NR_mq_getsetattr, x0, x0+1, x0+1); FAIL;
1246
1247   // __NR_sys_kexec_load 283
1248   GO(__NR_sys_kexec_load, "ni");
1249   SY(__NR_sys_kexec_load); FAIL;
1250
1251   // no such syscall...
1252   GO(9999, "1e");
1253   SY(9999); FAIL;
1254
1255   // __NR_exit 1
1256   GO(__NR_exit, "1s 0m");
1257   SY(__NR_exit, x0); FAIL;
1258
1259   assert(0);
1260}
1261
1262