unix.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define _BSD_EXTENSION
  7. #define _PLAN9_SOURCE
  8. #define _POSIX_SOURCE
  9. #define _RESEARCH_SOURCE
  10. #define _SUSV2_SOURCE
  11. #include <stdlib.h>
  12. #include <stdarg.h>
  13. #include <string.h>
  14. #include <unistd.h>
  15. #include <fcntl.h>
  16. #include <signal.h>
  17. #include <inttypes.h>
  18. #ifndef NSIG
  19. #define NSIG 32
  20. #endif
  21. /* plan 9 compatibility */
  22. #define RFPROC 1
  23. #define RFFDG 1
  24. #define RFNOTEG 1
  25. #define uintptr uintptr_t
  26. char *strdup(const char *);
  27. #define nil ((void*)0)
  28. /* in case uchar, etc. are built-in types */
  29. #define uchar _fmtuchar
  30. #define ushort _fmtushort
  31. #define uint _fmtuint
  32. #define ulong _fmtulong
  33. #define vlong _fmtvlong
  34. #define uvlong _fmtuvlong
  35. typedef unsigned char uchar;
  36. typedef unsigned short ushort;
  37. typedef unsigned int uint;
  38. typedef unsigned long ulong;
  39. typedef unsigned long long uvlong;
  40. #define OREAD O_RDONLY
  41. #define OWRITE O_WRONLY
  42. #define ORDWR O_RDWR
  43. #define OCEXEC 0