nethercote | e365ff5 | 2004-11-12 17:12:04 +0000 | [diff] [blame^] | 1 | // XXX: x86-specific, so these should be in x86/, or something |
| 2 | #include "../../coregrind/x86-linux/vki_unistd.h" |
| 3 | |
nethercote | 75a8c98 | 2004-11-11 19:03:34 +0000 | [diff] [blame] | 4 | #include <assert.h> |
| 5 | #include <fcntl.h> |
| 6 | #include <stdio.h> |
| 7 | #include <stdlib.h> |
nethercote | 75a8c98 | 2004-11-11 19:03:34 +0000 | [diff] [blame] | 8 | #include <sys/syscall.h> |
nethercote | 9a3beb9 | 2004-11-12 17:07:26 +0000 | [diff] [blame] | 9 | #include <sys/stat.h> |
| 10 | #include <sys/ptrace.h> |
nethercote | 75a8c98 | 2004-11-11 19:03:34 +0000 | [diff] [blame] | 11 | #include <sys/types.h> |
| 12 | |
nethercote | e365ff5 | 2004-11-12 17:12:04 +0000 | [diff] [blame^] | 13 | // Since we use vki_unistd.h, we can't include <unistd.h>. So we have to |
| 14 | // declare this ourselves. |
| 15 | extern long int syscall (long int __sysno, ...) __THROW; |
| 16 | |
nethercote | 75a8c98 | 2004-11-11 19:03:34 +0000 | [diff] [blame] | 17 | // Thorough syscall scalar arg checking. Also serves as thorough checking |
| 18 | // for (very) basic syscall use. Generally not trying to do anything |
| 19 | // meaningful with the syscalls. |
| 20 | |
| 21 | #define GO(__NR_xxx, s) \ |
| 22 | fprintf(stderr, "-----------------------------------------------------\n" \ |
| 23 | "%3d:%20s %s\n" \ |
| 24 | "-----------------------------------------------------\n", \ |
| 25 | __NR_xxx, #__NR_xxx, s); |
| 26 | |
| 27 | #define SY syscall |
| 28 | |
| 29 | |