Use POSIX path for poll.h and fcntl.h headers
authorSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 19 Mar 2018 05:43:41 +0000 (05:43 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 21 Mar 2018 22:09:28 +0000 (22:09 +0000)
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>
12 files changed:
client.c
engines/binject.c
engines/net.c
engines/rdma.c
engines/sg.c
engines/splice.c
os/os-hpux.h
os/os-solaris.h
os/windows/posix.c
os/windows/posix/include/poll.h
os/windows/posix/include/sys/poll.h [deleted file]
server.c

index 43825d9..970974a 100644 (file)
--- 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>
index 792dbbd..49042a3 100644 (file)
@@ -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>
 
index 9b385b0..4540e0e 100644 (file)
@@ -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>
index 6b173a8..8def6eb 100644 (file)
@@ -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>
index 7b18c28..3d927ea 100644 (file)
@@ -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"
index d322f40..08fc857 100644 (file)
@@ -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"
index 6a240b0..515a525 100644 (file)
@@ -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>
index db03546..2425ab9 100644 (file)
@@ -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>
index 17e18a1..ecc8c40 100755 (executable)
@@ -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>
 
index 058e23a..f064e2b 100644 (file)
@@ -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 (file)
index f009d6e..0000000
+++ /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 */
index 6f85810..3592ab1 100644 (file)
--- 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>