blob: cf45e54a19170317c45f37922c93a90532004cd3 [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 Sysoev1be74192009-03-30 07:43:06 +000031#include <sys/vfs.h> /* statfs() */
Igor Sysoev6a1cc902003-05-22 15:23:47 +000032
Igor Sysoevd09f7a12004-06-15 17:47:16 +000033#include <sys/uio.h>
34#include <sys/stat.h>
35#include <fcntl.h>
36
37#include <sys/wait.h>
38#include <sys/mman.h>
39#include <sys/resource.h>
Igor Sysoev46cd7c22004-07-02 05:47:00 +000040#include <sched.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000041
42#include <sys/socket.h>
43#include <netinet/in.h>
Igor Sysoev924bd792004-10-11 15:07:03 +000044#include <netinet/tcp.h> /* TCP_NODELAY, TCP_CORK */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000045#include <arpa/inet.h>
46#include <netdb.h>
Igor Sysoev02025fd2005-01-18 13:03:58 +000047#include <sys/un.h>
Igor Sysoevd09f7a12004-06-15 17:47:16 +000048
49#include <time.h> /* tzset() */
Igor Sysoev1b735832004-11-11 14:07:14 +000050#include <malloc.h> /* memalign() */
Igor Sysoevccd55fc2008-05-20 13:45:07 +000051#include <limits.h> /* IOV_MAX */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000052#include <sys/ioctl.h>
53#include <sys/sysctl.h>
Igor Sysoev4d656dc2005-03-22 16:02:46 +000054#include <crypt.h>
Igor Sysoev4724f2b2007-10-26 16:38:53 +000055#include <sys/utsname.h> /* uname() */
Igor Sysoevd09f7a12004-06-15 17:47:16 +000056
57
Igor Sysoev25b36fe2004-02-03 16:43:54 +000058#include <ngx_auto_config.h>
59
Igor Sysoev7af6b162004-02-09 07:46:43 +000060
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000061#if (NGX_HAVE_SYS_PRCTL_H)
Igor Sysoev7af6b162004-02-09 07:46:43 +000062#include <sys/prctl.h>
63#endif
64
Igor Sysoevf6906042004-11-25 16:17:31 +000065
Igor Sysoevc0edbcc2004-10-21 15:34:38 +000066#if (NGX_HAVE_SENDFILE64)
Igor Sysoev25b36fe2004-02-03 16:43:54 +000067#include <sys/sendfile.h>
68#else
69extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
Igor Sysoev069899b2004-11-26 09:33:59 +000070#define NGX_SENDFILE_LIMIT 0x80000000
Igor Sysoev25b36fe2004-02-03 16:43:54 +000071#endif
72
Igor Sysoev6a1cc902003-05-22 15:23:47 +000073
Igor Sysoev5d6ca1e2008-03-12 19:34:36 +000074#if (NGX_HAVE_POLL || NGX_HAVE_RTSIG)
Igor Sysoevfa73aac2003-05-21 13:28:21 +000075#include <poll.h>
76#endif
77
Igor Sysoevd43bee82004-11-20 19:52:20 +000078
Igor Sysoevf6906042004-11-25 16:17:31 +000079#if (NGX_HAVE_EPOLL)
Igor Sysoeva4b16df2004-02-02 21:19:52 +000080#include <sys/epoll.h>
Igor Sysoevfa73aac2003-05-21 13:28:21 +000081#endif
82
83
Igor Sysoeva9625062009-08-28 08:12:35 +000084#if (NGX_HAVE_FILE_AIO)
85#include <sys/syscall.h>
86#include <linux/aio_abi.h>
87typedef struct iocb ngx_aiocb_t;
88#endif
89
90
Igor Sysoev031a6e22007-08-09 13:32:21 +000091#define NGX_LISTEN_BACKLOG 511
92
93
Igor Sysoevf6906042004-11-25 16:17:31 +000094#if defined TCP_DEFER_ACCEPT && !defined NGX_HAVE_DEFERRED_ACCEPT
95#define NGX_HAVE_DEFERRED_ACCEPT 1
Igor Sysoevfa73aac2003-05-21 13:28:21 +000096#endif
97
98
Igor Sysoev6a12fc92004-12-06 14:45:08 +000099#ifndef NGX_HAVE_SO_SNDLOWAT
100/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
101#define NGX_HAVE_SO_SNDLOWAT 0
102#endif
103
104
Igor Sysoevf6906042004-11-25 16:17:31 +0000105#ifndef NGX_HAVE_INHERITED_NONBLOCK
106#define NGX_HAVE_INHERITED_NONBLOCK 0
107#endif
108
109
Igor Sysoevceb99292005-09-06 16:09:32 +0000110#define NGX_HAVE_OS_SPECIFIC_INIT 1
111
112
Igor Sysoevae33d012006-01-17 20:04:32 +0000113extern char **environ;
114
115
Igor Sysoevfa73aac2003-05-21 13:28:21 +0000116#endif /* _NGX_LINUX_CONFIG_H_INCLUDED_ */