scalar.c revision 199c15bc1bdc8599254aa128276e5ed89f9f8854
11235becaa1cf7e29f580900592563c3329d326deJerome Glisse#define _GNU_SOURCE
21235becaa1cf7e29f580900592563c3329d326deJerome Glisse
31235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include "../../memcheck.h"
41235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include "scalar.h"
51235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include <unistd.h>
61235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include <sched.h>
71235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include <signal.h>
81235becaa1cf7e29f580900592563c3329d326deJerome Glisse#include <linux/mman.h> // MREMAP_FIXED
91235becaa1cf7e29f580900592563c3329d326deJerome Glisse
101235becaa1cf7e29f580900592563c3329d326deJerome Glisse// Here we are trying to trigger every syscall error (scalar errors and
111235becaa1cf7e29f580900592563c3329d326deJerome Glisse// memory errors) for every syscall.  We do this by passing a lot of bogus
121235becaa1cf7e29f580900592563c3329d326deJerome Glisse// arguments, mostly 0 and 1 (often it's 1 because NULL ptr args often aren't
131235becaa1cf7e29f580900592563c3329d326deJerome Glisse// checked for memory errors, or in order to have a non-zero length used
141235becaa1cf7e29f580900592563c3329d326deJerome Glisse// with some buffer).  So most of the syscalls don't actually succeed and do
151235becaa1cf7e29f580900592563c3329d326deJerome Glisse// anything.
161235becaa1cf7e29f580900592563c3329d326deJerome Glisse//
171235becaa1cf7e29f580900592563c3329d326deJerome Glisse// Occasionally we have to be careful not to cause Valgrind to seg fault in
181235becaa1cf7e29f580900592563c3329d326deJerome Glisse// its pre-syscall wrappers;  it does so because it can't know in general
191235becaa1cf7e29f580900592563c3329d326deJerome Glisse// when memory is unaddressable, and so tries to dereference it when doing
201235becaa1cf7e29f580900592563c3329d326deJerome Glisse// PRE_MEM_READ/PRE_MEM_WRITE calls.  (Note that Memcheck will
211235becaa1cf7e29f580900592563c3329d326deJerome Glisse// always issue an error message immediately before these seg faults occur).
221235becaa1cf7e29f580900592563c3329d326deJerome Glisse//
23330b6c85c961b32f704ce8ec7dbf8cb7fc0b80a8Marek Olšák// The output has numbers like "3s 2m" for each syscall.  "s" is short for
24330b6c85c961b32f704ce8ec7dbf8cb7fc0b80a8Marek Olšák// "scalar", ie. the argument itself is undefined.  "m" is short for "memory",
25330b6c85c961b32f704ce8ec7dbf8cb7fc0b80a8Marek Olšák// ie. the argument points to memory which is unaddressable.
261235becaa1cf7e29f580900592563c3329d326deJerome Glisse
27330b6c85c961b32f704ce8ec7dbf8cb7fc0b80a8Marek Olšákint main(void)
288fb7f1a8a4cbab5365491b4b41e50ff3f03306c8Kai Wasserbäch{
298fb7f1a8a4cbab5365491b4b41e50ff3f03306c8Kai Wasserbäch   // uninitialised, but we know px[0] is 0x0
30f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   long* px  = malloc(sizeof(long));
31428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   long  x0  = px[0];
328fb7f1a8a4cbab5365491b4b41e50ff3f03306c8Kai Wasserbäch   long  res;
338fb7f1a8a4cbab5365491b4b41e50ff3f03306c8Kai Wasserbäch
34948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // All __NR_xxx numbers are taken from x86
351235becaa1cf7e29f580900592563c3329d326deJerome Glisse
361235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_restart_syscall 0  // XXX: not yet handled, perhaps should be...
371235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_restart_syscall, "n/a");
381235becaa1cf7e29f580900592563c3329d326deJerome Glisse //SY(__NR_restart_syscall); // (Not yet handled by Valgrind) FAIL;
39e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák
40948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_exit 1
41e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   GO(__NR_exit, "below");
42948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // (see below)
43948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
447dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_fork 2
457dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_fork, "other");
467dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // (sse scalar_fork.c)
47948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
487dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_read 3
497dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // Nb: here we are also getting an error from the syscall arg itself.
506101b6d442b06a347c001fe85848d636ab7df260Marek Olšák   GO(__NR_read, "1+3s 1m");
517dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_read+x0, x0, x0, x0+1); FAILx(EFAULT);
52948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
537dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_write 4
54948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_write, "3s 1m");
550a6120244e66494db070ce875c0a464fbc5b15a1Marek Olšák   SY(__NR_write, x0, x0, x0+1); FAIL;
56e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák
577dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_open 5
58948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_open, "(2-args) 2s 1m");
59948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_open, x0, x0); FAIL;
607dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
61948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // Only 1s 0m errors -- the other 2s 1m have been checked in the previous
62948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // open test, and if we test them they may be commoned up but they also
63948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // may not.
647dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_open, "(3-args) 1s 0m");
657dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_open, "scalar.c", O_CREAT|O_EXCL, x0); FAIL;
66948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
67948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_close 6
68948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_close, "1s 0m");
69948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_close, x0-1); FAIL;
70948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
71948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_waitpid 7
72948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_waitpid, "3s 1m");
73948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_waitpid, x0, x0+1, x0); FAIL;
74948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
75948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_creat 8
76948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_creat, "2s 1m");
77948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_creat, x0, x0); FAIL;
787dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
79948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_link 9
807dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_link, "2s 2m");
81948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_link, x0, x0); FAIL;
82948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
837dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_unlink 10
84948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_unlink, "1s 1m");
85948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_unlink, x0); FAIL;
86948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
87948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_execve 11
88948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // Nb: could have 3 memory errors if we pass x0+1 as the 2nd and 3rd
897dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // args, except for bug #93174.
90948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_execve, "3s 1m");
917dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_execve, x0, x0, x0); FAIL;
92948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
937dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_chdir 12
94948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_chdir, "1s 1m");
95948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_chdir, x0); FAIL;
96948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
97948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_time 13
98948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_time, "1s 1m");
99948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_time, x0+1); FAIL;
100948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
101948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_mknod 14
1027dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_mknod, "3s 1m");
103e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   SY(__NR_mknod, x0, x0, x0); FAIL;
1048cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth
1058cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_chmod 15
1068cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   GO(__NR_chmod, "2s 1m");
1078cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   SY(__NR_chmod, x0, x0); FAIL;
1088cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth
1098cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_lchown 16
1108cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   GO(__NR_lchown, "n/a");
1118cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth //SY(__NR_lchown); // (Not yet handled by Valgrind) FAIL;
1127dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
1137dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_break 17
114948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_break, "ni");
115948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_break); FAIL;
116948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
117e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   // __NR_oldstat 18
118c79e9f0ed59d561849a0a4fbaafe87d5064d3e8cMarek Olšák   GO(__NR_oldstat, "n/a");
119c79e9f0ed59d561849a0a4fbaafe87d5064d3e8cMarek Olšák   // (obsolete, not handled by Valgrind)
1201235becaa1cf7e29f580900592563c3329d326deJerome Glisse
121e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   // __NR_lseek 19
122948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_lseek, "3s 0m");
123578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   SY(__NR_lseek, x0-1, x0, x0); FAILx(EBADF);
124578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák
125948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_getpid 20
126948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_getpid, "0s 0m");
127948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_getpid); SUCC;
128948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
129578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   // __NR_mount 21
130578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   GO(__NR_mount, "5s 3m");
131578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   SY(__NR_mount, x0, x0, x0, x0, x0); FAIL;
132578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák
133578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   // __NR_umount 22
134578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   GO(__NR_umount, "1s 1m");
135578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   SY(__NR_umount, x0); FAIL;
136e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák
137578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   // __NR_setuid 23
138578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   GO(__NR_setuid, "1s 0m");
139578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   SY(__NR_setuid, x0); FAIL;
140578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák
141578b211be6a1466eea00fc4a8fc5d4efa4bfd62cMarek Olšák   // __NR_getuid 24
142e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   GO(__NR_getuid, "0s 0m");
143e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   SY(__NR_getuid); SUCC;
144e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák
145e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   // __NR_stime 25
146e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   GO(__NR_stime, "n/a");
147e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák //SY(__NR_stime); // (Not yet handled by Valgrind) FAIL;
148e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák
149e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   // __NR_ptrace 26
150e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   // XXX: memory pointed to be arg3 goes unchecked... otherwise would be 2m
151e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   GO(__NR_ptrace, "4s 1m");
152e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   SY(__NR_ptrace, x0+PTRACE_GETREGS, x0, x0, x0); FAIL;
1531235becaa1cf7e29f580900592563c3329d326deJerome Glisse
1541235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_alarm 27
1551235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_alarm, "1s 0m");
1561235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_alarm, x0); SUCC;
157e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák
1581235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_oldfstat 28
15978354011f99c4103345f8f32e10b0b4b884ebdafMarek Olšák   GO(__NR_oldfstat, "n/a");
16078354011f99c4103345f8f32e10b0b4b884ebdafMarek Olšák   // (obsolete, not handled by Valgrind)
16178354011f99c4103345f8f32e10b0b4b884ebdafMarek Olšák
1628d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   // __NR_pause 29
1638d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   GO(__NR_pause, "ignore");
1648d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   // (hard to test, and no args so not much to be gained -- don't bother)
165f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák
166f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   // __NR_utime 30
167f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   GO(__NR_utime, "2s 2m");
1686a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   SY(__NR_utime, x0, x0+1); FAIL;
1696a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák
1706a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   // __NR_stty 31
1710f86915c5322b096b7154b6c84e21288074b775dMarek Olšák   GO(__NR_stty, "ni");
1720f86915c5322b096b7154b6c84e21288074b775dMarek Olšák   SY(__NR_stty); FAIL;
1730f86915c5322b096b7154b6c84e21288074b775dMarek Olšák
174a3d9d7ec79d6f7205fab2324e47d8ea185431de0Marek Olšák   // __NR_gtty 32
175a3d9d7ec79d6f7205fab2324e47d8ea185431de0Marek Olšák   GO(__NR_gtty, "ni");
176a3d9d7ec79d6f7205fab2324e47d8ea185431de0Marek Olšák   SY(__NR_gtty); FAIL;
17709eff39a58885bb3b8507d02920b53b4e81a66eaHenri Verbeet
178ecb1b8b98f7b2464e29e56a1f1bf87f74129ac08Tilman Sauerbeck   // __NR_access 33
179e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   GO(__NR_access, "2s 1m");
18001b39b053b0cb6c7493b560b26734f3c4fa52efaJosé Fonseca   SY(__NR_access, x0, x0); FAIL;
1816a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák
1826a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   // __NR_nice 34
1836a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   GO(__NR_nice, "1s 0m");
1841235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_nice, x0); SUCC;
1851235becaa1cf7e29f580900592563c3329d326deJerome Glisse
1861235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_ftime 35
1871235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_ftime, "ni");
188428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   SY(__NR_ftime); FAIL;
189428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák
190428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   // __NR_sync 36
191f0b202ec73855bd9e1b29909c8ac90393043cb8bMarek Olšák   GO(__NR_sync, "0s 0m");
1921235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_sync); SUCC;
193e363dd5c7d8ba40984d937ad7487abbb5be439bcMarek Olšák
1949670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   // __NR_kill 37
1956a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   GO(__NR_kill, "2s 0m");
1966a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   SY(__NR_kill, x0, x0); SUCC;
1976a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák
1989670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   // __NR_rename 38
1999670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   GO(__NR_rename, "2s 2m");
2001235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_rename, x0, x0); FAIL;
2011235becaa1cf7e29f580900592563c3329d326deJerome Glisse
2021235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_mkdir 39
203dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie   GO(__NR_mkdir, "2s 1m");
2041235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_mkdir, x0, x0); FAIL;
205e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák
2061235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_rmdir 40
2078d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   GO(__NR_rmdir, "1s 1m");
2081235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_rmdir, x0); FAIL;
2091235becaa1cf7e29f580900592563c3329d326deJerome Glisse
2101235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_dup 41
211f0b202ec73855bd9e1b29909c8ac90393043cb8bMarek Olšák   GO(__NR_dup, "1s 0m");
2126a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   SY(__NR_dup, x0-1); FAIL;
21399c65bac341f808279a8a847158ace4f058aa72eMarek Olšák
2146a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   // __NR_pipe 42
2156a94c9dde0d62b5ccfcbe3dbafdadeab37fd48a6Marek Olšák   GO(__NR_pipe, "1s 1m");
2161235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_pipe, x0); FAIL;
2171235becaa1cf7e29f580900592563c3329d326deJerome Glisse
2181235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_times 43
219e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   GO(__NR_times, "1s 1m");
2201235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_times, x0+1); FAIL;
2211235becaa1cf7e29f580900592563c3329d326deJerome Glisse
2221235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_prof 44
2236101b6d442b06a347c001fe85848d636ab7df260Marek Olšák   GO(__NR_prof, "ni");
224518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_prof); FAIL;
225518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
2261235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_brk 45
227e2809849ecac69615ece294a55ee355afaac33d3Marek Olšák   GO(__NR_brk, "1s 0m");
22809ec30f02830b3cbf9d6ac04d9497634dca86846Marek Olšák   SY(__NR_brk, x0); SUCC;
22909ec30f02830b3cbf9d6ac04d9497634dca86846Marek Olšák
2309670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   // __NR_setgid 46
2319670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   GO(__NR_setgid, "1s 0m");
2329670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák   SY(__NR_setgid, x0); FAIL;
2339670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák
23404d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   // __NR_getgid 47
23504d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   GO(__NR_getgid, "0s 0m");
236e2809849ecac69615ece294a55ee355afaac33d3Marek Olšák   SY(__NR_getgid); SUCC;
237dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie
2386abd7771c6ab2c733b20835e211060dd18fd847dJerome Glisse   // __NR_signal 48
239dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie   GO(__NR_signal, "n/a");
2404c7001462607e6e99e474d6271dd481d3f8f201cRoland Scheidegger //SY(__NR_signal); // (Not yet handled by Valgrind) FAIL;
2412d7738eb2bee41656953d1173926f546c6711badMarek Olšák
242ea78480029450c019287c2a94d7c42a6a1d12dc3Christian König   // __NR_geteuid 49
243ea78480029450c019287c2a94d7c42a6a1d12dc3Christian König   GO(__NR_geteuid, "0s 0m");
2444e837f557bf5f5afb286e1f2244ed69c0092c2d6Christian König   SY(__NR_geteuid); SUCC;
2451235becaa1cf7e29f580900592563c3329d326deJerome Glisse
2460813e58a3e41faf6f2072d034dfdc6198a3a1feeMarek Olšák   // __NR_getegid 50
2470813e58a3e41faf6f2072d034dfdc6198a3a1feeMarek Olšák   GO(__NR_getegid, "0s 0m");
248b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet   SY(__NR_getegid); SUCC;
249b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet
250b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet   // __NR_acct 51
251dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie   GO(__NR_acct, "1s 1m");
252f126253040654d52db134063a69ebaf0c417d410Marek Olšák   SY(__NR_acct, x0); FAIL;
25304d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák
25404d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   // __NR_umount2 52
255b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet   GO(__NR_umount2, "2s 1m");
25678354011f99c4103345f8f32e10b0b4b884ebdafMarek Olšák   SY(__NR_umount2, x0, x0); FAIL;
25778354011f99c4103345f8f32e10b0b4b884ebdafMarek Olšák
2588698a3b85dd89c5d2fa473e7942b7dc8d25f3c8fMarek Olšák   // __NR_lock 53
259bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   GO(__NR_lock, "ni");
260bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   SY(__NR_lock); FAIL;
261bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák
262bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   // __NR_ioctl 54
263bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   #include <asm/ioctls.h>
2641235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_ioctl, "3s 1m");
265b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet   SY(__NR_ioctl, x0, x0+TCSETS, x0); FAIL;
266b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet
267dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie   // __NR_fcntl 55
268f126253040654d52db134063a69ebaf0c417d410Marek Olšák   // As with sys_open(), the 'fd' error is suppressed for the later ones.
2695016fe2d47a08ce2cd7c597e67862086e7d63b64Tom Stellard   // For F_GETFD the 3rd arg is ignored
27004d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   GO(__NR_fcntl, "(GETFD) 2s 0m");
27104d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   SY(__NR_fcntl, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
272b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet
2730f86915c5322b096b7154b6c84e21288074b775dMarek Olšák   // For F_DUPFD the 3rd arg is 'arg'.  We don't check the 1st two args
274a3d9d7ec79d6f7205fab2324e47d8ea185431de0Marek Olšák   // because any errors may or may not be commoned up with the ones from
275bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   // the previous fcntl call.
276bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   GO(__NR_fcntl, "(DUPFD) 1s 0m");
277bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   SY(__NR_fcntl, -1, F_DUPFD, x0); FAILx(EBADF);
278bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák
279bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   // For F_GETLK the 3rd arg is 'lock'.  On x86, this fails w/EBADF.  But
280bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   // on amd64 in 32-bit mode it fails w/EFAULT.  We don't check the 1st two
281bc95152f1d3bf0dbf79d81e6b9956fd60198e3dfMarek Olšák   // args for the reason given above.
2821235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_fcntl, "(GETLK) 1s 0m");
2831235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_fcntl, -1, F_GETLK, x0); FAIL; //FAILx(EBADF);
284b3b946b0ab88c1d7edeab183d8ad5125ba223392Henri Verbeet
28504d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   // __NR_mpx 56
2861235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_mpx, "ni");
2871235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_mpx); FAIL;
2889670e72f6ef85f0e6f6c9afe136dc67c017e3faeMarek Olšák
289e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   // __NR_setpgid 57
290e363dd5c7d8ba40984d937ad7487abbb5be439bcMarek Olšák   GO(__NR_setpgid, "2s 0m");
291e2e1dc9e66ff348caa97b7b35e558d75c6cc6899Marek Olšák   SY(__NR_setpgid, x0, x0-1); FAIL;
292428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák
293428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   // __NR_ulimit 58
294428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   GO(__NR_ulimit, "ni");
295428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   SY(__NR_ulimit); FAIL;
296428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák
297428855eea3e99d94474df6df0cb8dfc4a8819702Marek Olšák   // __NR_oldolduname 59
2981235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_oldolduname, "n/a");
29904d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   // (obsolete, not handled by Valgrind)
30004d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák
301187d7fb2fec7da889f25366696faaac4c2e8f9c4Marek Olšák   // __NR_umask 60
302d59498b78041b8a7a046ac2c892e7a1896f59ca2Dave Airlie   GO(__NR_umask, "1s 0m");
303e4340c1908a6a3b09e1a15d5195f6da7d00494d0Marek Olšák   SY(__NR_umask, x0+022); SUCC;
304bbad5103e61806ef6d6a0d5e53abc4b9e77a7fe9Marek Olšák
305aacd653834264b70a2537aff7914762b39f0683fMarek Olšák   // __NR_chroot 61
306aacd653834264b70a2537aff7914762b39f0683fMarek Olšák   GO(__NR_chroot, "1s 1m");
307aacd653834264b70a2537aff7914762b39f0683fMarek Olšák   SY(__NR_chroot, x0); FAIL;
308f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák
309f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   // __NR_ustat 62
310f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   GO(__NR_ustat, "n/a");
311f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   // (deprecated, not handled by Valgrind)
312f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák
313f71f5edf78572ae87b9efb897df49efab1a53558Marek Olšák   // __NR_dup2 63
3148d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   GO(__NR_dup2, "2s 0m");
3158d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin   SY(__NR_dup2, x0-1, x0); FAIL;
3168d1a9a984f33d8e45f932a9f47cdd57da617a919Vadim Girlin
3171235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_getppid 64
31804d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   GO(__NR_getppid, "0s 0m");
31904d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   SY(__NR_getppid); SUCC;
32004d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák
32104d2828b03a75963a469f2fb008c3595948cfcfcMarek Olšák   // __NR_getpgrp 65
3221235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_getpgrp, "0s 0m");
3231235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_getpgrp); SUCC;
3241235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3251235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_setsid 66
3261235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_setsid, "0s 0m");
3271235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_setsid); SUCC_OR_FAIL;
3281235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3291235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_sigaction 67
3301235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_sigaction, "3s 4m");
3311235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_sigaction, x0, x0+&px[1], x0+&px[1]); FAIL;
3324378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie
3334378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie   // __NR_sgetmask 68 sys_sgetmask()
3344378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie   GO(__NR_sgetmask, "n/a");
3359f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet //SY(__NR_sgetmask); // (Not yet handled by Valgrind) FAIL;
3369f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet
3379f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   // __NR_ssetmask 69
3389f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   GO(__NR_ssetmask, "n/a");
3399f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet //SY(__NR_ssetmask); // (Not yet handled by Valgrind) FAIL;
3409f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet
3419f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   // __NR_setreuid 70
3429f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   GO(__NR_setreuid, "2s 0m");
3439f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   SY(__NR_setreuid, x0, x0); FAIL;
3449f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet
3459f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   // __NR_setregid 71
3469f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   GO(__NR_setregid, "2s 0m");
3479f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   SY(__NR_setregid, x0, x0); FAIL;
3489f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet
3499f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   // __NR_sigsuspend 72
3509f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   // XXX: how do you use this function?
3519f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet   GO(__NR_sigsuspend, "ignore");
3520e4c5f63b9023b292b88b2f0d5d0f6154e8ad263Alex Deucher   // (I don't know how to test this...)
353414cd5df50435f475d92b02c229453d037369c0fAlex Deucher
354414cd5df50435f475d92b02c229453d037369c0fAlex Deucher   // __NR_sigpending 73
355f54366bcf61a414885abb9f7f47e897598a80859Alex Deucher   GO(__NR_sigpending, "1s 1m");
356f54366bcf61a414885abb9f7f47e897598a80859Alex Deucher   SY(__NR_sigpending, x0); FAIL;
357f54366bcf61a414885abb9f7f47e897598a80859Alex Deucher
3587779f6d1dffde2c0501e44adc342e52803de08d4Dave Airlie   // __NR_sethostname 74
359b4082f492b4b55df4c636445e47b97d1f1e4b5b2Alex Deucher   GO(__NR_sethostname, "n/a");
3609f064116458ff68b92f179a19be4615f003eaa3eHenri Verbeet //SY(__NR_sethostname); // (Not yet handled by Valgrind) FAIL;
3614378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie
3624378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie   // __NR_setrlimit 75
3634378c17c88c6d1fb046f53ef83955fd7fbd992dbDave Airlie   GO(__NR_setrlimit, "2s 1m");
3641235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_setrlimit, x0, x0); FAIL;
3651235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3661235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_getrlimit 76
3671235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_getrlimit, "2s 1m");
368518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_getrlimit, x0, x0); FAIL;
3691235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3701235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_getrusage 77
3711235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_getrusage, "2s 1m");
3721235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_getrusage, x0, x0); FAIL;
373fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher
374518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_gettimeofday 78
375fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   GO(__NR_gettimeofday, "2s 2m");
3761235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_gettimeofday, x0+1, x0+1); FAIL;
3771235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3781235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_settimeofday 79
3791235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_settimeofday, "2s 2m");
3801235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_settimeofday, x0+1, x0+1); FAIL;
3811235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3821235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_getgroups 80
3831235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_getgroups, "2s 1m");
3841235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_getgroups, x0+1, x0+1); FAIL;
3851235becaa1cf7e29f580900592563c3329d326deJerome Glisse
3861235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_setgroups 81
3871235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_setgroups, "2s 1m");
388dc4c821f0817a3db716f965692fb701079f66340Marek Olšák   SY(__NR_setgroups, x0+1, x0+1); FAIL;
38939d1feb51e9dac794751e72f48faf26409a84b1cDave Airlie
39095c7881ac8240fa369e33db411bbd165d0f61948Marek Olšák   // __NR_select 82
3914a7f013f9db793dab8dbc9f71646dab49f12ed2fMarek Olšák   {
39293754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák      long args[5] = { x0+8, x0+0xffffffee, x0+1, x0+1, x0+1 };
39393754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák      GO(__NR_select, "1s 5m");
39413c9a8552bc83b1ad91442caacf847cb6cead2b5Dave Airlie      SY(__NR_select, args+x0); FAIL;
395badf0335ef70223204fbae3e8fdef718cdb3ad19Marek Olšák   }
39601680ce2f350f44073e8f1adf3b36d48424d21faMarek Olšák
3973d13b081c72626acba6b9a25baec740c60dfafe1Marek Olšák   // __NR_symlink 83
398ba89086e79b22bd9578ea642846108de624c91e9Marek Olšák   GO(__NR_symlink, "2s 2m");
399bc1c8369384b5e16547c5bf9728aa78f8dfd66ccMarek Olšák   SY(__NR_symlink, x0, x0); FAIL;
400b0b81218132b6952de987dca21b9750d8d51b7f0Marek Olšák
4017f1cbf12bc883090734983bdd98e5158b9a194a0Marek Olšák   // __NR_oldlstat 84
4027fe3631a7a0ad7602b4e947ac87ef86875c8bb3fMarek Olšák   GO(__NR_oldlstat, "n/a");
4037fe3631a7a0ad7602b4e947ac87ef86875c8bb3fMarek Olšák   // (obsolete, not handled by Valgrind)
4047fe3631a7a0ad7602b4e947ac87ef86875c8bb3fMarek Olšák
405437ab1d6df7282770ee869180446db36c2dbdfa8Marek Olšák   // __NR_readlink 85
406437ab1d6df7282770ee869180446db36c2dbdfa8Marek Olšák   GO(__NR_readlink, "3s 2m");
4076a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_readlink, x0+1, x0+1, x0+1); FAIL;
408af372129e5c1722a3d53dd1fc2f3409207c12f7eFredrik Höglund
4099d699cd845f3544fa6e149fa4ffb1d131d32b482Marek Olšák   // __NR_uselib 86
4101235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_uselib, "n/a");
41193754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák //SY(__NR_uselib); // (Not yet handled by Valgrind) FAIL;
4121b749dc34f8d83cf3dfa863279b1fe2b356d34b2Marek Olšák
4131b749dc34f8d83cf3dfa863279b1fe2b356d34b2Marek Olšák   // __NR_swapon 87
4141b749dc34f8d83cf3dfa863279b1fe2b356d34b2Marek Olšák   GO(__NR_swapon, "n/a");
415171be755223d99f8cc5cc1bdaf8bd7b4caa04b4fMarek Olšák //SY(__NR_swapon); // (Not yet handled by Valgrind) FAIL;
41615ca9d159e50815b0bfe60df8873f48c32a59ca5Marek Olšák
417171be755223d99f8cc5cc1bdaf8bd7b4caa04b4fMarek Olšák   // __NR_reboot 88
41893754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák   GO(__NR_reboot, "n/a");
419d6fea4a9856598961dd0f69436df749e5aa8d077Alex Deucher //SY(__NR_reboot); // (Not yet handled by Valgrind) FAIL;
420de48199693484fc903627ce53b007901af2e37a8Dave Airlie
421d6fea4a9856598961dd0f69436df749e5aa8d077Alex Deucher   // __NR_readdir 89
42293754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák   GO(__NR_readdir, "n/a");
4231235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // (superseded, not handled by Valgrind)
424d931b0d8b360fc0222d295eca38aaee3e4e5d0beMarek Olšák
425d931b0d8b360fc0222d295eca38aaee3e4e5d0beMarek Olšák   // __NR_mmap 90
426d931b0d8b360fc0222d295eca38aaee3e4e5d0beMarek Olšák   {
427fc8e30edbcc802aac61a3562a3be42bb18b5dcd5Marek Olšák      long args[6] = { x0, x0, x0, x0, x0-1, x0 };
42893754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák      GO(__NR_mmap, "1s 1m");
42993754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák      SY(__NR_mmap, args+x0); FAIL;
43093754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák   }
431034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák
432a3bfbccd0a97ccaa9d07317d9681a350d02ee456Marek Olšák   // __NR_munmap 91
433a3bfbccd0a97ccaa9d07317d9681a350d02ee456Marek Olšák   GO(__NR_munmap, "2s 0m");
434bc1c8369384b5e16547c5bf9728aa78f8dfd66ccMarek Olšák   SY(__NR_munmap, x0, x0); FAIL;
435bc1c8369384b5e16547c5bf9728aa78f8dfd66ccMarek Olšák
4367fe3631a7a0ad7602b4e947ac87ef86875c8bb3fMarek Olšák   // __NR_truncate 92
43793754d8499934a4c38e9a934d0a934c1484b707cMarek Olšák   GO(__NR_truncate, "2s 1m");
4381235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_truncate, x0, x0); FAIL;
439543b2331d7b45a29ccd3530daa2389e87e65d89bMarek Olšák
440543b2331d7b45a29ccd3530daa2389e87e65d89bMarek Olšák   // __NR_ftruncate 93
4416e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   GO(__NR_ftruncate, "2s 0m");
44215146fd1bcbb08e44a1cbb984440ee1a5de63d48Marek Olšák   SY(__NR_ftruncate, x0, x0); FAIL;
4436e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák
444543b2331d7b45a29ccd3530daa2389e87e65d89bMarek Olšák   // __NR_fchmod 94
445543b2331d7b45a29ccd3530daa2389e87e65d89bMarek Olšák   GO(__NR_fchmod, "2s 0m");
446b55c98ea4124f63a6a4b5ecf349ae80404449695Marek Olšák   SY(__NR_fchmod, x0-1, x0); FAIL;
447543b2331d7b45a29ccd3530daa2389e87e65d89bMarek Olšák
4481235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_fchown 95
4491235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_fchown, "3s 0m");
4501235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_fchown, x0, x0, x0); FAIL;
4511235becaa1cf7e29f580900592563c3329d326deJerome Glisse
452fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   // __NR_getpriority 96
453fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   GO(__NR_getpriority, "2s 0m");
454fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   SY(__NR_getpriority, x0-1, x0); FAIL;
455fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher
456b37931f69b7885ec9cdcaea8aec10db777d7e60aMarek Olšák   // __NR_setpriority 97
4571a532ca79a4a87bb86c641a6ca22da0301dc1f62Marek Olšák   GO(__NR_setpriority, "3s 0m");
458b37931f69b7885ec9cdcaea8aec10db777d7e60aMarek Olšák   SY(__NR_setpriority, x0-1, x0, x0); FAIL;
459320adb93a137a733da4b44f41e2d8ba01f164568Marek Olšák
460320adb93a137a733da4b44f41e2d8ba01f164568Marek Olšák   // __NR_profil 98
4611235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_profil, "ni");
4621235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_profil); FAIL;
4631235becaa1cf7e29f580900592563c3329d326deJerome Glisse
464370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák   // __NR_statfs 99
4651235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_statfs, "2s 2m");
4661235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_statfs, x0, x0); FAIL;
46790c2fd86407999475ff6accecf36e5a2c75feb9bMathias Fröhlich
46890c2fd86407999475ff6accecf36e5a2c75feb9bMathias Fröhlich   // __NR_fstatfs 100
4691a532ca79a4a87bb86c641a6ca22da0301dc1f62Marek Olšák   GO(__NR_fstatfs, "2s 1m");
47044f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   SY(__NR_fstatfs, x0, x0); FAIL;
47144f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák
47244f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   // __NR_ioperm 101
47390c2fd86407999475ff6accecf36e5a2c75feb9bMathias Fröhlich   GO(__NR_ioperm, "3s 0m");
4740b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   SY(__NR_ioperm, x0, x0, x0); FAIL;
4750b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie
4760b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   // __NR_socketcall 102
4770b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   GO(__NR_socketcall, "XXX");
4780b666106c5f75b581ef1ebeb354c29a00400404fDave Airlie   // (XXX: need to do all sub-cases properly)
4791235becaa1cf7e29f580900592563c3329d326deJerome Glisse
4804ac250c9d594898ad02323dbf02aab8792366d11Marek Olšák   // __NR_syslog 103
4811235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_syslog, "3s 1m");
4821235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_syslog, x0+2, x0, x0+1); FAIL;
483bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák
484bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   // __NR_setitimer 104
4851235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_setitimer, "3s 2m");
486fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   SY(__NR_setitimer, x0, x0+1, x0+1); FAIL;
487518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
488fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   // __NR_getitimer 105
4891235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_getitimer, "2s 1m");
490bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   SY(__NR_getitimer, x0, x0, x0); FAIL;
491bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák
492bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   // __NR_stat 106
493bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   GO(__NR_stat, "2s 2m");
494fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   SY(__NR_stat, x0, x0); FAIL;
495fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher
496fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   // __NR_lstat 107
497fae7cb8ed83d43b28a7837acdb4912714a955217Alex Deucher   GO(__NR_lstat, "2s 2m");
498bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   SY(__NR_lstat, x0, x0); FAIL;
4991235becaa1cf7e29f580900592563c3329d326deJerome Glisse
500bb71f9249a66b9a4921a878766c0a2d87624c369Marek Olšák   // __NR_fstat 108
5011235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_fstat, "2s 1m");
502034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák   SY(__NR_fstat, x0, x0); FAIL;
503034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák
504034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák   // __NR_olduname 109
505034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák   GO(__NR_olduname, "n/a");
506034e63b9f8ee23cfac769b1a2c431bdd2307a6c4Marek Olšák   // (obsolete, not handled by Valgrind)
5071235becaa1cf7e29f580900592563c3329d326deJerome Glisse
5084ac250c9d594898ad02323dbf02aab8792366d11Marek Olšák   // __NR_iopl 110
5091235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_iopl, "1s 0m");
5101235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_iopl, x0+100); FAIL;
5111235becaa1cf7e29f580900592563c3329d326deJerome Glisse
5121235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_vhangup 111
5131235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_vhangup, "0s 0m");
5141235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_vhangup); SUCC_OR_FAIL;  // Will succeed for superuser
5151235becaa1cf7e29f580900592563c3329d326deJerome Glisse
5161235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_idle 112
5176a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_idle, "ni");
5181235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_idle); FAIL;
5191235becaa1cf7e29f580900592563c3329d326deJerome Glisse
520370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák   // __NR_vm86old 113
5211235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_vm86old, "n/a");
5221235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // (will probably never be handled by Valgrind)
523370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák
5241235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_wait4 114
5251235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_wait4, "4s 2m");
5261235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_wait4, x0, x0+1, x0, x0+1); FAIL;
527370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák
5281235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_swapoff 115
5291235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_swapoff, "n/a");
5301235becaa1cf7e29f580900592563c3329d326deJerome Glisse //SY(__NR_swapoff); // (Not yet handled by Valgrind) FAIL;
5311235becaa1cf7e29f580900592563c3329d326deJerome Glisse
5321235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_sysinfo 116
5331235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_sysinfo, "1s 1m");
5341235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_sysinfo, x0); FAIL;
535370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák
5361235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_ipc 117
5371235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // XXX: This is simplistic -- need to do all the sub-cases properly.
5381e5cef96d184b00eb588b48ecd02386998077d82Marek Olšák   // XXX: Also, should be 6 scalar errors, except glibc's syscall() doesn't
5391235becaa1cf7e29f580900592563c3329d326deJerome Glisse   //      use the 6th one!
5401e5cef96d184b00eb588b48ecd02386998077d82Marek Olšák   GO(__NR_ipc, "5s 0m");
5411235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_ipc, x0+4, x0, x0, x0, x0, x0); FAIL;
542b2a98c3531c276b76024bb9b10fdd6c3360cb0c9Henri Verbeet
5431235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_fsync 118
544370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák   GO(__NR_fsync, "1s 0m");
545b2a98c3531c276b76024bb9b10fdd6c3360cb0c9Henri Verbeet   SY(__NR_fsync, x0-1); FAIL;
5461235becaa1cf7e29f580900592563c3329d326deJerome Glisse
547eac50295fccb983281423e825e57ab4a2a5bbbfbHenri Verbeet   // __NR_sigreturn 119
5481235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_sigreturn, "n/a");
54954e8dcaad65cbe3603730414fd8d76ac53f89a86Vadim Girlin //SY(__NR_sigreturn); // (Not yet handled by Valgrind) FAIL;
5501235becaa1cf7e29f580900592563c3329d326deJerome Glisse
551370c8b5ee7666f4f515d63603afe8282b1b3c682Marek Olšák   // __NR_clone 120
5521235becaa1cf7e29f580900592563c3329d326deJerome Glisse#ifndef CLONE_PARENT_SETTID
5531235becaa1cf7e29f580900592563c3329d326deJerome Glisse#define CLONE_PARENT_SETTID	0x00100000
5545c7127c07c3933662bc5447ce4a83b4e8af3b473Marek Olšák#endif
5555c7127c07c3933662bc5447ce4a83b4e8af3b473Marek Olšák   GO(__NR_clone, "5s 3m");
5565c7127c07c3933662bc5447ce4a83b4e8af3b473Marek Olšák   SY(__NR_clone, x0|CLONE_PARENT_SETTID|CLONE_SETTLS|CLONE_CHILD_SETTID|SIGCHLD, x0, x0, x0, x0); FAIL;
5575c7127c07c3933662bc5447ce4a83b4e8af3b473Marek Olšák   if (0 == res) {
5585c7127c07c3933662bc5447ce4a83b4e8af3b473Marek Olšák      SY(__NR_exit, 0); FAIL;
5599aa089eac05ebefafb6610b4a7e209b2fd1e93f6Marek Olšák   }
5609aa089eac05ebefafb6610b4a7e209b2fd1e93f6Marek Olšák
56117b695e6e7dd730497fb60a8e161935b23fa0e9cBryan Cain   // __NR_setdomainname 121
56215ca9d159e50815b0bfe60df8873f48c32a59ca5Marek Olšák   GO(__NR_setdomainname, "n/a");
563f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7Marek Olšák //SY(__NR_setdomainname); // (Not yet handled by Valgrind) FAIL;
564f5bfe54a34d9c8cd5de2b096d0e8486fe0d990a7Marek Olšák
5656a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_uname 122
5666a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_uname, "1s 1m");
5676a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_uname, x0); FAIL;
5686a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
5696a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_modify_ldt 123
5706a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_modify_ldt, "3s 1m");
5711235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_modify_ldt, x0+1, x0, x0+1); FAILx(EINVAL);
5724ac250c9d594898ad02323dbf02aab8792366d11Marek Olšák
5731235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_adjtimex 124
5741235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // XXX: need to do properly, but deref'ing NULL causing Valgrind to crash...
575f265a194263bb2a3fa204947a9c98f472835f121Christian König     GO(__NR_adjtimex, "XXX");
576f265a194263bb2a3fa204947a9c98f472835f121Christian König//   SY(__NR_adjtimex, x0); FAIL;
577f265a194263bb2a3fa204947a9c98f472835f121Christian König
578f265a194263bb2a3fa204947a9c98f472835f121Christian König   // __NR_mprotect 125
579f265a194263bb2a3fa204947a9c98f472835f121Christian König   GO(__NR_mprotect, "3s 0m");
580efc7fda4627919b5355952d955ee4a2c98505e56Christian König   SY(__NR_mprotect, x0+1, x0, x0); FAILx(EINVAL);
581efc7fda4627919b5355952d955ee4a2c98505e56Christian König
582f265a194263bb2a3fa204947a9c98f472835f121Christian König   // __NR_sigprocmask 126
583f265a194263bb2a3fa204947a9c98f472835f121Christian König   GO(__NR_sigprocmask, "3s 2m");
584efc7fda4627919b5355952d955ee4a2c98505e56Christian König   SY(__NR_sigprocmask, x0, x0+&px[1], x0+&px[1]); SUCC;
585efc7fda4627919b5355952d955ee4a2c98505e56Christian König
586efc7fda4627919b5355952d955ee4a2c98505e56Christian König   // __NR_create_module 127
5879d9afcb5bac2931d4b8e6d1aa571e941c5110c90Christian König   GO(__NR_create_module, "ni");
5889d9afcb5bac2931d4b8e6d1aa571e941c5110c90Christian König   SY(__NR_create_module); FAIL;
589f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König
590f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König   // __NR_init_module 128
591f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König   GO(__NR_init_module, "3s 2m");
592f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König   SY(__NR_init_module, x0, x0+1, x0); FAIL;
593f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König
594f3f03c67e90f962f67e7b58b7c7baff3be251cb1Christian König   // __NR_delete_module 129
595f265a194263bb2a3fa204947a9c98f472835f121Christian König   GO(__NR_delete_module, "n/a");
596f265a194263bb2a3fa204947a9c98f472835f121Christian König //SY(__NR_delete_module); // (Not yet handled by Valgrind) FAIL;
597f265a194263bb2a3fa204947a9c98f472835f121Christian König
598f265a194263bb2a3fa204947a9c98f472835f121Christian König   // __NR_get_kernel_syms 130
599f265a194263bb2a3fa204947a9c98f472835f121Christian König   GO(__NR_get_kernel_syms, "ni");
6006a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_get_kernel_syms); FAIL;
6016a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6026a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_quotactl 131
6036a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_quotactl, "4s 1m");
6046a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_quotactl, x0, x0, x0, x0); FAIL;
6056a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6066a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_getpgid 132
6076a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_getpgid, "1s 0m");
6086a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_getpgid, x0-1); FAIL;
6096a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6106a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_fchdir 133
6116a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_fchdir, "1s 0m");
6126a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_fchdir, x0-1); FAIL;
6136a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6146a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_bdflush 134
6156a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_bdflush, "n/a");
6166a829a1b724ca0d960decee217d260b4de8a5463Adam Rak //SY(__NR_bdflush); // (Not yet handled by Valgrind) FAIL;
6176a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6186a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_sysfs 135
6196a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_sysfs, "n/a");
6206a829a1b724ca0d960decee217d260b4de8a5463Adam Rak //SY(__NR_sysfs); // (Not yet handled by Valgrind) FAIL;
6216a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6226a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_personality 136
6236a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_personality, "1s 0m");
6246a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_personality, x0+0xffffffff); SUCC;
6256a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6266a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_afs_syscall 137
6276a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_afs_syscall, "ni");
6286a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_afs_syscall); FAIL;
6296a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6306a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_setfsuid 138
6316a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_setfsuid, "1s 0m");
6326a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_setfsuid, x0); SUCC;  // This syscall has a stupid return value
6336a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6346a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_setfsgid 139
6356a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_setfsgid, "1s 0m");
6366a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_setfsgid, x0); SUCC;  // This syscall has a stupid return value
6376a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6386a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR__llseek 140
6396a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR__llseek, "5s 1m");
6406a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR__llseek, x0, x0, x0, x0, x0); FAIL;
6416a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6426a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_getdents 141
6436a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_getdents, "3s 1m");
6446a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_getdents, x0, x0, x0+1); FAIL;
6456a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6466a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR__newselect 142
647c0f7fe7b79afa9b95b1af56dce9eb881575b1cdeTom Stellard   GO(__NR__newselect, "5s 4m");
648c0f7fe7b79afa9b95b1af56dce9eb881575b1cdeTom Stellard   SY(__NR__newselect, x0+8, x0+0xffffffff, x0+1, x0+1, x0+1); FAIL;
649c0f7fe7b79afa9b95b1af56dce9eb881575b1cdeTom Stellard
650c0f7fe7b79afa9b95b1af56dce9eb881575b1cdeTom Stellard   // __NR_flock 143
6516a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_flock, "2s 0m");
6526a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_flock, x0, x0); FAIL;
6536a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6546a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_msync 144
6556a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_msync, "3s 1m");
6566a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_msync, x0, x0+1, x0); FAIL;
6576a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6586a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_readv 145
6596a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_readv, "3s 1m");
6606a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_readv, x0, x0, x0+1); FAIL;
6616a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6626a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_writev 146
6636a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_writev, "3s 1m");
6646a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_writev, x0, x0, x0+1); FAIL;
6656a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6666a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_getsid 147
6676a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_getsid, "1s 0m");
6686a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_getsid, x0-1); FAIL;
6696a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6706a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_fdatasync 148
6716a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_fdatasync, "1s 0m");
6726a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_fdatasync, x0-1); FAIL;
6736a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6746a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR__sysctl 149
6756a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR__sysctl, "1s 1m");
6761235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR__sysctl, x0); FAIL;
6771235becaa1cf7e29f580900592563c3329d326deJerome Glisse
6781235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_mlock 150
6791235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_mlock, "2s 0m");
6801235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_mlock, x0, x0+1); FAIL;
6811235becaa1cf7e29f580900592563c3329d326deJerome Glisse
68252ba68d0b071620c891122d8049ec77568aa8d19Tilman Sauerbeck   // __NR_munlock 151
6836a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   GO(__NR_munlock, "2s 0m");
6846a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   SY(__NR_munlock, x0, x0+1); FAIL;
6856a829a1b724ca0d960decee217d260b4de8a5463Adam Rak
6866a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_mlockall 152
6877dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_mlockall, "1s 0m");
6887dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_mlockall, x0-1); FAIL;
6897dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
6907dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_munlockall 153
6917dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_munlockall, "0s 0m");
6927dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_munlockall); SUCC_OR_FAILx(EPERM);
6937dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
6947dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_sched_setparam 154
6950a6120244e66494db070ce875c0a464fbc5b15a1Marek Olšák   GO(__NR_sched_setparam, "2s 1m");
6967dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_sched_setparam, x0, x0); FAIL;
6977dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
6987dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // __NR_sched_getparam 155
6997dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_sched_getparam, "2s 1m");
7002ce783d8ddec1b1fcadc0798af0ebb045bba1cc4Marek Olšák   SY(__NR_sched_getparam, x0, x0); FAIL;
7011235becaa1cf7e29f580900592563c3329d326deJerome Glisse
7021235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_sched_setscheduler 156
7031235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_sched_setscheduler, "3s 1m");
704948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_sched_setscheduler, x0-1, x0, x0+1); FAIL;
705948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
706948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_sched_getscheduler 157
707948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_sched_getscheduler, "1s 0m");
708948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_sched_getscheduler, x0-1); FAIL;
709948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
710948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_sched_yield 158
711948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_sched_yield, "0s 0m");
7127dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_sched_yield); SUCC;
7137dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
7148cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_sched_get_priority_max 159
7157dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_sched_get_priority_max, "1s 0m");
7167dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_sched_get_priority_max, x0-1); FAIL;
717948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
718948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_sched_get_priority_min 160
719948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_sched_get_priority_min, "1s 0m");
720948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_sched_get_priority_min, x0-1); FAIL;
721948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
722948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_sched_rr_get_interval 161
723948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_sched_rr_get_interval, "n/a");
724948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund //SY(__NR_sched_rr_get_interval); // (Not yet handled by Valgrind) FAIL;
7257dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
726948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_nanosleep 162
727948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_nanosleep, "2s 2m");
728cd95b673479f8a8ac3d5aabf387d33f705e156e9Marek Olšák   SY(__NR_nanosleep, x0, x0+1); FAIL;
729948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
730948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_mremap 163
731948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_mremap, "5s 0m");
732948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_mremap, x0+1, x0, x0, x0+MREMAP_FIXED, x0); FAILx(EINVAL);
733948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
734948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_setresuid 164
7357dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_setresuid, "3s 0m");
736948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_setresuid, x0, x0, x0); FAIL;
737948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
738948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_getresuid 165
739948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_getresuid, "3s 3m");
740948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_getresuid, x0, x0, x0); FAIL;
741948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
742948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_vm86 166
743948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_vm86, "n/a");
744948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // (will probably never be handled by Valgrind)
745948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
746948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_query_module 167
7477dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_query_module, "ni");
7488cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   SY(__NR_query_module); FAIL;
7498cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth
7508cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_poll 168
7518cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   GO(__NR_poll, "3s 1m");
7528cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   SY(__NR_poll, x0, x0+1, x0); FAIL;
7538cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth
7548cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_nfsservctl 169
7558cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   GO(__NR_nfsservctl, "n/a");
7568cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth //SY(__NR_nfsservctl); // (Not yet handled by Valgrind) FAIL;
7578cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth
7588cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   // __NR_setresgid 170
759948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_setresgid, "3s 0m");
760948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_setresgid, x0, x0, x0); FAIL;
761948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
762948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_getresgid 171
763948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_getresgid, "3s 3m");
764948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_getresgid, x0, x0, x0); FAIL;
765948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
766948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_prctl 172
767948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_prctl, "5s 0m");
7688cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth   SY(__NR_prctl, x0, x0, x0, x0, x0); FAIL;
769948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
770948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_rt_sigreturn 173
771948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_rt_sigreturn, "n/a");
7728cd03b933cf868ff867e2db4a0937005a02fd0e4Simon Farnsworth //SY(__NR_rt_sigreturn); // (Not yet handled by Valgrind) FAIL;
773948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund
7741235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_rt_sigaction 174
7753603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigaction, "4s 4m");
7763603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_rt_sigaction, x0, x0+&px[2], x0+&px[2], x0); FAIL;
7773603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7783603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_rt_sigprocmask 175
7793603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigprocmask, "4s 2m");
7803603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_rt_sigprocmask, x0, x0+1, x0+1, x0); FAIL;
7813603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7823603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_rt_sigpending 176
7833603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigpending, "2s 1m");
7843603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_rt_sigpending, x0, x0+1); FAIL;
7853603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7863603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_rt_sigtimedwait 177
7873603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigtimedwait, "4s 3m");
7883603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_rt_sigtimedwait, x0+1, x0+1, x0+1, x0); FAIL;
7893603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7903603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_rt_sigqueueinfo 178
7913603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigqueueinfo, "3s 1m");
7923603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_rt_sigqueueinfo, x0, x0+1, x0); FAIL;
7933603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7943603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_rt_sigsuspend 179
7953603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_rt_sigsuspend, "ignore");
7963603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // (I don't know how to test this...)
7973603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
7983603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_pread64 180
7993603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_pread64, "5s 1m");
8003603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_pread64, x0, x0, x0+1, x0, x0); FAIL;
8013603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8023603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_pwrite64 181
8033603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_pwrite64, "5s 1m");
8043603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_pwrite64, x0, x0, x0+1, x0, x0); FAIL;
8053603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8063603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_chown 182
8073603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_chown, "3s 1m");
8083603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_chown, x0, x0, x0); FAIL;
8093603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8103603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_getcwd 183
8113603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_getcwd, "2s 1m");
8123603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_getcwd, x0, x0+1); FAIL;
8133603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8143603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_capget 184
8153603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_capget, "2s 2m");
8163603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_capget, x0, x0+1); FAIL;
8173603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8183603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_capset 185
8193603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_capset, "2s 2m");
8203603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_capset, x0, x0); FAIL;
8213603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8223603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_sigaltstack 186
8233603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   {
8243603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      struct our_sigaltstack {
8253603d157889544230f1787bbdc4915ccd7461c59Marek Olšák              void *ss_sp;
8263603d157889544230f1787bbdc4915ccd7461c59Marek Olšák              int ss_flags;
8273603d157889544230f1787bbdc4915ccd7461c59Marek Olšák              size_t ss_size;
8283603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      } ss;
8293603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      ss.ss_sp     = NULL;
8303603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      ss.ss_flags  = 0;
8313603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      ss.ss_size   = 0;
8323603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      VALGRIND_MAKE_MEM_NOACCESS(& ss, sizeof(struct our_sigaltstack));
8333603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      GO(__NR_sigaltstack, "2s 2m");
8343603d157889544230f1787bbdc4915ccd7461c59Marek Olšák      SY(__NR_sigaltstack, x0+&ss, x0+&ss); SUCC;
8353603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   }
8363603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8373603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_sendfile 187
8383603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_sendfile, "4s 1m");
8393603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_sendfile, x0, x0, x0+1, x0); FAIL;
8403603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8413603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_getpmsg 188
8423603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // Could do 5s 4m with more effort, but I can't be bothered for this
8433603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // crappy non-standard syscall.
8443603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_getpmsg, "5s 0m");
8453603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_getpmsg, x0, x0, x0, x0); FAIL;
8463603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8473603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_putpmsg 189
8483603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // Could do 5s 2m with more effort, but I can't be bothered for this
8493603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // crappy non-standard syscall.
8503603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_putpmsg, "5s 0m");
8513603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_putpmsg, x0, x0, x0, x0, x0); FAIL;
8523603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8533603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_vfork 190
8543603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_vfork, "other");
8553603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // (sse scalar_vfork.c)
8563603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8573603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_ugetrlimit 191
8583603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_ugetrlimit, "2s 1m");
8593603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_ugetrlimit, x0, x0); FAIL;
8603603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8613603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_mmap2 192
8623603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_mmap2, "6s 0m");
8633603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_mmap2, x0, x0, x0, x0, x0-1, x0); FAIL;
8643603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8653603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_truncate64 193
8663603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_truncate64, "3s 1m");
8673603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_truncate64, x0, x0, x0); FAIL;
8683603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
869518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_ftruncate64 194
8703603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_ftruncate64, "3s 0m");
8713603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_ftruncate64, x0, x0, x0); FAIL;
8723603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8733603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_stat64 195
8743603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_stat64, "2s 2m");
8753603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_stat64, x0, x0); FAIL;
8763603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8773603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_lstat64 196
878518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_lstat64, "2s 2m");
8793603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_lstat64, x0, x0); FAIL;
8803603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
8813603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_fstat64 197
8823603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_fstat64, "2s 1m");
8833603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_fstat64, x0, x0); FAIL;
8843603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
885518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_lchown32 198
886518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_lchown32, "3s 1m");
887518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_lchown32, x0, x0, x0); FAIL;
888518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
889518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_getuid32 199
890518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_getuid32, "0s 0m");
891518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_getuid32); SUCC;
892518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
893518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_getgid32 200
894518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_getgid32, "0s 0m");
895518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_getgid32); SUCC;
89644f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák
89744f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   // __NR_geteuid32 201
89844f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   GO(__NR_geteuid32, "0s 0m");
89944f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   SY(__NR_geteuid32); SUCC;
90044f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák
90144f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   // __NR_getegid32 202
90244f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   GO(__NR_getegid32, "0s 0m");
90344f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák   SY(__NR_getegid32); SUCC;
9042ce783d8ddec1b1fcadc0798af0ebb045bba1cc4Marek Olšák
9051235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_setreuid32 203
90690ce3cdde9fb2dd507b4e21c5456a3371f5996bcMarek Olšák   GO(__NR_setreuid32, "2s 0m");
907e6aad9ba04fb914a2484241f74ed0557fd1d59daDave Airlie   SY(__NR_setreuid32, x0, x0); FAIL;
9081235becaa1cf7e29f580900592563c3329d326deJerome Glisse
9091235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_setregid32 204
9101235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_setregid32, "2s 0m");
9111235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_setregid32, x0, x0); FAIL;
9122ce783d8ddec1b1fcadc0798af0ebb045bba1cc4Marek Olšák
9133603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_getgroups32 205
9143603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_getgroups32, "2s 1m");
915518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_getgroups32, x0+1, x0+1); FAIL;
916518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
917518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_setgroups32 206
918518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_setgroups32, "2s 1m");
919518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_setgroups32, x0+1, x0+1); FAIL;
920518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
921518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_fchown32 207
922518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_fchown32, "3s 0m");
923b4082f492b4b55df4c636445e47b97d1f1e4b5b2Alex Deucher   SY(__NR_fchown32, x0, x0, x0); FAIL;
924518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
925518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_setresuid32 208
926518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_setresuid32, "3s 0m");
927518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_setresuid32, x0, x0, x0); FAIL;
928518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
929518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   // __NR_getresuid32 209
930518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_getresuid32, "3s 3m");
931518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   SY(__NR_getresuid32, x0, x0, x0); FAIL;
932518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák
9336e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   // __NR_setresgid32 210
9346e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   GO(__NR_setresgid32, "3s 0m");
9356e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   SY(__NR_setresgid32, x0, x0, x0); FAIL;
9361106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák
9371106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   // __NR_getresgid32 211
9381106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   GO(__NR_getresgid32, "3s 3m");
9391106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   SY(__NR_getresgid32, x0, x0, x0); FAIL;
9401106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák
9416e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   // __NR_chown32 212
9426e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   GO(__NR_chown32, "3s 1m");
9436e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák   SY(__NR_chown32, x0, x0, x0); FAIL;
9446e7756db14c362ede6fdc97454267a32b8eab1d4Marek Olšák
9451106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   // __NR_setuid32 213
9461106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   GO(__NR_setuid32, "1s 0m");
9471106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák   SY(__NR_setuid32, x0); FAIL;
9481106bbc7d6cd024d1e20573e281ea4c48c5eaf19Marek Olšák
949393d741788fa82896d4b1c9fd02402a83053afcfMarek Olšák   // __NR_setgid32 214
950393d741788fa82896d4b1c9fd02402a83053afcfMarek Olšák   GO(__NR_setgid32, "1s 0m");
9513603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_setgid32, x0); FAIL;
9523603d157889544230f1787bbdc4915ccd7461c59Marek Olšák
9533603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   // __NR_setfsuid32 215
9543603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   GO(__NR_setfsuid32, "1s 0m");
9553603d157889544230f1787bbdc4915ccd7461c59Marek Olšák   SY(__NR_setfsuid32, x0); SUCC;  // This syscall has a stupid return value
9561235becaa1cf7e29f580900592563c3329d326deJerome Glisse
9571235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_setfsgid32 216
9581235becaa1cf7e29f580900592563c3329d326deJerome Glisse   GO(__NR_setfsgid32, "1s 0m");
9591235becaa1cf7e29f580900592563c3329d326deJerome Glisse   SY(__NR_setfsgid32, x0); SUCC;  // This syscall has a stupid return value
9601235becaa1cf7e29f580900592563c3329d326deJerome Glisse
9611235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_pivot_root 217
962f265a194263bb2a3fa204947a9c98f472835f121Christian König   GO(__NR_pivot_root, "n/a");
9636a829a1b724ca0d960decee217d260b4de8a5463Adam Rak //SY(__NR_pivot_root); // (Not yet handled by Valgrind) FAIL;
96444f14ebd7b9ba7186342039d2602fdd6ea5077f5Marek Olšák
9656a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // __NR_mincore 218
966518557d74abd4ce035dae079ff6eb1b08cc639d0Marek Olšák   GO(__NR_mincore, "3s 1m");
96718cdb9c8abfb5d9f009fcb36ab788f48792207e4Henri Verbeet   SY(__NR_mincore, x0, x0+40960, x0); FAIL;
96818cdb9c8abfb5d9f009fcb36ab788f48792207e4Henri Verbeet
96918cdb9c8abfb5d9f009fcb36ab788f48792207e4Henri Verbeet   // __NR_madvise 219
97018cdb9c8abfb5d9f009fcb36ab788f48792207e4Henri Verbeet   GO(__NR_madvise, "3s 0m");
9717eca76952b6726be9459375dde7478a01789577eChristian König   SY(__NR_madvise, x0, x0+1, x0); FAILx(ENOMEM);
972dbcd6526021c50770c3e5e04b04dc64c70298124Dave Airlie
973948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   // __NR_getdents64 220
974948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   GO(__NR_getdents64, "3s 1m");
975948e1eb8e9c166ad5b74abc630d0760768ce78c9Fredrik Höglund   SY(__NR_getdents64, x0, x0, x0+1); FAIL;
9761235becaa1cf7e29f580900592563c3329d326deJerome Glisse
9771235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // __NR_fcntl64 221
9788e0437914bb786d0b05be8f95e4ff37bf5a19f44Dave Airlie   // As with sys_open(), we don't trigger errors for the 1st two args for
9797b3fa038830663de9bceded1b0dd2d64b8cf39c4Dave Airlie   // the later ones.
9807dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // For F_GETFD the 3rd arg is ignored.
9817dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_fcntl64, "(GETFD) 2s 0m");
9827dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_fcntl64, x0-1, x0+F_GETFD, x0); FAILx(EBADF);
9837dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer
9847dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   // For F_DUPFD the 3rd arg is 'arg'
9857dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   GO(__NR_fcntl64, "(DUPFD) 1s 0m");
9867dd2d29a560a53d42d15f9ac06ba2ee7cd312ed9Michel Dänzer   SY(__NR_fcntl64, -1, F_DUPFD, x0); FAILx(EBADF);
987c0f7fe7b79afa9b95b1af56dce9eb881575b1cdeTom Stellard
9886a829a1b724ca0d960decee217d260b4de8a5463Adam Rak   // For F_GETLK the 3rd arg is 'lock'.
9891235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // On x86, this fails w/EBADF.  But on amd64 in 32-bit mode it fails
9901235becaa1cf7e29f580900592563c3329d326deJerome Glisse   // w/EFAULT.
991   GO(__NR_fcntl64, "(GETLK) 1s 0m");
992   SY(__NR_fcntl64, -1, +F_GETLK, x0); FAIL; //FAILx(EBADF);
993
994   // 222
995   GO(222, "ni");
996   SY(222); FAIL;
997
998   // 223
999   GO(223, "ni");
1000   SY(223); FAIL;
1001
1002   // __NR_gettid 224
1003   GO(__NR_gettid, "n/a");
1004 //SY(__NR_gettid); // (Not yet handled by Valgrind) FAIL;
1005
1006   // __NR_readahead 225
1007   GO(__NR_readahead, "n/a");
1008 //SY(__NR_readahead); // (Not yet handled by Valgrind) FAIL;
1009
1010   // __NR_setxattr 226
1011   GO(__NR_setxattr, "5s 3m");
1012   SY(__NR_setxattr, x0, x0, x0, x0+1, x0); FAIL;
1013
1014   // __NR_lsetxattr 227
1015   GO(__NR_lsetxattr, "5s 3m");
1016   SY(__NR_lsetxattr, x0, x0, x0, x0+1, x0); FAIL;
1017
1018   // __NR_fsetxattr 228
1019   GO(__NR_fsetxattr, "5s 2m");
1020   SY(__NR_fsetxattr, x0, x0, x0, x0+1, x0); FAIL;
1021
1022   // __NR_getxattr 229
1023   GO(__NR_getxattr, "4s 3m");
1024   SY(__NR_getxattr, x0, x0, x0, x0+1); FAIL;
1025
1026   // __NR_lgetxattr 230
1027   GO(__NR_lgetxattr, "4s 3m");
1028   SY(__NR_lgetxattr, x0, x0, x0, x0+1); FAIL;
1029
1030   // __NR_fgetxattr 231
1031   GO(__NR_fgetxattr, "4s 2m");
1032   SY(__NR_fgetxattr, x0, x0, x0, x0+1); FAIL;
1033
1034   // __NR_listxattr 232
1035   GO(__NR_listxattr, "3s 2m");
1036   SY(__NR_listxattr, x0, x0, x0+1); FAIL;
1037
1038   // __NR_llistxattr 233
1039   GO(__NR_llistxattr, "3s 2m");
1040   SY(__NR_llistxattr, x0, x0, x0+1); FAIL;
1041
1042   // __NR_flistxattr 234
1043   GO(__NR_flistxattr, "3s 1m");
1044   SY(__NR_flistxattr, x0-1, x0, x0+1); FAIL; /* kernel returns EBADF, but both seem correct */
1045
1046   // __NR_removexattr 235
1047   GO(__NR_removexattr, "2s 2m");
1048   SY(__NR_removexattr, x0, x0); FAIL;
1049
1050   // __NR_lremovexattr 236
1051   GO(__NR_lremovexattr, "2s 2m");
1052   SY(__NR_lremovexattr, x0, x0); FAIL;
1053
1054   // __NR_fremovexattr 237
1055   GO(__NR_fremovexattr, "2s 1m");
1056   SY(__NR_fremovexattr, x0, x0); FAIL;
1057
1058   // __NR_tkill 238
1059   GO(__NR_tkill, "n/a");
1060 //SY(__NR_tkill); // (Not yet handled by Valgrind) FAIL;
1061
1062   // __NR_sendfile64 239
1063   GO(__NR_sendfile64, "4s 1m");
1064   SY(__NR_sendfile64, x0, x0, x0+1, x0); FAIL;
1065
1066   // __NR_futex 240
1067   #ifndef FUTEX_WAIT
1068   #define FUTEX_WAIT   0
1069   #endif
1070   // XXX: again, glibc not doing 6th arg means we have only 5s errors
1071   GO(__NR_futex, "5s 2m");
1072   SY(__NR_futex, x0+FUTEX_WAIT, x0, x0, x0+1, x0, x0); FAIL;
1073
1074   // __NR_sched_setaffinity 241
1075   GO(__NR_sched_setaffinity, "3s 1m");
1076   SY(__NR_sched_setaffinity, x0, x0+1, x0); FAIL;
1077
1078   // __NR_sched_getaffinity 242
1079   GO(__NR_sched_getaffinity, "3s 1m");
1080   SY(__NR_sched_getaffinity, x0, x0+1, x0); FAIL;
1081
1082   // __NR_set_thread_area 243
1083   GO(__NR_set_thread_area, "1s 1m");
1084   SY(__NR_set_thread_area, x0); FAILx(EFAULT);
1085
1086   // __NR_get_thread_area 244
1087   GO(__NR_get_thread_area, "1s 1m");
1088   SY(__NR_get_thread_area, x0); FAILx(EFAULT);
1089
1090   // __NR_io_setup 245
1091   GO(__NR_io_setup, "2s 1m");
1092   SY(__NR_io_setup, x0, x0); FAIL;
1093
1094   // __NR_io_destroy 246
1095   {
1096      // jump through hoops to prevent the PRE(io_destroy) wrapper crashing.
1097      struct fake_aio_ring {
1098        unsigned        id;     /* kernel internal index number */
1099        unsigned        nr;     /* number of io_events */
1100        // There are more fields in the real aio_ring, but the 'nr' field is
1101        // the only one used by the PRE() wrapper.
1102      } ring = { 0, 0 };
1103      struct fake_aio_ring* ringptr = &ring;
1104      GO(__NR_io_destroy, "1s 0m");
1105      SY(__NR_io_destroy, x0+&ringptr); FAIL;
1106   }
1107
1108   // __NR_io_getevents 247
1109   GO(__NR_io_getevents, "5s 2m");
1110   SY(__NR_io_getevents, x0, x0, x0+1, x0, x0+1); FAIL;
1111
1112   // __NR_io_submit 248
1113   GO(__NR_io_submit, "3s 1m");
1114   SY(__NR_io_submit, x0, x0+1, x0); FAIL;
1115
1116   // __NR_io_cancel 249
1117   GO(__NR_io_cancel, "3s 2m");
1118   SY(__NR_io_cancel, x0, x0, x0); FAIL;
1119
1120   // __NR_fadvise64 250
1121   GO(__NR_fadvise64, "n/a");
1122 //SY(__NR_fadvise64); // (Not yet handled by Valgrind) FAIL;
1123
1124   // 251
1125   GO(251, "ni");
1126   SY(251); FAIL;
1127
1128   // __NR_exit_group 252
1129   GO(__NR_exit_group, "other");
1130   // (see scalar_exit_group.c)
1131
1132   // __NR_lookup_dcookie 253
1133   GO(__NR_lookup_dcookie, "4s 1m");
1134   SY(__NR_lookup_dcookie, x0, x0, x0, x0+1); FAIL;
1135
1136   // __NR_epoll_create 254
1137   GO(__NR_epoll_create, "1s 0m");
1138   SY(__NR_epoll_create, x0); SUCC_OR_FAIL;
1139
1140   // __NR_epoll_ctl 255
1141   GO(__NR_epoll_ctl, "4s 1m");
1142   SY(__NR_epoll_ctl, x0, x0, x0, x0); FAIL;
1143
1144   // __NR_epoll_wait 256
1145   GO(__NR_epoll_wait, "4s 1m");
1146   SY(__NR_epoll_wait, x0, x0, x0+1, x0); FAIL;
1147
1148   // __NR_remap_file_pages 257
1149   GO(__NR_remap_file_pages, "n/a");
1150 //SY(__NR_remap_file_pages); // (Not yet handled by Valgrind) FAIL;
1151
1152   // __NR_set_tid_address 258
1153   GO(__NR_set_tid_address, "1s 0m");
1154   SY(__NR_set_tid_address, x0); SUCC_OR_FAILx(ENOSYS);
1155
1156   // __NR_timer_create 259
1157   GO(__NR_timer_create, "3s 2m");
1158   SY(__NR_timer_create, x0, x0+1, x0); FAIL;
1159
1160   // __NR_timer_settime (__NR_timer_create+1)
1161   GO(__NR_timer_settime, "4s 2m");
1162   SY(__NR_timer_settime, x0, x0, x0, x0+1); FAIL;
1163
1164   // __NR_timer_gettime (__NR_timer_create+2)
1165   GO(__NR_timer_gettime, "2s 1m");
1166   SY(__NR_timer_gettime, x0, x0); FAIL;
1167
1168   // __NR_timer_getoverrun (__NR_timer_create+3)
1169   GO(__NR_timer_getoverrun, "1s 0m");
1170   SY(__NR_timer_getoverrun, x0); FAIL;
1171
1172   // __NR_timer_delete (__NR_timer_create+4)
1173   GO(__NR_timer_delete, "1s 0m");
1174   SY(__NR_timer_delete, x0); FAIL;
1175
1176   // __NR_clock_settime (__NR_timer_create+5)
1177   GO(__NR_clock_settime, "2s 1m");
1178   SY(__NR_clock_settime, x0, x0);  FAIL; FAIL;
1179
1180   // __NR_clock_gettime (__NR_timer_create+6)
1181   GO(__NR_clock_gettime, "2s 1m");
1182   SY(__NR_clock_gettime, x0, x0); FAIL;
1183
1184   // __NR_clock_getres (__NR_timer_create+7)
1185   GO(__NR_clock_getres, "2s 1m");
1186   SY(__NR_clock_getres, x0+1, x0+1); FAIL; FAIL;
1187
1188   // __NR_clock_nanosleep (__NR_timer_create+8)
1189   GO(__NR_clock_nanosleep, "n/a");
1190 //SY(__NR_clock_nanosleep); // (Not yet handled by Valgrind) FAIL;
1191
1192   // __NR_statfs64 268
1193   GO(__NR_statfs64, "3s 2m");
1194   SY(__NR_statfs64, x0, x0+1, x0); FAIL;
1195
1196   // __NR_fstatfs64 269
1197   GO(__NR_fstatfs64, "3s 1m");
1198   SY(__NR_fstatfs64, x0, x0+1, x0); FAIL;
1199
1200   // __NR_tgkill 270
1201   GO(__NR_tgkill, "n/a");
1202 //SY(__NR_tgkill); // (Not yet handled by Valgrind) FAIL;
1203
1204   // __NR_utimes 271
1205   GO(__NR_utimes, "2s 2m");
1206   SY(__NR_utimes, x0, x0+1); FAIL;
1207
1208   // __NR_fadvise64_64 272
1209   GO(__NR_fadvise64_64, "n/a");
1210 //SY(__NR_fadvise64_64); // (Not yet handled by Valgrind) FAIL;
1211
1212   // __NR_vserver 273
1213   GO(__NR_vserver, "ni");
1214   SY(__NR_vserver); FAIL;
1215
1216   // __NR_mbind 274
1217   GO(__NR_mbind, "n/a");
1218 //SY(__NR_mbind); // (Not yet handled by Valgrind) FAIL;
1219
1220   // __NR_get_mempolicy 275
1221   GO(__NR_get_mempolicy, "n/a");
1222 //SY(__NR_get_mempolicy); // (Not yet handled by Valgrind) FAIL;
1223
1224   // __NR_set_mempolicy 276
1225   GO(__NR_set_mempolicy, "n/a");
1226 //SY(__NR_set_mempolicy); // (Not yet handled by Valgrind) FAIL;
1227
1228   // __NR_mq_open 277
1229   GO(__NR_mq_open, "4s 3m");
1230   SY(__NR_mq_open, x0, x0+O_CREAT, x0, x0+1); FAIL;
1231
1232   // __NR_mq_unlink (__NR_mq_open+1)
1233   GO(__NR_mq_unlink, "1s 1m");
1234   SY(__NR_mq_unlink, x0); FAIL;
1235
1236   // __NR_mq_timedsend (__NR_mq_open+2)
1237   GO(__NR_mq_timedsend, "5s 2m");
1238   SY(__NR_mq_timedsend, x0, x0, x0+1, x0, x0+1); FAIL;
1239
1240   // __NR_mq_timedreceive (__NR_mq_open+3)
1241   GO(__NR_mq_timedreceive, "5s 3m");
1242   SY(__NR_mq_timedreceive, x0, x0, x0+1, x0+1, x0+1); FAIL;
1243
1244   // __NR_mq_notify (__NR_mq_open+4)
1245   GO(__NR_mq_notify, "2s 1m");
1246   SY(__NR_mq_notify, x0, x0+1); FAIL;
1247
1248   // __NR_mq_getsetattr (__NR_mq_open+5)
1249   GO(__NR_mq_getsetattr, "3s 2m");
1250   SY(__NR_mq_getsetattr, x0, x0+1, x0+1); FAIL;
1251
1252   // __NR_sys_kexec_load 283
1253   GO(__NR_sys_kexec_load, "ni");
1254   SY(__NR_sys_kexec_load); FAIL;
1255
1256   // __NR_epoll_create1 329
1257   GO(__NR_epoll_create1, "1s 0m");
1258   SY(__NR_epoll_create1, x0); SUCC_OR_FAIL;
1259
1260   // __NR_process_vm_readv 347
1261   GO(__NR_process_vm_readv, "6s 2m");
1262   SY(__NR_process_vm_readv, x0, x0, x0+1, x0, x0+1, x0); FAIL;
1263
1264   // __NR_process_vm_writev 348
1265   GO(__NR_process_vm_writev, "6s 2m");
1266   SY(__NR_process_vm_writev, x0, x0, x0+1, x0, x0+1, x0); FAIL;
1267
1268   // no such syscall...
1269   GO(9999, "1e");
1270   SY(9999); FAIL;
1271
1272   // __NR_exit 1
1273   GO(__NR_exit, "1s 0m");
1274   SY(__NR_exit, x0); FAIL;
1275
1276   assert(0);
1277}
1278
1279