nginx-quic/src/os/unix/ngx_socket.h

44 lines
819 B
C
Raw Normal View History

2002-08-16 11:27:03 -04:00
#ifndef _NGX_SOCKET_H_INCLUDED_
#define _NGX_SOCKET_H_INCLUDED_
#include <ngx_config.h>
2003-02-06 14:21:13 -03:00
#ifdef __FreeBSD__
#include <sys/ioctl.h>
#endif
2002-09-12 10:42:29 -04:00
#define NGX_WRITE_SHUTDOWN SHUT_WR
2002-08-16 11:27:03 -04:00
typedef int ngx_socket_t;
2002-08-26 11:18:19 -04:00
#define ngx_socket(af, type, proto, flags) socket(af, type, proto)
#define ngx_socket_n "socket()"
2003-02-06 14:21:13 -03:00
#ifdef __FreeBSD__
int ngx_nonblocking(ngx_socket_t s);
int ngx_blocking(ngx_socket_t s);
#define ngx_nonblocking_n "ioctl(FIONBIO)"
#define ngx_blocking_n "ioctl(!FIONBIO)"
#else
2002-08-16 11:27:03 -04:00
#define ngx_nonblocking(s) fcntl(s, F_SETFL, O_NONBLOCK)
2002-08-26 11:18:19 -04:00
#define ngx_nonblocking_n "fcntl(O_NONBLOCK)"
2002-08-16 11:27:03 -04:00
2003-02-06 14:21:13 -03:00
#endif
2002-09-12 10:42:29 -04:00
#define ngx_shutdown_socket shutdown
#define ngx_shutdown_socket_n "shutdown()"
2002-08-20 10:48:28 -04:00
#define ngx_close_socket close
2002-08-26 11:18:19 -04:00
#define ngx_close_socket_n "close()"
2002-08-20 10:48:28 -04:00
2002-08-16 11:27:03 -04:00
#endif /* _NGX_SOCKET_H_INCLUDED_ */