bsd.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #ifndef _BSD_EXTENSION
  10. This header file is an extension to ANSI/POSIX
  11. #endif
  12. #ifndef __BSD_H_
  13. #define __BSD_H_
  14. #pragma src "/sys/src/ape/lib/bsd"
  15. #pragma lib "/$M/lib/ape/libbsd.a"
  16. #ifndef __TYPES_H
  17. #include <sys/types.h>
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #ifndef _SIZE_T
  23. #define _SIZE_T
  24. typedef unsigned long size_t;
  25. #endif
  26. /* ifndefs because X11 stuff (ugh) */
  27. #ifndef bcopy
  28. extern void bcopy(void*, void*, size_t);
  29. #endif
  30. #ifndef bcmp
  31. extern int bcmp(void*, void*, size_t);
  32. #endif
  33. #ifndef bzero
  34. extern void bzero(void*, size_t);
  35. #endif
  36. extern int ffs(unsigned int);
  37. extern void bhappy(void*);
  38. extern int rresvport(int*);
  39. extern int rcmd(char**, int, char*, char*, char*, int*);
  40. extern int strcasecmp(char*, char*);
  41. extern int putenv(char*);
  42. extern int strncasecmp(char*, char*,int);
  43. extern int getopt(int, char**, char*);
  44. extern int opterr;
  45. extern int optind;
  46. extern int optopt;
  47. extern char *optarg;
  48. extern char *mktemp(char *);
  49. extern char *sys_errlist[];
  50. extern int sys_nerr;
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif