summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2018-03-19 05:43:41 +0000
committerSitsofe Wheeler <sitsofe@yahoo.com>2018-03-21 22:09:28 +0000
commit8393ca93334319f066ce6abb44d0f4b4921abbe1 (patch)
treeeacde3b02f82c9d8b15f87f2370fcfe35c245808
parent3d2d14bcb844e72809192311369a642c5d415472 (diff)
downloadfio-8393ca93334319f066ce6abb44d0f4b4921abbe1.tar.gz
fio-8393ca93334319f066ce6abb44d0f4b4921abbe1.tar.bz2
Use POSIX path for poll.h and fcntl.h headers
musl complains when using include paths like <sys/poll.h> rather than POSIX's <poll.h> so change the poll.h include path and update the windows poll.h compatibility shim to match. Allegedly sys/poll.h was needed for GLIBCs that were older than 2.3 according to https://www.winehq.org/pipermail/wine-patches/2014-June/132877.html but I can still see that path in an ancient Red Hat 5.0 glibc-devel-2.0.7-32.i386.rpm ... Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
-rw-r--r--client.c2
-rw-r--r--engines/binject.c2
-rw-r--r--engines/net.c2
-rw-r--r--engines/rdma.c2
-rw-r--r--engines/sg.c2
-rw-r--r--engines/splice.c2
-rw-r--r--os/os-hpux.h2
-rw-r--r--os/os-solaris.h2
-rwxr-xr-xos/windows/posix.c2
-rw-r--r--os/windows/posix/include/poll.h11
-rw-r--r--os/windows/posix/include/sys/poll.h15
-rw-r--r--server.c2
12 files changed, 21 insertions, 25 deletions
diff --git a/client.c b/client.c
index 43825d9e..970974a0 100644
--- a/client.c
+++ b/client.c
@@ -3,7 +3,7 @@
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
diff --git a/engines/binject.c b/engines/binject.c
index 792dbbdd..49042a3b 100644
--- a/engines/binject.c
+++ b/engines/binject.c
@@ -11,7 +11,7 @@
#include <errno.h>
#include <assert.h>
#include <string.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/engines/net.c b/engines/net.c
index 9b385b0c..4540e0e4 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -13,7 +13,7 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/engines/rdma.c b/engines/rdma.c
index 6b173a84..8def6eba 100644
--- a/engines/rdma.c
+++ b/engines/rdma.c
@@ -30,7 +30,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
diff --git a/engines/sg.c b/engines/sg.c
index 7b18c28e..3d927eab 100644
--- a/engines/sg.c
+++ b/engines/sg.c
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
#include "../fio.h"
#include "../optgroup.h"
diff --git a/engines/splice.c b/engines/splice.c
index d322f402..08fc8574 100644
--- a/engines/splice.c
+++ b/engines/splice.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/mman.h>
#include "../fio.h"
diff --git a/os/os-hpux.h b/os/os-hpux.h
index 6a240b0d..515a5256 100644
--- a/os/os-hpux.h
+++ b/os/os-hpux.h
@@ -6,7 +6,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/ioctl.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <sys/fadvise.h>
#include <sys/mman.h>
#include <sys/mpctl.h>
diff --git a/os/os-solaris.h b/os/os-solaris.h
index db03546c..2425ab9e 100644
--- a/os/os-solaris.h
+++ b/os/os-solaris.h
@@ -7,7 +7,7 @@
#include <malloc.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <sys/pset.h>
#include <sys/mman.h>
#include <sys/dkio.h>
diff --git a/os/windows/posix.c b/os/windows/posix.c
index 17e18a1f..ecc8c408 100755
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -18,7 +18,7 @@
#include <sys/mman.h>
#include <sys/uio.h>
#include <sys/resource.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/wait.h>
#include <setjmp.h>
diff --git a/os/windows/posix/include/poll.h b/os/windows/posix/include/poll.h
index 058e23ad..f064e2ba 100644
--- a/os/windows/posix/include/poll.h
+++ b/os/windows/posix/include/poll.h
@@ -1,4 +1,15 @@
#ifndef POLL_H
#define POLL_H
+typedef int nfds_t;
+
+struct pollfd
+{
+ int fd;
+ short events;
+ short revents;
+};
+
+int poll(struct pollfd fds[], nfds_t nfds, int timeout);
+
#endif /* POLL_H */
diff --git a/os/windows/posix/include/sys/poll.h b/os/windows/posix/include/sys/poll.h
deleted file mode 100644
index f009d6e4..00000000
--- a/os/windows/posix/include/sys/poll.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SYS_POLL_H
-#define SYS_POLL_H
-
-typedef int nfds_t;
-
-struct pollfd
-{
- int fd;
- short events;
- short revents;
-};
-
-int poll(struct pollfd fds[], nfds_t nfds, int timeout);
-
-#endif /* SYS_POLL_H */
diff --git a/server.c b/server.c
index 6f858109..3592ab17 100644
--- a/server.c
+++ b/server.c
@@ -2,7 +2,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/socket.h>