Use ioctlsocket() instead of ioctl() so that we can import ws2_32.dll