Annotation of embedaddon/nginx/src/os/unix/ngx_socket.h, revision 1.1.1.1
1.1 misho 1:
2: /*
3: * Copyright (C) Igor Sysoev
4: * Copyright (C) Nginx, Inc.
5: */
6:
7:
8: #ifndef _NGX_SOCKET_H_INCLUDED_
9: #define _NGX_SOCKET_H_INCLUDED_
10:
11:
12: #include <ngx_config.h>
13:
14:
15: #define NGX_WRITE_SHUTDOWN SHUT_WR
16:
17: typedef int ngx_socket_t;
18:
19: #define ngx_socket socket
20: #define ngx_socket_n "socket()"
21:
22:
23: #if (NGX_HAVE_FIONBIO)
24:
25: int ngx_nonblocking(ngx_socket_t s);
26: int ngx_blocking(ngx_socket_t s);
27:
28: #define ngx_nonblocking_n "ioctl(FIONBIO)"
29: #define ngx_blocking_n "ioctl(!FIONBIO)"
30:
31: #else
32:
33: #define ngx_nonblocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK)
34: #define ngx_nonblocking_n "fcntl(O_NONBLOCK)"
35:
36: #define ngx_blocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK)
37: #define ngx_blocking_n "fcntl(!O_NONBLOCK)"
38:
39: #endif
40:
41: int ngx_tcp_nopush(ngx_socket_t s);
42: int ngx_tcp_push(ngx_socket_t s);
43:
44: #if (NGX_LINUX)
45:
46: #define ngx_tcp_nopush_n "setsockopt(TCP_CORK)"
47: #define ngx_tcp_push_n "setsockopt(!TCP_CORK)"
48:
49: #else
50:
51: #define ngx_tcp_nopush_n "setsockopt(TCP_NOPUSH)"
52: #define ngx_tcp_push_n "setsockopt(!TCP_NOPUSH)"
53:
54: #endif
55:
56:
57: #define ngx_shutdown_socket shutdown
58: #define ngx_shutdown_socket_n "shutdown()"
59:
60: #define ngx_close_socket close
61: #define ngx_close_socket_n "close() socket"
62:
63:
64: #endif /* _NGX_SOCKET_H_INCLUDED_ */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>