mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
nginx-0.0.1-2003-05-21-17:28:21 import
This commit is contained in:
@@ -4,218 +4,59 @@
|
||||
|
||||
#include <ngx_auto_config.h>
|
||||
|
||||
/*
|
||||
auto_conf
|
||||
ngx_inline inline __inline __inline__
|
||||
*/
|
||||
|
||||
/* STUB */
|
||||
#if defined __FreeBSD__
|
||||
#include <ngx_freebsd_config.h>
|
||||
|
||||
|
||||
#elif defined __linux__
|
||||
#include <ngx_linux_config.h>
|
||||
|
||||
|
||||
/* Solaris */
|
||||
#elif defined(sun) && (defined(__svr4__) || defined(__SVR4))
|
||||
#include <ngx_solaris_config.h>
|
||||
|
||||
|
||||
#elif defined _WIN32
|
||||
|
||||
/* STUB to allocate a big ngx_connections */
|
||||
#undef FD_SETSIZE
|
||||
#define FD_SETSIZE 1024
|
||||
|
||||
#include <ngx_win32_config.h>
|
||||
|
||||
/* auto_conf */
|
||||
#define NGX_ALIGN (4 - 1)
|
||||
#define NGX_ALIGN_TYPE unsigned
|
||||
|
||||
#define ngx_align(p) (char *) (((NGX_ALIGN_TYPE) p + NGX_ALIGN) & ~NGX_ALIGN)
|
||||
#else /* posix */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Platform specific: array[NGX_INVALID_ARRAY_INDEX] should cause SIGSEGV */
|
||||
/* TODO: platform specific: array[NGX_INVALID_ARRAY_INDEX] must cause SIGSEGV */
|
||||
#define NGX_INVALID_ARRAY_INDEX 0x80000000
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
/* TODO: auto_conf */
|
||||
#define NGX_ALIGN (4 - 1)
|
||||
#define NGX_ALIGN_TYPE (unsigned int)
|
||||
|
||||
#define WIN32 1
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <mswsock.h>
|
||||
#include <stddef.h> /* offsetof */
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#define ngx_inline __inline
|
||||
|
||||
|
||||
#ifndef HAVE_INHERITED_NONBLOCK
|
||||
#define HAVE_INHERITED_NONBLOCK 1
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WIN32_TRANSMITPACKETS
|
||||
#define HAVE_WIN32_TRANSMITPACKETS 1
|
||||
#define HAVE_WIN32_TRANSMITFILE 0
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_WIN32_TRANSMITFILE
|
||||
#define HAVE_WIN32_TRANSMITFILE 1
|
||||
#endif
|
||||
|
||||
#if (HAVE_WIN32_TRANSMITPACKETS) || (HAVE_WIN32_TRANSMITFILE)
|
||||
#define HAVE_SENDFILE 1
|
||||
#endif
|
||||
|
||||
#else /* POSIX */
|
||||
|
||||
|
||||
|
||||
/* Solaris */
|
||||
#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
|
||||
|
||||
#define SOLARIS 1
|
||||
|
||||
#define _FILE_OFFSET_BITS 64 /* should be before sys/types.h */
|
||||
|
||||
#ifndef HAVE_INHERITED_NONBLOCK
|
||||
#define HAVE_INHERITED_NONBLOCK 1
|
||||
#endif
|
||||
|
||||
#include <sys/stropts.h> /* INFTIM */
|
||||
|
||||
#endif /* Solaris */
|
||||
|
||||
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stddef.h> /* offsetof */
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/resource.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
|
||||
#ifndef HAVE_POLL
|
||||
#define HAVE_POLL 1
|
||||
#include <poll.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if (HAVE_DEVPOLL) && !(TEST_DEVPOLL)
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/devpoll.h> /* Solaris, HP/UX */
|
||||
#endif
|
||||
|
||||
|
||||
#if (HAVE_AIO)
|
||||
#include <aio.h>
|
||||
#endif
|
||||
#define ngx_align(p) (char *) ((NGX_ALIGN_TYPE p + NGX_ALIGN) & ~NGX_ALIGN)
|
||||
|
||||
|
||||
/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
|
||||
#ifndef ngx_inline
|
||||
#define ngx_inline inline
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* POSIX */
|
||||
|
||||
|
||||
|
||||
#define LF 10
|
||||
#define CR 13
|
||||
#define CRLF "\x0d\x0a"
|
||||
|
||||
#ifndef INADDR_NONE /* Solaris */
|
||||
#define INADDR_NONE ((unsigned long) -1)
|
||||
#endif
|
||||
|
||||
#ifndef INET_ADDRSTRLEN
|
||||
#define INET_ADDRSTRLEN 16
|
||||
#endif
|
||||
|
||||
|
||||
#if defined SO_ACCEPTFILTER || defined TCP_DEFER_ACCEPT
|
||||
|
||||
#ifndef HAVE_DEFERRED_ACCEPT
|
||||
#define HAVE_DEFERRED_ACCEPT 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HAVE_SELECT
|
||||
#define HAVE_SELECT 1
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
#include <osreldate.h>
|
||||
|
||||
#ifndef HAVE_INHERITED_NONBLOCK
|
||||
#define HAVE_INHERITED_NONBLOCK 1
|
||||
#endif
|
||||
|
||||
/* FreeBSD sendfile */
|
||||
#if __FreeBSD_version >= 300007
|
||||
|
||||
#ifndef HAVE_FREEBSD_SENDFILE
|
||||
#define HAVE_FREEBSD_SENDFILE 1
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
|
||||
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 2
|
||||
#endif
|
||||
|
||||
#endif /* FreeBSD sendfile */
|
||||
|
||||
/* FreeBSD sendfile nbytes bug */
|
||||
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 460100) \
|
||||
|| __FreeBSD_version == 460001 \
|
||||
|| __FreeBSD_version >= 500029
|
||||
|
||||
#if (HAVE_FREEBSD_SENDFILE_NBYTES_BUG == 2)
|
||||
#undef HAVE_FREEBSD_SENDFILE_NBYTES_BUG
|
||||
#define HAVE_FREEBSD_SENDFILE_NBYTES_BUG 0
|
||||
#endif
|
||||
|
||||
#endif /* FreeBSD sendfile nbytes bug */
|
||||
|
||||
#if (HAVE_FREEBSD_SENDFILE)
|
||||
#define HAVE_SENDFILE 1
|
||||
#endif
|
||||
|
||||
|
||||
/* FreeBSD kqueue */
|
||||
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 410000) \
|
||||
|| __FreeBSD_version >= 500011
|
||||
|
||||
#ifndef HAVE_KQUEUE
|
||||
#define HAVE_KQUEUE 1
|
||||
#include <sys/event.h>
|
||||
#endif
|
||||
|
||||
/* kqueue's NOTE_LOWAT */
|
||||
#if (__FreeBSD__ == 4 && __FreeBSD_version >= 430000) \
|
||||
|| __FreeBSD_version >= 500018
|
||||
|
||||
#ifndef HAVE_LOWAT_EVENT
|
||||
#define HAVE_LOWAT_EVENT 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FreeBSD kqueue */
|
||||
|
||||
|
||||
#endif /* __FreeBSD__ */
|
||||
|
||||
|
||||
#ifdef __SOME_OS_TEMPLATE__
|
||||
|
||||
#ifndef HAVE_INHERITED_NONBLOCK
|
||||
#define HAVE_INHERITED_NONBLOCK 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _NGX_CONFIG_H_INCLUDED_ */
|
||||
|
||||
Reference in New Issue
Block a user