src/os/unix/ngx_posix_config.h - nginx-1.7.10

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_POSIX_CONFIG_H_INCLUDED_
  6. #define _NGX_POSIX_CONFIG_H_INCLUDED_


  7. #if (NGX_HPUX)
  8. #define _XOPEN_SOURCE
  9. #define _XOPEN_SOURCE_EXTENDED  1
  10. #define _HPUX_ALT_XOPEN_SOCKET_API
  11. #endif


  12. #if (NGX_TRU64)
  13. #define _REENTRANT
  14. #endif


  15. #ifdef __CYGWIN__
  16. #define timezonevar             /* timezone is variable */
  17. #define NGX_BROKEN_SCM_RIGHTS   1
  18. #endif


  19. #include <sys/types.h>
  20. #include <sys/time.h>
  21. #if (NGX_HAVE_UNISTD_H)
  22. #include <unistd.h>
  23. #endif
  24. #if (NGX_HAVE_INTTYPES_H)
  25. #include <inttypes.h>
  26. #endif
  27. #include <stdarg.h>
  28. #include <stddef.h>             /* offsetof() */
  29. #include <stdio.h>
  30. #include <stdlib.h>
  31. #include <ctype.h>
  32. #include <errno.h>
  33. #include <string.h>
  34. #include <signal.h>
  35. #include <pwd.h>
  36. #include <grp.h>
  37. #include <dirent.h>
  38. #include <glob.h>
  39. #include <time.h>
  40. #if (NGX_HAVE_SYS_PARAM_H)
  41. #include <sys/param.h>          /* statfs() */
  42. #endif
  43. #if (NGX_HAVE_SYS_MOUNT_H)
  44. #include <sys/mount.h>          /* statfs() */
  45. #endif
  46. #if (NGX_HAVE_SYS_STATVFS_H)
  47. #include <sys/statvfs.h>        /* statvfs() */
  48. #endif

  49. #if (NGX_HAVE_SYS_FILIO_H)
  50. #include <sys/filio.h>          /* FIONBIO */
  51. #endif
  52. #include <sys/ioctl.h>          /* FIONBIO */

  53. #include <sys/uio.h>
  54. #include <sys/stat.h>
  55. #include <fcntl.h>

  56. #include <sys/wait.h>
  57. #include <sys/mman.h>
  58. #include <sys/resource.h>
  59. #include <sched.h>

  60. #include <sys/socket.h>
  61. #include <netinet/in.h>
  62. #include <netinet/tcp.h>        /* TCP_NODELAY */
  63. #include <arpa/inet.h>
  64. #include <netdb.h>
  65. #include <sys/un.h>

  66. #if (NGX_HAVE_LIMITS_H)
  67. #include <limits.h>             /* IOV_MAX */
  68. #endif

  69. #ifdef __CYGWIN__
  70. #include <malloc.h>             /* memalign() */
  71. #endif

  72. #if (NGX_HAVE_CRYPT_H)
  73. #include <crypt.h>
  74. #endif


  75. #ifndef IOV_MAX
  76. #define IOV_MAX   16
  77. #endif


  78. #include <ngx_auto_config.h>


  79. #if (NGX_HAVE_POSIX_SEM)
  80. #include <semaphore.h>
  81. #endif


  82. #if (NGX_HAVE_POLL)
  83. #include <poll.h>
  84. #endif


  85. #if (NGX_HAVE_KQUEUE)
  86. #include <sys/event.h>
  87. #endif


  88. #if (NGX_HAVE_DEVPOLL)
  89. #include <sys/ioctl.h>
  90. #include <sys/devpoll.h>
  91. #endif


  92. #if (NGX_HAVE_FILE_AIO)
  93. #include <aio.h>
  94. typedef struct aiocb  ngx_aiocb_t;
  95. #endif


  96. #define NGX_LISTEN_BACKLOG  511

  97. #define ngx_debug_init()


  98. #if (__FreeBSD__) && (__FreeBSD_version < 400017)

  99. #include <sys/param.h>          /* ALIGN() */

  100. /*
  101. * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
  102. */

  103. #undef  CMSG_SPACE
  104. #define CMSG_SPACE(l)       (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))

  105. #undef  CMSG_LEN
  106. #define CMSG_LEN(l)         (ALIGN(sizeof(struct cmsghdr)) + (l))

  107. #undef  CMSG_DATA
  108. #define CMSG_DATA(cmsg)     ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))

  109. #endif


  110. extern char **environ;


  111. #endif /* _NGX_POSIX_CONFIG_H_INCLUDED_ */