nginx 0.1.11
[nginx-catap.git] / src / os / unix / ngx_os.h
blob42fc886291e26dd97db2d131d5248b37d2110381
2 /*
3 * Copyright (C) Igor Sysoev
4 */
7 #ifndef _NGX_OS_H_INCLUDED_
8 #define _NGX_OS_H_INCLUDED_
11 #include <ngx_config.h>
12 #include <ngx_core.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,
23 off_t limit);
25 typedef struct {
26 ngx_recv_pt recv;
27 ngx_recv_chain_pt recv_chain;
28 ngx_send_pt send;
29 ngx_send_chain_pt send_chain;
30 ngx_uint_t flags;
31 } ngx_os_io_t;
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,
47 off_t limit);
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_uint_t ngx_inherited_nonblocking;
54 extern ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush;
56 #define ngx_stderr_fileno STDERR_FILENO
58 #if (NGX_FREEBSD)
59 #include <ngx_freebsd.h>
62 #elif (NGX_LINUX)
63 #include <ngx_linux.h>
66 #elif (NGX_SOLARIS)
67 #include <ngx_solaris.h>
68 #endif
71 #endif /* _NGX_OS_H_INCLUDED_ */