summaryrefslogtreecommitdiff
path: root/os/windows/posix/include
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2018-03-25 20:56:07 +0100
committerSitsofe Wheeler <sitsofe@yahoo.com>2018-03-27 20:18:38 +0100
commita6ab5391edbc87bdf1e5c0d218ccf7d8325a8c55 (patch)
treeaefea32d4604160fbcf1b96822050773ef1a9ef3 /os/windows/posix/include
parentdac7244bf482557c2e46aac1171c3890b3d9316f (diff)
downloadfio-a6ab5391edbc87bdf1e5c0d218ccf7d8325a8c55.tar.gz
fio-a6ab5391edbc87bdf1e5c0d218ccf7d8325a8c55.tar.bz2
windows: target Windows 7 and add support for more than 64 CPUs
Introduce support for targeting the build to either Windows XP or Windows 7 (the default). When targeting Windows 7 this allows us to use the process group APIs which are required are required to support more than 64 CPUs. These changes mean if you want a Windows binary that supports versions of Windows below Windows 7/Windows Server 2008 R2 you will need to explicitly use the --target-win-ver=xp configure option at build time. Such builds will lack features (such as the ability to access CPUs beyond those in fio's default process group) that are dependent on recent Windows APIs. Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Diffstat (limited to 'os/windows/posix/include')
-rw-r--r--os/windows/posix/include/arpa/inet.h2
-rw-r--r--os/windows/posix/include/poll.h8
2 files changed, 8 insertions, 2 deletions
diff --git a/os/windows/posix/include/arpa/inet.h b/os/windows/posix/include/arpa/inet.h
index 30498c67..056f1dd5 100644
--- a/os/windows/posix/include/arpa/inet.h
+++ b/os/windows/posix/include/arpa/inet.h
@@ -12,8 +12,10 @@ typedef int in_addr_t;
in_addr_t inet_network(const char *cp);
+#ifdef CONFIG_WINDOWS_XP
const char *inet_ntop(int af, const void *restrict src,
char *restrict dst, socklen_t size);
int inet_pton(int af, const char *restrict src, void *restrict dst);
+#endif
#endif /* ARPA_INET_H */
diff --git a/os/windows/posix/include/poll.h b/os/windows/posix/include/poll.h
index 21e5699b..25b8183f 100644
--- a/os/windows/posix/include/poll.h
+++ b/os/windows/posix/include/poll.h
@@ -1,8 +1,11 @@
#ifndef POLL_H
#define POLL_H
+#include <winsock2.h>
+
typedef int nfds_t;
+#ifdef CONFIG_WINDOWS_XP
struct pollfd
{
int fd;
@@ -10,11 +13,12 @@ struct pollfd
short revents;
};
-int poll(struct pollfd fds[], nfds_t nfds, int timeout);
-
#define POLLOUT 1
#define POLLIN 2
#define POLLERR 0
#define POLLHUP 1
+#endif /* CONFIG_WINDOWS_XP */
+
+int poll(struct pollfd fds[], nfds_t nfds, int timeout);
#endif /* POLL_H */