blob: 980e05d673347b2742a22ae02c7eed238ac82fca [file] [log] [blame]
Igor Sysoevd90282d2004-09-28 08:34:51 +00001
2/*
Igor Sysoevff8da912004-09-29 16:00:49 +00003 * Copyright (C) Igor Sysoev
Igor Sysoevd90282d2004-09-28 08:34:51 +00004 */
5
6
Igor Sysoevfa73aac2003-05-21 13:28:21 +00007#ifndef _NGX_LINUX_CONFIG_H_INCLUDED_
8#define _NGX_LINUX_CONFIG_H_INCLUDED_
9
10
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000011#ifndef _GNU_SOURCE
Igor Sysoeva8fa0a62003-11-25 20:44:56 +000012#define _GNU_SOURCE /* pread(), pwrite(), gethostname() */
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000013#endif
Igor Sysoeve4a25262003-06-06 14:59:20 +000014
Igor Sysoev9cf78302003-06-04 17:28:33 +000015#define _FILE_OFFSET_BITS 64
Igor Sysoev6a1cc902003-05-22 15:23:47 +000016
Igor Sysoevfa73aac2003-05-21 13:28:21 +000017#include <sys/types.h>
Igor Sysoev6a1cc902003-05-22 15:23:47 +000018#include <sys/time.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000019#include <unistd.h>
20#include <stdarg.h>
21#include <stddef.h> /* offsetof() */
22#include <stdio.h>
23#include <stdlib.h>
24#include <errno.h>
25#include <string.h>
26#include <signal.h>
Igor Sysoevcada4ee2004-01-28 15:22:37 +000027#include <pwd.h>
28#include <grp.h>
Igor Sysoevcada4ee2004-01-28 15:22:37 +000029#include <dirent.h>
Igor Sysoev97c2f462006-10-02 08:46:45 +000030#include <glob.h>
Igor Sysoev6a1cc902003-05-22 15:23:47 +000031
Igor Sysoevd09f7a12004-06-15 17:47:16 +000032#include <sys/uio.h>
33#include <sys/stat.h>
34#include <fcntl.h>
35
36#include <sys/wait.h>
37#include <sys/mman.h>
38#include <sys/resource.h>
Igor Sysoev46cd7c22004-07-02 05:47:00 +000039#include <sched.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000040
41#include <sys/socket.h>
42#include <netinet/in.h>
Igor Sysoev924bd792004-10-11 15:07:03 +000043#include <netinet/tcp.h> /* TCP_NODELAY, TCP_CORK */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000044#include <arpa/inet.h>
45#include <netdb.h>
Igor Sysoev02025fd2005-01-18 13:03:58 +000046#include <sys/un.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000047
48#include <time.h> /* tzset() */
Igor Sysoev1b735832004-11-11 14:07:14 +000049#include <malloc.h> /* memalign() */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000050#include <sys/ioctl.h>
51#include <sys/sysctl.h>
Igor Sysoev4d656dc2005-03-22 16:02:46 +000052#include <crypt.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000053
54
Igor Sysoev25b36fe2004-02-03 16:43:54 +000055#include <ngx_auto_config.h>
56
Igor Sysoev7af6b162004-02-09 07:46:43 +000057
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000058#if (NGX_HAVE_SYS_PRCTL_H)
Igor Sysoev7af6b162004-02-09 07:46:43 +000059#include <sys/prctl.h>
60#endif
61
Igor Sysoevf6906042004-11-25 16:17:31 +000062
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000063#if (NGX_HAVE_SENDFILE64)
Igor Sysoev25b36fe2004-02-03 16:43:54 +000064#include <sys/sendfile.h>
65#else
66extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
Igor Sysoev069899b2004-11-26 09:33:59 +000067#define NGX_SENDFILE_LIMIT 0x80000000
Igor Sysoev25b36fe2004-02-03 16:43:54 +000068#endif
69
Igor Sysoev6a1cc902003-05-22 15:23:47 +000070
Igor Sysoevf6906042004-11-25 16:17:31 +000071#if (NGX_HAVE_POLL)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000072#include <poll.h>
73#endif
74
Igor Sysoevd43bee82004-11-20 19:52:20 +000075
Igor Sysoevf6906042004-11-25 16:17:31 +000076#if (NGX_HAVE_EPOLL)
Igor Sysoeva4b16df2004-02-02 21:19:52 +000077#include <sys/epoll.h>
Igor Sysoevfa73aac2003-05-21 13:28:21 +000078#endif
79
80
Igor Sysoevf6906042004-11-25 16:17:31 +000081#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
82#define NGX_HAVE_DEFERRED_ACCEPT 1
Igor Sysoevfa73aac2003-05-21 13:28:21 +000083#endif
84
85
Igor Sysoev6a12fc92004-12-06 14:45:08 +000086#ifndef NGX_HAVE_SO_SNDLOWAT
87/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
88#define NGX_HAVE_SO_SNDLOWAT 0
89#endif
90
91
Igor Sysoev5192b362005-07-08 14:34:20 +000092#ifndef NGX_HAVE_GNU_CRYPT_R
93#define NGX_HAVE_GNU_CRYPT_R 1
94#endif
95
96
Igor Sysoevf6906042004-11-25 16:17:31 +000097#ifndef NGX_HAVE_INHERITED_NONBLOCK
98#define NGX_HAVE_INHERITED_NONBLOCK 0
99#endif
100
101
Igor Sysoevceb99292005-09-06 16:09:32 +0000102#define NGX_HAVE_OS_SPECIFIC_INIT 1
103
104
Igor Sysoevae33d012006-01-17 20:04:32 +0000105extern char **environ;
106
107
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000108#endif /* _NGX_LINUX_CONFIG_H_INCLUDED_ */