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