1 #undef _BSD_EXTENSION /* avoid multiple def'n if predefined */ 2 #undef _PLAN9_SOURCE 3 #undef _POSIX_SOURCE 4 #undef _RESEARCH_SOURCE 5 #undef _SUSV2_SOURCE 6 7 #define _BSD_EXTENSION 8 #define _PLAN9_SOURCE 9 #define _POSIX_SOURCE 10 #define _RESEARCH_SOURCE 11 #define _SUSV2_SOURCE 12 13 #include <stdlib.h> 14 #include <stdarg.h> 15 #include <string.h> 16 #include <unistd.h> 17 #include <fcntl.h> 18 #include <signal.h> 19 #include <inttypes.h> 20 21 #ifndef NSIG 22 #define NSIG 32 23 #endif 24 25 /* plan 9 compatibility */ 26 #define RFPROC 1 27 #define RFFDG 1 28 #define RFNOTEG 1 29 30 #define uintptr uintptr_t 31 32 char *strdup(const char *); 33 34 #define nil ((void*)0) 35 36 /* in case uchar, etc. are built-in types */ 37 #define uchar _fmtuchar 38 #define ushort _fmtushort 39 #define uint _fmtuint 40 #define ulong _fmtulong 41 #define vlong _fmtvlong 42 #define uvlong _fmtuvlong 43 44 typedef unsigned char uchar; 45 typedef unsigned short ushort; 46 typedef unsigned int uint; 47 typedef unsigned long ulong; 48 typedef unsigned long long uvlong; 49 50 #define OREAD O_RDONLY 51 #define OWRITE O_WRONLY 52 #define ORDWR O_RDWR 53 #define OCEXEC 0 54