src/os/unix/ngx_freebsd_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_FREEBSD_CONFIG_H_INCLUDED_
  6. #define _NGX_FREEBSD_CONFIG_H_INCLUDED_


  7. #include <sys/types.h>
  8. #include <sys/time.h>
  9. #include <unistd.h>
  10. #include <stdarg.h>
  11. #include <stddef.h>             /* offsetof() */
  12. #include <stdio.h>
  13. #include <stdlib.h>
  14. #include <ctype.h>
  15. #include <errno.h>
  16. #include <string.h>
  17. #include <signal.h>
  18. #include <pwd.h>
  19. #include <grp.h>
  20. #include <dirent.h>
  21. #include <glob.h>
  22. #include <time.h>
  23. #include <sys/param.h>          /* ALIGN() */
  24. #include <sys/mount.h>          /* statfs() */

  25. #include <sys/filio.h>          /* FIONBIO */
  26. #include <sys/uio.h>
  27. #include <sys/stat.h>
  28. #include <fcntl.h>

  29. #include <sys/wait.h>
  30. #include <sys/mman.h>
  31. #include <sys/resource.h>
  32. #include <sched.h>

  33. #include <sys/socket.h>
  34. #include <netinet/in.h>
  35. #include <netinet/tcp.h>        /* TCP_NODELAY, TCP_NOPUSH */
  36. #include <arpa/inet.h>
  37. #include <netdb.h>
  38. #include <sys/un.h>

  39. #include <libutil.h>            /* setproctitle() before 4.1 */
  40. #include <osreldate.h>
  41. #include <sys/sysctl.h>


  42. #if __FreeBSD_version < 400017

  43. /*
  44. * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
  45. */

  46. #undef  CMSG_SPACE
  47. #define CMSG_SPACE(l)       (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))

  48. #undef  CMSG_LEN
  49. #define CMSG_LEN(l)         (ALIGN(sizeof(struct cmsghdr)) + (l))

  50. #undef  CMSG_DATA
  51. #define CMSG_DATA(cmsg)     ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))

  52. #endif


  53. #include <ngx_auto_config.h>


  54. #if (NGX_HAVE_POSIX_SEM)
  55. #include <semaphore.h>
  56. #endif


  57. #if (NGX_HAVE_POLL)
  58. #include <poll.h>
  59. #endif


  60. #if (NGX_HAVE_KQUEUE)
  61. #include <sys/event.h>
  62. #endif


  63. #if (NGX_HAVE_FILE_AIO || NGX_HAVE_AIO)
  64. #include <aio.h>
  65. typedef struct aiocb  ngx_aiocb_t;
  66. #endif


  67. #define NGX_LISTEN_BACKLOG        -1


  68. #ifdef __DragonFly__
  69. #define NGX_KEEPALIVE_FACTOR      1000
  70. #endif


  71. #if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)

  72. pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);

  73. #endif

  74. #ifndef IOV_MAX
  75. #define IOV_MAX   1024
  76. #endif


  77. #ifndef NGX_HAVE_INHERITED_NONBLOCK
  78. #define NGX_HAVE_INHERITED_NONBLOCK  1
  79. #endif


  80. #define NGX_HAVE_OS_SPECIFIC_INIT    1
  81. #define NGX_HAVE_DEBUG_MALLOC        1


  82. extern char **environ;
  83. extern char  *malloc_options;


  84. #endif /* _NGX_FREEBSD_CONFIG_H_INCLUDED_ */