3 * Copyright (C) Igor Sysoev
7 #ifndef _NGX_OS_H_INCLUDED_
8 #define _NGX_OS_H_INCLUDED_
11 #include <ngx_config.h>
15 #define NGX_IO_SENDFILE 1
16 #define NGX_IO_ZEROCOPY 2
19 typedef ssize_t (*ngx_recv_pt
)(ngx_connection_t
*c
, u_char
*buf
, size_t size
);
20 typedef ssize_t (*ngx_recv_chain_pt
)(ngx_connection_t
*c
, ngx_chain_t
*in
);
21 typedef ssize_t (*ngx_send_pt
)(ngx_connection_t
*c
, u_char
*buf
, size_t size
);
22 typedef ngx_chain_t
*(*ngx_send_chain_pt
)(ngx_connection_t
*c
, ngx_chain_t
*in
,
27 ngx_recv_chain_pt recv_chain
;
29 ngx_send_chain_pt send_chain
;
34 void ngx_debug_init();
35 ngx_int_t
ngx_os_init(ngx_log_t
*log
);
36 void ngx_os_status(ngx_log_t
*log
);
37 ngx_int_t
ngx_daemon(ngx_log_t
*log
);
38 ngx_int_t
ngx_posix_init(ngx_log_t
*log
);
39 void ngx_posix_status(ngx_log_t
*log
);
40 ngx_int_t
ngx_posix_post_conf_init(ngx_log_t
*log
);
43 ssize_t
ngx_unix_recv(ngx_connection_t
*c
, u_char
*buf
, size_t size
);
44 ssize_t
ngx_readv_chain(ngx_connection_t
*c
, ngx_chain_t
*entry
);
45 ssize_t
ngx_unix_send(ngx_connection_t
*c
, u_char
*buf
, size_t size
);
46 ngx_chain_t
*ngx_writev_chain(ngx_connection_t
*c
, ngx_chain_t
*in
,
50 extern ngx_os_io_t ngx_os_io
;
51 extern ngx_int_t ngx_ncpu
;
52 extern ngx_int_t ngx_max_sockets
;
53 extern ngx_int_t ngx_inherited_nonblocking
;
55 #define ngx_stderr_fileno STDERR_FILENO
58 #include <ngx_freebsd.h>
62 #include <ngx_linux.h>
66 #include <ngx_solaris.h>
70 #endif /* _NGX_OS_H_INCLUDED_ */