v / vlib / net / net_nix.c.v
31 lines · 23 sloc · 594 bytes · 3f3a7dc57cc717393daf40dc7d75cff0cf189b0f
Raw
1module net
2
3#include <unistd.h>
4#include <sys/select.h>
5// inet.h is needed for inet_ntop on macos
6#include <arpa/inet.h>
7#include <netdb.h>
8#include <errno.h>
9#include <fcntl.h>
10#include <netinet/tcp.h>
11
12#flag solaris -lsocket
13
14const is_windows = false
15
16pub fn error_code() int {
17 return C.errno
18}
19
20fn init() {
21}
22
23pub const msg_nosignal = C.MSG_NOSIGNAL
24pub const msg_dontwait = C.MSG_DONTWAIT
25
26pub const error_ewouldblock = int(C.EWOULDBLOCK)
27pub const error_einprogress = int(C.EINPROGRESS)
28pub const error_eagain = int(C.EAGAIN)
29pub const error_eintr = int(C.EINTR)
30
31fn C.unlink(&char) i32
32