comparison src/os/unix/ngx_socket.c @ 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
children 738fe44c70d5
comparison
equal deleted inserted replaced
58:6b13b1cadabe 59:e8cdc2989cee
1
2 #include <ngx_socket.h>
3
4
5 /* ioctl(FIONBIO) set blocking mode with one syscall only while
6 fcntl(F_SETFL, ~O_NONBLOCK) need to know previous state
7 using fcntl(F_GETFL).
8 On FreeBSD both are syscall */
9
10 #ifdef __FreeBSD__
11
12 int ngx_nonblocking(ngx_socket_t s)
13 {
14 unsigned long nb = 1;
15
16 return ioctl(s, FIONBIO, &nb);
17 }
18
19 int ngx_blocking(ngx_socket_t s)
20 {
21 unsigned long nb = 0;
22
23 return ioctl(s, FIONBIO, &nb);
24 }
25
26 #endif