comparison src/os/unix/ngx_socket.h @ 59:e8cdc2989cee

nginx-0.0.1-2003-02-06-20:21:13 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 06 Feb 2003 17:21:13 +0000
parents 6b13b1cadabe
children 738fe44c70d5
comparison
equal deleted inserted replaced
58:6b13b1cadabe 59:e8cdc2989cee
1 #ifndef _NGX_SOCKET_H_INCLUDED_ 1 #ifndef _NGX_SOCKET_H_INCLUDED_
2 #define _NGX_SOCKET_H_INCLUDED_ 2 #define _NGX_SOCKET_H_INCLUDED_
3 3
4 4
5 #include <ngx_config.h> 5 #include <ngx_config.h>
6
7 #ifdef __FreeBSD__
8 #include <sys/ioctl.h>
9 #endif
10
6 11
7 #define NGX_WRITE_SHUTDOWN SHUT_WR 12 #define NGX_WRITE_SHUTDOWN SHUT_WR
8 13
9 typedef int ngx_socket_t; 14 typedef int ngx_socket_t;
10 15
11 #define ngx_socket(af, type, proto, flags) socket(af, type, proto) 16 #define ngx_socket(af, type, proto, flags) socket(af, type, proto)
12 #define ngx_socket_n "socket()" 17 #define ngx_socket_n "socket()"
13 18
19
20 #ifdef __FreeBSD__
21
22 int ngx_nonblocking(ngx_socket_t s);
23 int ngx_blocking(ngx_socket_t s);
24
25 #define ngx_nonblocking_n "ioctl(FIONBIO)"
26 #define ngx_blocking_n "ioctl(!FIONBIO)"
27
28 #else
29
14 #define ngx_nonblocking(s) fcntl(s, F_SETFL, O_NONBLOCK) 30 #define ngx_nonblocking(s) fcntl(s, F_SETFL, O_NONBLOCK)
15 #define ngx_nonblocking_n "fcntl(O_NONBLOCK)" 31 #define ngx_nonblocking_n "fcntl(O_NONBLOCK)"
32
33 #endif
34
16 35
17 #define ngx_shutdown_socket shutdown 36 #define ngx_shutdown_socket shutdown
18 #define ngx_shutdown_socket_n "shutdown()" 37 #define ngx_shutdown_socket_n "shutdown()"
19 38
20 #define ngx_close_socket close 39 #define ngx_close_socket close