Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 1 | #include "harness/winsock.h" |
| 2 | |||
| 3 | #ifndef _WIN32 |
||
| 4 | |||
| 5 | int WSAStartup(int version, WSADATA* data) { |
||
| 6 | // very minimal, we don't care about the arguments |
||
| 7 | return 0; |
||
| 8 | } |
||
| 9 | |||
| 10 | int WSAGetLastError(void) { |
||
| 11 | return errno; |
||
| 12 | } |
||
| 13 | |||
| 14 | int WSACleanup(void) { |
||
| 15 | return 0; |
||
| 16 | } |
||
| 17 | |||
| 18 | // Only implement non-blocking call for now |
||
| 19 | int ioctlsocket(int handle, long cmd, unsigned long* argp) { |
||
| 20 | assert(cmd == FIONBIO); |
||
| 21 | |||
| 22 | int flags = fcntl(handle, F_GETFL); |
||
| 23 | flags |= O_NONBLOCK; |
||
| 24 | return fcntl(handle, F_SETFL, flags); |
||
| 25 | } |
||
| 26 | |||
| 27 | #endif |