summaryrefslogtreecommitdiff
path: root/src/libunixonacid
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-02-19 16:23:24 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-02-19 16:23:24 +0000
commitff9333d473adb4ae1de2d9323394073793627823 (patch)
tree24780fca6ab8c57e5d8c5d98b61362af33bef4b8 /src/libunixonacid
parent15eda3d33f9e1160d438d370acd442ef3dbba63f (diff)
downloadskalibs-ff9333d473adb4ae1de2d9323394073793627823.tar.xz
Add skalibs/posixishard.h
This will break things. It's a known issue. Patches to other packages will come later, to adapt them to the new API. To work around brokenness, there needs to be *two* different headers: 1. one to be used before including system headers, that maximizes visibility by enabling system-dependent feature test macros (that will be tested by system headers) 2. one to be used after including system headers, that performs preprocessor tests and defines. skalibs/nonposix.h is the first one. Previously, there was no second one, and the tests were scattered all over. There was a strnlen declaration in skalibs/posixplz.h (which serves a totally different function: declaring things that should be in POSIX, but *are not*, i.e. working around problems in the standard, instead of problems in systems failing to respect the standard), a build-time sysdep for error.h, #defines for MSG_NOSIGNAL, etc. etc. skalibs/posixishard.h now is the second one, and centralizes all the tests. As a result, the eproto sysdep is unnecessary and has been removed. skalibs/error.h is now a static header, it is not built anymore.
Diffstat (limited to 'src/libunixonacid')
-rw-r--r--src/libunixonacid/ipc_timed_send.c8
-rw-r--r--src/libunixonacid/ipc_timed_sendv.c8
-rw-r--r--src/libunixonacid/skaclient_default_cb.c3
-rw-r--r--src/libunixonacid/skaclient_server_ack.c3
-rw-r--r--src/libunixonacid/skaclient_start_cb.c3
-rw-r--r--src/libunixonacid/textclient_command.c3
-rw-r--r--src/libunixonacid/textclient_commandv.c3
-rw-r--r--src/libunixonacid/textclient_server_init_frompipe.c3
-rw-r--r--src/libunixonacid/textclient_server_init_fromsocket.c8
-rw-r--r--src/libunixonacid/textclient_start.c4
-rw-r--r--src/libunixonacid/textclient_startf.c3
-rw-r--r--src/libunixonacid/unixmessage_put.c3
-rw-r--r--src/libunixonacid/unixmessage_receive.c4
-rw-r--r--src/libunixonacid/unixmessage_sender_flush.c8
14 files changed, 34 insertions, 30 deletions
diff --git a/src/libunixonacid/ipc_timed_send.c b/src/libunixonacid/ipc_timed_send.c
index eeae453..e1e75a4 100644
--- a/src/libunixonacid/ipc_timed_send.c
+++ b/src/libunixonacid/ipc_timed_send.c
@@ -1,17 +1,15 @@
/* ISC license. */
#include <skalibs/nonposix.h>
+
#include <sys/socket.h>
#include <errno.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/error.h>
#include <skalibs/iopause.h>
#include <skalibs/unix-timed.h>
- /* For MacOS, that still doesn't know what POSIX says */
-#ifndef MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
int ipc_timed_send (int fd, char const *s, size_t len, tain_t const *deadline, tain_t *stamp)
{
iopause_fd x = { .fd = fd, .events = IOPAUSE_WRITE, .revents = 0 } ;
diff --git a/src/libunixonacid/ipc_timed_sendv.c b/src/libunixonacid/ipc_timed_sendv.c
index 220b2e3..0fe5b1e 100644
--- a/src/libunixonacid/ipc_timed_sendv.c
+++ b/src/libunixonacid/ipc_timed_sendv.c
@@ -1,18 +1,16 @@
/* ISC license. */
#include <skalibs/nonposix.h>
+
#include <sys/socket.h>
#include <errno.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/error.h>
#include <skalibs/iopause.h>
#include <skalibs/siovec.h>
#include <skalibs/unix-timed.h>
- /* For MacOS, that still doesn't know what POSIX says */
-#ifndef MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
int ipc_timed_sendv (int fd, struct iovec const *v, unsigned int n, tain_t const *deadline, tain_t *stamp)
{
struct msghdr hdr =
diff --git a/src/libunixonacid/skaclient_default_cb.c b/src/libunixonacid/skaclient_default_cb.c
index 10934e5..5bf0268 100644
--- a/src/libunixonacid/skaclient_default_cb.c
+++ b/src/libunixonacid/skaclient_default_cb.c
@@ -1,7 +1,8 @@
/* ISC license. */
#include <errno.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
diff --git a/src/libunixonacid/skaclient_server_ack.c b/src/libunixonacid/skaclient_server_ack.c
index 715e128..b55eb07 100644
--- a/src/libunixonacid/skaclient_server_ack.c
+++ b/src/libunixonacid/skaclient_server_ack.c
@@ -2,8 +2,9 @@
#include <errno.h>
#include <string.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/djbunix.h>
-#include <skalibs/error.h>
#include <skalibs/skaclient.h>
#include <skalibs/unixmessage.h>
#include <skalibs/webipc.h>
diff --git a/src/libunixonacid/skaclient_start_cb.c b/src/libunixonacid/skaclient_start_cb.c
index 80cb6c3..0c4ef49 100644
--- a/src/libunixonacid/skaclient_start_cb.c
+++ b/src/libunixonacid/skaclient_start_cb.c
@@ -2,7 +2,8 @@
#include <errno.h>
#include <string.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/unixmessage.h>
#include <skalibs/skaclient.h>
#include "skaclient-internal.h"
diff --git a/src/libunixonacid/textclient_command.c b/src/libunixonacid/textclient_command.c
index 2e72a4c..56c7122 100644
--- a/src/libunixonacid/textclient_command.c
+++ b/src/libunixonacid/textclient_command.c
@@ -2,7 +2,8 @@
#include <sys/uio.h>
#include <errno.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/textclient.h>
int textclient_command (textclient_t *a, char const *s, size_t len, tain_t const *deadline, tain_t *stamp)
diff --git a/src/libunixonacid/textclient_commandv.c b/src/libunixonacid/textclient_commandv.c
index 5bcd411..ec61498 100644
--- a/src/libunixonacid/textclient_commandv.c
+++ b/src/libunixonacid/textclient_commandv.c
@@ -2,7 +2,8 @@
#include <sys/uio.h>
#include <errno.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/textclient.h>
int textclient_commandv (textclient_t *a, struct iovec const *v, unsigned int n, tain_t const *deadline, tain_t *stamp)
diff --git a/src/libunixonacid/textclient_server_init_frompipe.c b/src/libunixonacid/textclient_server_init_frompipe.c
index fb85b44..e606eeb 100644
--- a/src/libunixonacid/textclient_server_init_frompipe.c
+++ b/src/libunixonacid/textclient_server_init_frompipe.c
@@ -4,8 +4,9 @@
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/types.h>
-#include <skalibs/error.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/djbunix.h>
#include <skalibs/textmessage.h>
diff --git a/src/libunixonacid/textclient_server_init_fromsocket.c b/src/libunixonacid/textclient_server_init_fromsocket.c
index e58df2b..b7f4e84 100644
--- a/src/libunixonacid/textclient_server_init_fromsocket.c
+++ b/src/libunixonacid/textclient_server_init_fromsocket.c
@@ -1,22 +1,20 @@
/* ISC license. */
#include <skalibs/nonposix.h>
+
#include <sys/uio.h>
#include <errno.h>
#include <string.h>
#include <sys/socket.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/types.h>
-#include <skalibs/error.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-timed.h>
#include <skalibs/textmessage.h>
#include <skalibs/textclient.h>
-#ifndef MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
union aligner_u
{
struct cmsghdr cmsghdr ;
diff --git a/src/libunixonacid/textclient_start.c b/src/libunixonacid/textclient_start.c
index 8cb7bcd..8eb8b13 100644
--- a/src/libunixonacid/textclient_start.c
+++ b/src/libunixonacid/textclient_start.c
@@ -2,11 +2,13 @@
#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
+
#include <sys/uio.h>
#include <string.h>
#include <errno.h>
#include <sys/socket.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/webipc.h>
#include <skalibs/djbunix.h>
diff --git a/src/libunixonacid/textclient_startf.c b/src/libunixonacid/textclient_startf.c
index 6a6f0fc..12c2b20 100644
--- a/src/libunixonacid/textclient_startf.c
+++ b/src/libunixonacid/textclient_startf.c
@@ -3,7 +3,8 @@
#include <sys/uio.h>
#include <string.h>
#include <errno.h>
-#include <skalibs/error.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/djbunix.h>
#include <skalibs/textmessage.h>
diff --git a/src/libunixonacid/unixmessage_put.c b/src/libunixonacid/unixmessage_put.c
index a8701ee..a2ac302 100644
--- a/src/libunixonacid/unixmessage_put.c
+++ b/src/libunixonacid/unixmessage_put.c
@@ -2,9 +2,10 @@
#include <string.h>
#include <errno.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/bitarray.h>
#include <skalibs/disize.h>
-#include <skalibs/error.h>
#include <skalibs/stralloc.h>
#include <skalibs/genalloc.h>
#include <skalibs/siovec.h>
diff --git a/src/libunixonacid/unixmessage_receive.c b/src/libunixonacid/unixmessage_receive.c
index 15d08ae..811baae 100644
--- a/src/libunixonacid/unixmessage_receive.c
+++ b/src/libunixonacid/unixmessage_receive.c
@@ -2,14 +2,16 @@
#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
+
#include <errno.h>
#include <sys/socket.h>
#include <sys/uio.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/uint16.h>
#include <skalibs/uint32.h>
#include <skalibs/cbuffer.h>
#include <skalibs/djbunix.h>
-#include <skalibs/error.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/stralloc.h>
#include <skalibs/unixmessage.h>
diff --git a/src/libunixonacid/unixmessage_sender_flush.c b/src/libunixonacid/unixmessage_sender_flush.c
index fa1438f..3f096f0 100644
--- a/src/libunixonacid/unixmessage_sender_flush.c
+++ b/src/libunixonacid/unixmessage_sender_flush.c
@@ -1,12 +1,15 @@
/* ISC license. */
#include <skalibs/nonposix.h>
+
#include <sys/socket.h>
#include <sys/uio.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
#include <errno.h>
+
+#include <skalibs/posixishard.h>
#include <skalibs/uint16.h>
#include <skalibs/uint32.h>
#include <skalibs/disize.h>
@@ -15,11 +18,6 @@
#include <skalibs/djbunix.h>
#include <skalibs/unixmessage.h>
- /* MacOS X tries hard to be POSIX-compliant... and fails. */
-#ifndef MSG_NOSIGNAL
-#define MSG_NOSIGNAL 0
-#endif
-
union aligner_u
{
struct cmsghdr cmsghdr ;