Update and clean Tomato RAF files
[tomato.git] / release / src / router / nginx / src / os / unix / ngx_os.h
blobc646e2aa5a8a6a856e995d074d53c49977353a11
2 /*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
5 */
8 #ifndef _NGX_OS_H_INCLUDED_
9 #define _NGX_OS_H_INCLUDED_
12 #include <ngx_config.h>
13 #include <ngx_core.h>
16 #define NGX_IO_SENDFILE 1
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_recv_pt udp_recv;
29 ngx_send_pt send;
30 ngx_send_chain_pt send_chain;
31 ngx_uint_t flags;
32 } ngx_os_io_t;
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_os_specific_init(ngx_log_t *log);
38 void ngx_os_specific_status(ngx_log_t *log);
39 ngx_int_t ngx_daemon(ngx_log_t *log);
40 ngx_int_t ngx_os_signal_process(ngx_cycle_t *cycle, char *sig, ngx_int_t pid);
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_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
46 ssize_t ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size);
47 ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in,
48 off_t limit);
50 #if (NGX_HAVE_AIO)
51 ssize_t ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size);
52 ssize_t ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl);
53 ssize_t ngx_aio_write(ngx_connection_t *c, u_char *buf, size_t size);
54 ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
55 off_t limit);
56 #endif
59 extern ngx_os_io_t ngx_os_io;
60 extern ngx_int_t ngx_ncpu;
61 extern ngx_int_t ngx_max_sockets;
62 extern ngx_uint_t ngx_inherited_nonblocking;
63 extern ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush;
66 #if (NGX_FREEBSD)
67 #include <ngx_freebsd.h>
70 #elif (NGX_LINUX)
71 #include <ngx_linux.h>
74 #elif (NGX_SOLARIS)
75 #include <ngx_solaris.h>
78 #elif (NGX_DARWIN)
79 #include <ngx_darwin.h>
80 #endif
83 #endif /* _NGX_OS_H_INCLUDED_ */