nginx 0.1.9
[nginx-catap.git] / src / os / unix / ngx_os.h
blobee91df3361a299eca3f993b8b49d4b71c2db7346
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_int_t ngx_inherited_nonblocking;
55 #define ngx_stderr_fileno STDERR_FILENO
57 #if (NGX_FREEBSD)
58 #include <ngx_freebsd.h>
61 #elif (NGX_LINUX)
62 #include <ngx_linux.h>
65 #elif (NGX_SOLARIS)
66 #include <ngx_solaris.h>
67 #endif
70 #endif /* _NGX_OS_H_INCLUDED_ */