comparison src/os/unix/ngx_os.h @ 0:f0b350454894 NGINX_0_1_0

nginx 0.1.0 *) The first public version.
author Igor Sysoev <http://sysoev.ru>
date Mon, 04 Oct 2004 00:00:00 +0400
parents
children 4b2dafa26fe2
comparison
equal deleted inserted replaced
-1:000000000000 0:f0b350454894
1
2 /*
3 * Copyright (C) Igor Sysoev
4 */
5
6
7 #ifndef _NGX_OS_H_INCLUDED_
8 #define _NGX_OS_H_INCLUDED_
9
10
11 #include <ngx_config.h>
12 #include <ngx_core.h>
13
14
15 #define NGX_IO_SENDFILE 1
16 #define NGX_IO_ZEROCOPY 2
17
18 #if (HAVE_SENDFILE)
19 #define NGX_HAVE_SENDFILE NGX_IO_SENDFILE
20 #else
21 #define NGX_HAVE_SENDFILE 0
22 #endif
23
24 #if (HAVE_ZEROCOPY)
25 #define NGX_HAVE_ZEROCOPY NGX_IO_ZEROCOPY
26 #else
27 #define NGX_HAVE_ZEROCOPY 0
28 #endif
29
30
31 typedef ssize_t (*ngx_recv_pt)(ngx_connection_t *c, u_char *buf, size_t size);
32 typedef ssize_t (*ngx_recv_chain_pt)(ngx_connection_t *c, ngx_chain_t *in);
33 typedef ssize_t (*ngx_send_pt)(ngx_connection_t *c, u_char *buf, size_t size);
34 typedef ngx_chain_t *(*ngx_send_chain_pt)(ngx_connection_t *c, ngx_chain_t *in,
35 off_t limit);
36
37 typedef struct {
38 ngx_recv_pt recv;
39 ngx_recv_chain_pt recv_chain;
40 ngx_send_pt send;
41 ngx_send_chain_pt send_chain;
42 ngx_uint_t flags;
43 } ngx_os_io_t;
44
45
46 void ngx_debug_init();
47 ngx_int_t ngx_os_init(ngx_log_t *log);
48 void ngx_os_status(ngx_log_t *log);
49 ngx_int_t ngx_daemon(ngx_log_t *log);
50 ngx_int_t ngx_posix_init(ngx_log_t *log);
51 void ngx_posix_status(ngx_log_t *log);
52 ngx_int_t ngx_posix_post_conf_init(ngx_log_t *log);
53
54
55 ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
56 ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry);
57 ssize_t ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size);
58 ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in,
59 off_t limit);
60
61
62 extern ngx_os_io_t ngx_os_io;
63 extern ngx_int_t ngx_ncpu;
64 extern ngx_int_t ngx_max_sockets;
65 extern ngx_int_t ngx_inherited_nonblocking;
66
67 #define ngx_stderr_fileno STDERR_FILENO
68
69 #ifdef __FreeBSD__
70 #include <ngx_freebsd.h>
71 #endif
72
73
74 #ifdef __linux__
75 #include <ngx_linux.h>
76 #endif
77
78
79 #ifdef SOLARIS
80 #include <ngx_solaris.h>
81 #endif
82
83
84 #endif /* _NGX_OS_H_INCLUDED_ */