4
// TODO: we probably don't need most of these #includes
5
#include <sys/select.h>
6
#include <sys/user.h> // a user told me that user.h should go after select.h to fix a compile error
10
//#include <sys/ptrace.h>
11
//#include <linux/ptrace.h> /* For constants ORIG_EAX etc */
12
//#include <sys/syscall.h> /* For constants SYS_write etc */
13
#include <linux/types.h>
14
#include <sys/types.h>
18
//#define _GNU_SOURCE // for vasprintf (now we include _GNU_SOURCE in Makefile)
27
#include <linux/ipc.h>
28
#include <linux/shm.h>
30
#include <sys/param.h>
34
// to shut up gcc warnings without causing nasty #include conflicts
35
// TODO: do we still need this?
36
int shmget(key_t key, size_t size, int shmflg);
37
void *shmat(int shmid, const void *shmaddr, int shmflg);
38
int shmdt(const void *shmaddr);
39
int shmctl(int shmid, int cmd, struct shmid_ds *buf);
42
// like an assert except that it always fires
43
#define EXITIF(x) do { \
45
fprintf(stderr, "Fatal error in %s [%s:%d]\n", __FUNCTION__, __FILE__, __LINE__); \