diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/os-windows.h | 9 | ||||
-rwxr-xr-x | os/windows/posix.c | 9 | ||||
-rw-r--r-- | os/windows/posix/include/arpa/inet.h | 13 |
3 files changed, 26 insertions, 5 deletions
diff --git a/os/os-windows.h b/os/os-windows.h index 4f4e2bb3..de120b64 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -18,6 +18,10 @@ #include "windows/posix.h" +#ifndef PTHREAD_STACK_MIN +#define PTHREAD_STACK_MIN 65535 +#endif + #define FIO_HAVE_ODIRECT #define FIO_HAVE_CPU_AFFINITY #define FIO_HAVE_CHARDEV_SIZE @@ -38,9 +42,6 @@ typedef DWORD_PTR os_cpu_mask_t; -#define CLOCK_REALTIME 1 -#define CLOCK_MONOTONIC 2 - #define _SC_PAGESIZE 0x1 #define _SC_NPROCESSORS_ONLN 0x2 #define _SC_PHYS_PAGES 0x4 @@ -115,7 +116,6 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) HANDLE hFile; GET_LENGTH_INFORMATION info; DWORD outBytes; - LARGE_INTEGER size; if (f->hFile == NULL) { hFile = CreateFile(f->file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -124,7 +124,6 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) hFile = f->hFile; } - size.QuadPart = 0; if (DeviceIoControl(hFile, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &outBytes, NULL)) *bytes = info.Length.QuadPart; else diff --git a/os/windows/posix.c b/os/windows/posix.c index 49bce439..8153b455 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -12,6 +12,7 @@ #include <unistd.h> #include <dirent.h> #include <pthread.h> +#include <time.h> #include <semaphore.h> #include <sys/shm.h> #include <sys/mman.h> @@ -872,6 +873,14 @@ uid_t geteuid(void) return -1; } +in_addr_t inet_network(const char *cp) +{ + in_addr_t hbo; + in_addr_t nbo = inet_addr(cp); + hbo = ((nbo & 0xFF) << 24) + ((nbo & 0xFF00) << 8) + ((nbo & 0xFF0000) >> 8) + ((nbo & 0xFF000000) >> 24); + return hbo; +} + const char* inet_ntop(int af, const void *restrict src, char *restrict dst, socklen_t size) { diff --git a/os/windows/posix/include/arpa/inet.h b/os/windows/posix/include/arpa/inet.h index 7e3bfb7e..59c50ad1 100644 --- a/os/windows/posix/include/arpa/inet.h +++ b/os/windows/posix/include/arpa/inet.h @@ -5,6 +5,19 @@ #include <inttypes.h> typedef int socklen_t; +typedef int in_addr_t; + +#define IP_MULTICAST_IF 2 +#define IP_MULTICAST_TTL 3 +#define IP_ADD_MEMBERSHIP 5 + +struct ip_mreq +{ + struct in_addr imr_multiaddr; + struct in_addr imr_interface; +}; + +in_addr_t inet_network(const char *cp); const char *inet_ntop(int af, const void *restrict src, char *restrict dst, socklen_t size); |