0
|
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
|
|
17
|
|
18 typedef ssize_t (*ngx_recv_pt)(ngx_connection_t *c, u_char *buf, size_t size);
|
|
19 typedef ssize_t (*ngx_recv_chain_pt)(ngx_connection_t *c, ngx_chain_t *in);
|
|
20 typedef ssize_t (*ngx_send_pt)(ngx_connection_t *c, u_char *buf, size_t size);
|
|
21 typedef ngx_chain_t *(*ngx_send_chain_pt)(ngx_connection_t *c, ngx_chain_t *in,
|
42
|
22 off_t limit);
|
0
|
23
|
|
24 typedef struct {
|
|
25 ngx_recv_pt recv;
|
|
26 ngx_recv_chain_pt recv_chain;
|
354
|
27 ngx_recv_pt udp_recv;
|
0
|
28 ngx_send_pt send;
|
|
29 ngx_send_chain_pt send_chain;
|
|
30 ngx_uint_t flags;
|
|
31 } ngx_os_io_t;
|
|
32
|
|
33
|
|
34 ngx_int_t ngx_os_init(ngx_log_t *log);
|
|
35 void ngx_os_status(ngx_log_t *log);
|
88
|
36 ngx_int_t ngx_os_specific_init(ngx_log_t *log);
|
|
37 void ngx_os_specific_status(ngx_log_t *log);
|
0
|
38 ngx_int_t ngx_daemon(ngx_log_t *log);
|
482
|
39 ngx_int_t ngx_os_signal_process(ngx_cycle_t *cycle, char *sig, ngx_int_t pid);
|
0
|
40
|
|
41
|
|
42 ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
|
|
43 ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry);
|
354
|
44 ssize_t ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
|
0
|
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,
|
42
|
47 off_t limit);
|
0
|
48
|
518
|
49 #if (NGX_HAVE_AIO)
|
|
50 ssize_t ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size);
|
|
51 ssize_t ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl);
|
|
52 ssize_t ngx_aio_write(ngx_connection_t *c, u_char *buf, size_t size);
|
|
53 ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
|
|
54 off_t limit);
|
|
55 #endif
|
|
56
|
0
|
57
|
|
58 extern ngx_os_io_t ngx_os_io;
|
|
59 extern ngx_int_t ngx_ncpu;
|
|
60 extern ngx_int_t ngx_max_sockets;
|
22
|
61 extern ngx_uint_t ngx_inherited_nonblocking;
|
|
62 extern ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush;
|
0
|
63
|
|
64
|
4
|
65 #if (NGX_FREEBSD)
|
0
|
66 #include <ngx_freebsd.h>
|
|
67
|
|
68
|
4
|
69 #elif (NGX_LINUX)
|
0
|
70 #include <ngx_linux.h>
|
|
71
|
|
72
|
4
|
73 #elif (NGX_SOLARIS)
|
0
|
74 #include <ngx_solaris.h>
|
390
|
75
|
|
76
|
|
77 #elif (NGX_DARWIN)
|
|
78 #include <ngx_darwin.h>
|
0
|
79 #endif
|
|
80
|
|
81
|
|
82 #endif /* _NGX_OS_H_INCLUDED_ */
|