1 | module 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 | |
11 | #flag solaris -lsocket |
12 | |
13 | const is_windows = false |
14 | |
15 | fn error_code() int { |
16 | return C.errno |
17 | } |
18 | |
19 | fn init() { |
20 | } |
21 | |
22 | pub const ( |
23 | msg_nosignal = 0x4000 |
24 | ) |
25 | |
26 | const ( |
27 | error_ewouldblock = C.EWOULDBLOCK |
28 | error_einprogress = C.EINPROGRESS |
29 | ) |