1 #include "../../../include/vki/vki-scnums-x86-linux.h"
8 #include <sys/syscall.h>
10 #include <sys/ptrace.h>
11 #include <sys/types.h>
18 // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to
19 // declare this ourselves.
20 extern long int syscall (long int __sysno
, ...) __THROW
;
22 // Thorough syscall scalar arg checking. Also serves as thorough checking
23 // for (very) basic syscall use. Generally not trying to do anything
24 // meaningful with the syscalls.
26 #define GO(__NR_xxx, s) \
27 fprintf(stderr, "-----------------------------------------------------\n" \
29 "-----------------------------------------------------\n", \
30 __NR_xxx, #__NR_xxx, s);
32 #define SY res = syscall
34 #define FAIL assert(-1 == res);
35 #define SUCC assert(-1 != res);
36 #define SUCC_OR_FAIL /* no test */
40 int myerrno = errno; \
45 fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \
49 fprintf(stderr, "Expected error %s (%d), got success\n", #E, E); \
54 #define SUCC_OR_FAILx(E) \
56 int myerrno = errno; \
61 fprintf(stderr, "Expected error %s (%d), got %d\n", #E, E, myerrno); \