comparison src/os/unix/ngx_os.h @ 183:4c698194c56d

nginx-0.0.1-2003-11-13-19:16:33 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 13 Nov 2003 16:16:33 +0000
parents
children 1bf718ce0dde
comparison
equal deleted inserted replaced
182:3c49eaf3f522 183:4c698194c56d
1 #ifndef _NGX_OS_H_INCLUDED_
2 #define _NGX_OS_H_INCLUDED_
3
4
5 #include <ngx_config.h>
6 #include <ngx_core.h>
7
8
9 #define NGX_IO_SENDFILE 1
10 #define NGX_IO_ZEROCOPY 2
11
12 #if (HAVE_SENDFILE)
13 #define NGX_HAVE_SENDFILE NGX_IO_SENDFILE
14 #else
15 #define NGX_HAVE_SENDFILE 0
16 #endif
17
18 #if (HAVE_ZEROCOPY)
19 #define NGX_HAVE_ZEROCOPY NGX_IO_ZEROCOPY
20 #else
21 #define NGX_HAVE_ZEROCOPY 0
22 #endif
23
24
25
26 typedef struct {
27 ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
28 ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
29 ssize_t (*send)(ngx_connection_t *c, char *buf, size_t size);
30 ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
31 int flags;
32 } ngx_os_io_t;
33
34
35 int ngx_os_init(ngx_log_t *log);
36 int ngx_daemon(ngx_log_t *log);
37 int ngx_posix_init(ngx_log_t *log);
38
39 ssize_t ngx_unix_recv(ngx_connection_t *c, char *buf, size_t size);
40 ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry);
41 ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in);
42
43
44 extern ngx_os_io_t ngx_os_io;
45 extern int ngx_max_sockets;
46 extern int ngx_inherited_nonblocking;
47
48
49 extern int restart;
50 extern int rotate;
51
52
53 #ifdef __FreeBSD__
54 #include <ngx_freebsd.h>
55 #endif
56
57
58 #endif /* _NGX_OS_H_INCLUDED_ */