commit ff9333d473adb4ae1de2d9323394073793627823 parent 15eda3d33f9e1160d438d370acd442ef3dbba63f Author: Laurent Bercot <ska-skaware@skarnet.org> Date: Tue, 19 Feb 2019 16:23:24 +0000 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:
39 files changed, 178 insertions(+), 141 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -4,7 +4,6 @@ /*.so.xyzzy /config.mak /src/include/skalibs/config.h -/src/include/skalibs/error.h /src/include/skalibs/ip46.h /src/include/skalibs/sysdeps.h /src/include/skalibs/types.h diff --git a/Makefile b/Makefile @@ -48,7 +48,6 @@ src/include/$(package)/uint16.h \ src/include/$(package)/uint32.h \ src/include/$(package)/uint64.h \ src/include/$(package)/types.h \ -src/include/$(package)/error.h \ src/include/$(package)/ip46.h ALL_INCLUDES := $(sort $(BUILT_INCLUDES) $(wildcard src/include/$(package)/*.h)) ALL_SYSDEPS := $(wildcard $(sysdeps)/*) @@ -151,18 +150,6 @@ src/include/$(package)/uint64.h: $(sysdeps)/sysdeps src/headers/bits-header src/ src/include/$(package)/types.h: src/include/$(package)/uint16.h src/include/$(package)/uint32.h src/include/$(package)/uint64.h $(sysdeps)/sysdeps src/headers/types-header src/headers/types-footer src/headers/unsigned-template src/headers/signed-template exec tools/gen-types.sh $(sysdeps)/sysdeps $(TYPES) > $@ -src/include/$(package)/error.h: src/include/$(package)/gccattributes.h $(sysdeps)/sysdeps src/headers/error-addrinuse src/headers/error-already src/headers/error-proto src/headers/error-header src/headers/error-footer - @{ \ - cat src/headers/error-header ; \ - if grep -F target: $(sysdeps)/sysdeps | grep -qiF bsd ; then cat src/headers/error-addrinuse ; \ - else cat src/headers/error-already ; \ - fi ; \ - if grep -qF 'eproto: yes' $(sysdeps)/sysdeps ; then : ; \ - else cat src/headers/error-proto ; \ - fi ; \ - exec cat src/headers/error-footer ; \ - } > $@ - src/include/$(package)/ip46.h: src/include/$(package)/fmtscan.h src/include/$(package)/socket.h $(sysdeps)/sysdeps src/headers/ip46-header src/headers/ip46-footer src/headers/ip46-with src/headers/ip46-without @{ \ cat src/headers/ip46-header ; \ diff --git a/configure b/configure @@ -144,15 +144,16 @@ choose () { esac fi rm -f try$name.o try$name + echo "#undef ${package_macro_name}_HAS$macro" >> $sysdeps/sysdeps.h if $r ; then echo "$name: yes" >> $sysdeps/sysdeps echo "#define ${package_macro_name}_HAS$macro" >> $sysdeps/sysdeps.h echo " ... yes" else echo "$name: no" >> $sysdeps/sysdeps - echo "#undef ${package_macro_name}_HAS$macro" >> $sysdeps/sysdeps.h echo " ... no" fi + echo >> $sysdeps/sysdeps.h } trytypes () { @@ -161,18 +162,21 @@ trytypes () { ./output-types >> $sysdeps/sysdeps ./output-types | grep -F sizeof | while read key value ; do caps=$(echo $key | sed s/:\$// | tr a-z A-Z) - echo "#define ${package_macro_name}_${caps} $value" >> $sysdeps/sysdeps.h - done + echo "#undef ${package_macro_name}_${caps}" + echo "#define ${package_macro_name}_${caps} $value" + echo + done >> $sysdeps/sysdeps.h ./output-types | grep -F signed | while read key value ; do caps=$(echo $key | sed s/:\$// | tr a-z A-Z) + echo "#undef ${package_macro_name}_HASUN${caps}" + echo "#undef ${package_macro_name}_HAS${caps}" if test $value = yes ; then echo "#define ${package_macro_name}_HAS${caps}" - echo "#undef ${package_macro_name}_HASUN${caps}" else - echo "#undef ${package_macro_name}_HAS${caps}" echo "#define ${package_macro_name}_HASUN${caps}" - fi >> $sysdeps/sysdeps.h - done + fi + echo + done >> $sysdeps/sysdeps.h rm -f output-types echo " ... done" } @@ -443,7 +447,14 @@ else #ifndef SYSDEPS_H #define SYSDEPS_H +#undef SKALIBS_TARGET #define SKALIBS_TARGET "$target" + +#undef SKALIBS_BSD_SUCKS +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__) +# define SKALIBS_BSD_SUCKS +#endif + EOF exec 3>&1 @@ -462,43 +473,51 @@ EOF fi echo "$sysclock_lib" > $sysdeps/sysclock.lib echo "$tainnow_lib" > $sysdeps/tainnow.lib + echo "#undef ${package_macro_name}_HASCLOCKRT" >> $sysdeps/sysdeps.h if $hasclock ; then echo 'clockrt: yes' >> $sysdeps/sysdeps echo "#define ${package_macro_name}_HASCLOCKRT" >> $sysdeps/sysdeps.h + echo >> $sysdeps/sysdeps.h choose cl clockmon CLOCKMON CLOCK_MONOTONIC $sysclock_lib else echo 'clockrt: no' >> $sysdeps/sysdeps - echo "#undef ${package_macro_name}_HASCLOCKRT" >> $sysdeps/sysdeps.h + echo >> $sysdeps/sysdeps.h fi hasspawn=true spawn_lib=`trylibs posixspawn 'posix_spawn()' -lrt` || hasspawn=false echo "$spawn_lib" > $sysdeps/spawn.lib + echo "#undef ${package_macro_name}_HASPOSIXSPAWN" >> $sysdeps/sysdeps.h if $hasspawn ; then echo 'posixspawn: yes' >> $sysdeps/sysdeps echo "#define ${package_macro_name}_HASPOSIXSPAWN" >> $sysdeps/sysdeps.h else echo 'posixspawn: no' >> $sysdeps/sysdeps - echo "#undef ${package_macro_name}_HASPOSIXSPAWN" >> $sysdeps/sysdeps.h fi + echo >> $sysdeps/sysdeps.h hastimer=true timer_lib=`trylibs timer 'timer_create()' -lrt` || hastimer=false echo "$timer_lib" > $sysdeps/timer.lib + echo "#undef ${package_macro_name}_HASTIMER" >> $sysdeps/sysdeps.h if $hastimer ; then echo 'timer: yes' >> $sysdeps/sysdeps echo "#define ${package_macro_name}_HASTIMER" >> $sysdeps/sysdeps.h else echo 'timer: no' >> $sysdeps/sysdeps - echo "#undef ${package_macro_name}_HASTIMER" >> $sysdeps/sysdeps.h fi + echo >> $sysdeps/sysdeps.h exec 3>&- echo "Checking system endianness..." $CC_AUTO $CPPFLAGS_AUTO $CPPFLAGS $CPPFLAGS_POST $CFLAGS_AUTO $CFLAGS $CFLAGS_POST $LDFLAGS_AUTO $LDFLAGS $LDFLAGS_POST -o tryendianness src/sysdeps/tryendianness.c endianness=$(./tryendianness) || fail "$0: unable to determine endianness" echo "endianness: $endianness" >> $sysdeps/sysdeps - echo "#define ${package_macro_name}_ENDIANNESS \"$endianness\"" >> $sysdeps/sysdeps.h + { + echo "#undef ${package_macro_name}_ENDIANNESS" + echo "#define ${package_macro_name}_ENDIANNESS \"$endianness\"" + echo + } >> $sysdeps/sysdeps.h echo " ... $endianness" rm -f tryendianness @@ -508,7 +527,6 @@ EOF choose c cmsgcloexec CMSGCLOEXEC 'MSG_CMSG_CLOEXEC' choose clr devurandom DEVURANDOM '/dev/urandom' choose cl dirfd DIRFD 'dirfd()' - choose c eproto EPROTO EPROTO choose cl eventfd EVENTFD 'eventfd()' choose cl flock FLOCK 'flock()' choose cl getpeereid GETPEEREID 'getpeereid()' diff --git a/package/deps.mak b/package/deps.mak @@ -12,7 +12,7 @@ src/include/skalibs/biguint.h: src/include/skalibs/gccattributes.h src/include/skalibs/bitarray.h: src/include/skalibs/gccattributes.h src/include/skalibs/bufalloc.h: src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h src/include/skalibs/buffer.h: src/include/skalibs/allreadwrite.h src/include/skalibs/cbuffer.h src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h -src/include/skalibs/bytestr.h: src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h +src/include/skalibs/bytestr.h: src/include/skalibs/gccattributes.h src/include/skalibs/posixishard.h src/include/skalibs/cbuffer.h: src/include/skalibs/gccattributes.h src/include/skalibs/cdb.h: src/include/skalibs/gccattributes.h src/include/skalibs/cdb_make.h: src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/diuint32.h src/include/skalibs/genalloc.h @@ -22,6 +22,7 @@ src/include/skalibs/djbunix.h: src/include/skalibs/envalloc.h src/include/skalib src/include/skalibs/env.h: src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h src/include/skalibs/envalloc.h: src/include/skalibs/genalloc.h src/include/skalibs/environ.h: src/include/skalibs/posixplz.h +src/include/skalibs/error.h: src/include/skalibs/gccattributes.h src/include/skalibs/sysdeps.h src/include/skalibs/fmtscan.h: src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h: src/include/skalibs/functypes.h src/include/skalibs/stralloc.h src/include/skalibs/genqdyn.h: src/include/skalibs/stralloc.h @@ -33,6 +34,7 @@ src/include/skalibs/iopause.h: src/include/skalibs/tai.h src/include/skalibs/kolbak.h: src/include/skalibs/unixmessage.h src/include/skalibs/lolstdio.h: src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/strerr2.h src/include/skalibs/netstring.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h +src/include/skalibs/posixishard.h: src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h: src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h src/include/skalibs/random.h: src/include/skalibs/stralloc.h src/include/skalibs/setgroups.h: src/include/skalibs/sysdeps.h @@ -44,7 +46,7 @@ src/include/skalibs/skalibs.h: src/include/skalibs/biguint.h src/include/skalibs src/include/skalibs/skamisc.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h src/include/skalibs/socket.h: src/include/skalibs/djbunix.h src/include/skalibs/gccattributes.h src/include/skalibs/tai.h src/include/skalibs/webipc.h src/include/skalibs/stdcrypto.h: src/include/skalibs/md5.h src/include/skalibs/rc4.h src/include/skalibs/sha1.h src/include/skalibs/sha256.h src/include/skalibs/sha512.h -src/include/skalibs/stddjb.h: src/include/skalibs/alarm.h src/include/skalibs/alloc.h src/include/skalibs/allreadwrite.h src/include/skalibs/bitarray.h src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/cbuffer.h src/include/skalibs/cdb.h src/include/skalibs/cdb_make.h src/include/skalibs/config.h src/include/skalibs/direntry.h src/include/skalibs/disize.h src/include/skalibs/diuint.h src/include/skalibs/diuint32.h src/include/skalibs/djbtime.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/error.h src/include/skalibs/fmtscan.h src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h src/include/skalibs/genwrite.h src/include/skalibs/iobuffer.h src/include/skalibs/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/netstring.h src/include/skalibs/nsig.h src/include/skalibs/segfault.h src/include/skalibs/selfpipe.h src/include/skalibs/setgroups.h src/include/skalibs/sgetopt.h src/include/skalibs/sig.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/socket.h src/include/skalibs/stralloc.h src/include/skalibs/strerr.h src/include/skalibs/strerr2.h src/include/skalibs/tai.h src/include/skalibs/types.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h src/include/skalibs/webipc.h +src/include/skalibs/stddjb.h: src/include/skalibs/alarm.h src/include/skalibs/alloc.h src/include/skalibs/allreadwrite.h src/include/skalibs/bitarray.h src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/cbuffer.h src/include/skalibs/cdb.h src/include/skalibs/cdb_make.h src/include/skalibs/direntry.h src/include/skalibs/disize.h src/include/skalibs/diuint.h src/include/skalibs/diuint32.h src/include/skalibs/djbtime.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/error.h src/include/skalibs/fmtscan.h src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h src/include/skalibs/genwrite.h src/include/skalibs/iobuffer.h src/include/skalibs/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/netstring.h src/include/skalibs/nsig.h src/include/skalibs/segfault.h src/include/skalibs/selfpipe.h src/include/skalibs/setgroups.h src/include/skalibs/sgetopt.h src/include/skalibs/sig.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/socket.h src/include/skalibs/stralloc.h src/include/skalibs/strerr.h src/include/skalibs/strerr2.h src/include/skalibs/tai.h src/include/skalibs/types.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h src/include/skalibs/webipc.h src/include/skalibs/strerr.h: src/include/skalibs/gccattributes.h src/include/skalibs/strerr2.h: src/include/skalibs/strerr.h src/include/skalibs/tai.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint64.h @@ -152,7 +154,7 @@ src/libposixplz/mklinktemp.o src/libposixplz/mklinktemp.lo: src/libposixplz/mkli src/libposixplz/mkltemp.o src/libposixplz/mkltemp.lo: src/libposixplz/mkltemp.c src/include/skalibs/posixplz.h src/libposixplz/mkptemp.o src/libposixplz/mkptemp.lo: src/libposixplz/mkptemp.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h src/libposixplz/setgroups.o src/libposixplz/setgroups.lo: src/libposixplz/setgroups.c src/include/skalibs/nonposix.h src/include/skalibs/setgroups.h src/include/skalibs/sysdeps.h -src/libposixplz/strnlen.o src/libposixplz/strnlen.lo: src/libposixplz/strnlen.c src/include/skalibs/bytestr.h src/include/skalibs/posixplz.h src/include/skalibs/sysdeps.h +src/libposixplz/strnlen.o src/libposixplz/strnlen.lo: src/libposixplz/strnlen.c src/include/skalibs/bytestr.h src/include/skalibs/posixishard.h src/include/skalibs/sysdeps.h src/libposixplz/touch.o src/libposixplz/touch.lo: src/libposixplz/touch.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/posixplz.h src/include/skalibs/sysdeps.h src/libposixplz/unlink_void.o src/libposixplz/unlink_void.lo: src/libposixplz/unlink_void.c src/include/skalibs/posixplz.h src/librandom/autosurf.o src/librandom/autosurf.lo: src/librandom/autosurf.c src/include/skalibs/random.h src/include/skalibs/surf.h @@ -283,7 +285,7 @@ src/libstddjb/cdb_init_map.o src/libstddjb/cdb_init_map.lo: src/libstddjb/cdb_in src/libstddjb/cdb_make.o src/libstddjb/cdb_make.lo: src/libstddjb/cdb_make.c src/include/skalibs/buffer.h src/include/skalibs/cdb.h src/include/skalibs/cdb_make.h src/include/skalibs/diuint32.h src/include/skalibs/genalloc.h src/include/skalibs/uint32.h src/libstddjb/cdb_mapfile.o src/libstddjb/cdb_mapfile.lo: src/libstddjb/cdb_mapfile.c src/include/skalibs/cdb.h src/include/skalibs/djbunix.h src/libstddjb/cdb_nextkey.o src/libstddjb/cdb_nextkey.lo: src/libstddjb/cdb_nextkey.c src/include/skalibs/cdb.h src/include/skalibs/uint32.h -src/libstddjb/cdb_read.o src/libstddjb/cdb_read.lo: src/libstddjb/cdb_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/cdb.h src/include/skalibs/error.h +src/libstddjb/cdb_read.o src/libstddjb/cdb_read.lo: src/libstddjb/cdb_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/cdb.h src/include/skalibs/posixishard.h src/libstddjb/cdb_successor.o src/libstddjb/cdb_successor.lo: src/libstddjb/cdb_successor.c src/include/skalibs/cdb.h src/libstddjb/cdb_zero.o src/libstddjb/cdb_zero.lo: src/libstddjb/cdb_zero.c src/include/skalibs/cdb.h src/libstddjb/child_spawn.o src/libstddjb/child_spawn.lo: src/libstddjb/child_spawn.c src/include/skalibs/allreadwrite.h src/include/skalibs/config.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/sig.h src/include/skalibs/strerr2.h src/include/skalibs/sysdeps.h src/include/skalibs/types.h @@ -393,16 +395,16 @@ src/libstddjb/ip6_fmt.o src/libstddjb/ip6_fmt.lo: src/libstddjb/ip6_fmt.c src/in src/libstddjb/ip6_scan.o src/libstddjb/ip6_scan.lo: src/libstddjb/ip6_scan.c src/include/skalibs/fmtscan.h src/include/skalibs/uint16.h src/libstddjb/ip6_scanlist.o src/libstddjb/ip6_scanlist.lo: src/libstddjb/ip6_scanlist.c src/include/skalibs/fmtscan.h src/libstddjb/ipc_accept.o src/libstddjb/ipc_accept.lo: src/libstddjb/ipc_accept.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/webipc.h -src/libstddjb/ipc_bind.o src/libstddjb/ipc_bind.lo: src/libstddjb/ipc_bind.c src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h +src/libstddjb/ipc_bind.o src/libstddjb/ipc_bind.lo: src/libstddjb/ipc_bind.c src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/webipc.h src/libstddjb/ipc_bind_reuse.o src/libstddjb/ipc_bind_reuse.lo: src/libstddjb/ipc_bind_reuse.c src/include/skalibs/nonposix.h src/include/skalibs/webipc.h -src/libstddjb/ipc_connect.o src/libstddjb/ipc_connect.lo: src/libstddjb/ipc_connect.c src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h +src/libstddjb/ipc_connect.o src/libstddjb/ipc_connect.lo: src/libstddjb/ipc_connect.c src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/webipc.h src/libstddjb/ipc_connected.o src/libstddjb/ipc_connected.lo: src/libstddjb/ipc_connected.c src/include/skalibs/allreadwrite.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h src/libstddjb/ipc_dgram.o src/libstddjb/ipc_dgram.lo: src/libstddjb/ipc_dgram.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h src/libstddjb/ipc_listen.o src/libstddjb/ipc_listen.lo: src/libstddjb/ipc_listen.c src/include/skalibs/nonposix.h src/include/skalibs/webipc.h src/libstddjb/ipc_local.o src/libstddjb/ipc_local.lo: src/libstddjb/ipc_local.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h src/libstddjb/ipc_pair.o src/libstddjb/ipc_pair.lo: src/libstddjb/ipc_pair.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h -src/libstddjb/ipc_recv.o src/libstddjb/ipc_recv.lo: src/libstddjb/ipc_recv.c src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h -src/libstddjb/ipc_send.o src/libstddjb/ipc_send.lo: src/libstddjb/ipc_send.c src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h +src/libstddjb/ipc_recv.o src/libstddjb/ipc_recv.lo: src/libstddjb/ipc_recv.c src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/webipc.h +src/libstddjb/ipc_send.o src/libstddjb/ipc_send.lo: src/libstddjb/ipc_send.c src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/webipc.h src/libstddjb/ipc_stream.o src/libstddjb/ipc_stream.lo: src/libstddjb/ipc_stream.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/webipc.h src/libstddjb/ipc_timed_connect.o src/libstddjb/ipc_timed_connect.lo: src/libstddjb/ipc_timed_connect.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/webipc.h src/libstddjb/leapsecs_add.o src/libstddjb/leapsecs_add.lo: src/libstddjb/leapsecs_add.c src/libstddjb/djbtime-internal.h src/include/skalibs/uint64.h @@ -435,7 +437,7 @@ src/libstddjb/netstring_append.o src/libstddjb/netstring_append.lo: src/libstddj src/libstddjb/netstring_appendv.o src/libstddjb/netstring_appendv.lo: src/libstddjb/netstring_appendv.c src/include/skalibs/bytestr.h src/include/skalibs/netstring.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h src/libstddjb/netstring_decode.o src/libstddjb/netstring_decode.lo: src/libstddjb/netstring_decode.c src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h src/libstddjb/netstring_encode.o src/libstddjb/netstring_encode.lo: src/libstddjb/netstring_encode.c src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h -src/libstddjb/netstring_get.o src/libstddjb/netstring_get.lo: src/libstddjb/netstring_get.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/error.h src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/types.h +src/libstddjb/netstring_get.o src/libstddjb/netstring_get.lo: src/libstddjb/netstring_get.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/bytestr.h src/include/skalibs/netstring.h src/include/skalibs/posixishard.h src/include/skalibs/stralloc.h src/include/skalibs/types.h src/libstddjb/netstring_put.o src/libstddjb/netstring_put.lo: src/libstddjb/netstring_put.c src/include/skalibs/buffer.h src/include/skalibs/netstring.h src/include/skalibs/uint64.h src/libstddjb/ntp_from_tain.o src/libstddjb/ntp_from_tain.lo: src/libstddjb/ntp_from_tain.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h src/libstddjb/open2.o src/libstddjb/open2.lo: src/libstddjb/open2.c src/include/skalibs/nonposix.h @@ -586,7 +588,7 @@ src/libstddjb/string_quote_nodelim.o src/libstddjb/string_quote_nodelim.lo: src/ src/libstddjb/string_quote_nodelim_mustquote.o src/libstddjb/string_quote_nodelim_mustquote.lo: src/libstddjb/string_quote_nodelim_mustquote.c src/include/skalibs/fmtscan.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/libstddjb/string_unquote.o src/libstddjb/string_unquote.lo: src/libstddjb/string_unquote.c src/include/skalibs/skamisc.h src/libstddjb/string_unquote_nodelim.o src/libstddjb/string_unquote_nodelim.lo: src/libstddjb/string_unquote_nodelim.c src/include/skalibs/skamisc.h -src/libstddjb/string_unquote_withdelim.o src/libstddjb/string_unquote_withdelim.lo: src/libstddjb/string_unquote_withdelim.c src/include/skalibs/bytestr.h src/include/skalibs/error.h src/include/skalibs/fmtscan.h src/include/skalibs/skamisc.h +src/libstddjb/string_unquote_withdelim.o src/libstddjb/string_unquote_withdelim.lo: src/libstddjb/string_unquote_withdelim.c src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h src/include/skalibs/posixishard.h src/include/skalibs/skamisc.h src/libstddjb/strn_fmt.o src/libstddjb/strn_fmt.lo: src/libstddjb/strn_fmt.c src/include/skalibs/fmtscan.h src/include/skalibs/types.h src/libstddjb/subgetopt.o src/libstddjb/subgetopt.lo: src/libstddjb/subgetopt.c src/include/skalibs/sgetopt.h src/libstddjb/subgetopt_here.o src/libstddjb/subgetopt_here.lo: src/libstddjb/subgetopt_here.c src/include/skalibs/sgetopt.h @@ -737,8 +739,8 @@ src/libunixonacid/dd_commit_devino.o src/libunixonacid/dd_commit_devino.lo: src/ src/libunixonacid/dd_open_read.o src/libunixonacid/dd_open_read.lo: src/libunixonacid/dd_open_read.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h src/libunixonacid/dd_open_write.o src/libunixonacid/dd_open_write.lo: src/libunixonacid/dd_open_write.c src/include/skalibs/djbunix.h src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h src/libunixonacid/ipc_timed_recv.o src/libunixonacid/ipc_timed_recv.lo: src/libunixonacid/ipc_timed_recv.c src/include/skalibs/allreadwrite.h src/include/skalibs/functypes.h src/include/skalibs/unix-timed.h src/include/skalibs/webipc.h -src/libunixonacid/ipc_timed_send.o src/libunixonacid/ipc_timed_send.lo: src/libunixonacid/ipc_timed_send.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/unix-timed.h -src/libunixonacid/ipc_timed_sendv.o src/libunixonacid/ipc_timed_sendv.lo: src/libunixonacid/ipc_timed_sendv.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/siovec.h src/include/skalibs/unix-timed.h +src/libunixonacid/ipc_timed_send.o src/libunixonacid/ipc_timed_send.lo: src/libunixonacid/ipc_timed_send.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/unix-timed.h +src/libunixonacid/ipc_timed_sendv.o src/libunixonacid/ipc_timed_sendv.lo: src/libunixonacid/ipc_timed_sendv.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/siovec.h src/include/skalibs/unix-timed.h src/libunixonacid/kolbak_call.o src/libunixonacid/kolbak_call.lo: src/libunixonacid/kolbak_call.c src/include/skalibs/kolbak.h src/include/skalibs/unixmessage.h src/libunixonacid/kolbak_enqueue.o src/libunixonacid/kolbak_enqueue.lo: src/libunixonacid/kolbak_enqueue.c src/include/skalibs/kolbak.h src/include/skalibs/unixmessage.h src/libunixonacid/kolbak_queue_init.o src/libunixonacid/kolbak_queue_init.lo: src/libunixonacid/kolbak_queue_init.c src/include/skalibs/kolbak.h @@ -760,7 +762,7 @@ src/libunixonacid/openreadnclose_at.o src/libunixonacid/openreadnclose_at.lo: sr src/libunixonacid/openslurpclose_at.o src/libunixonacid/openslurpclose_at.lo: src/libunixonacid/openslurpclose_at.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h src/libunixonacid/openwritenclose_at.o src/libunixonacid/openwritenclose_at.lo: src/libunixonacid/openwritenclose_at.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h src/libunixonacid/openwritevnclose_at.o src/libunixonacid/openwritevnclose_at.lo: src/libunixonacid/openwritevnclose_at.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/siovec.h src/include/skalibs/unix-transactional.h -src/libunixonacid/skaclient_default_cb.o src/libunixonacid/skaclient_default_cb.lo: src/libunixonacid/skaclient_default_cb.c src/include/skalibs/error.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h +src/libunixonacid/skaclient_default_cb.o src/libunixonacid/skaclient_default_cb.lo: src/libunixonacid/skaclient_default_cb.c src/include/skalibs/posixishard.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_end.o src/libunixonacid/skaclient_end.lo: src/libunixonacid/skaclient_end.c src/include/skalibs/djbunix.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_init.o src/libunixonacid/skaclient_init.lo: src/libunixonacid/skaclient_init.c src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_put.o src/libunixonacid/skaclient_put.lo: src/libunixonacid/skaclient_put.c src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h @@ -771,25 +773,25 @@ src/libunixonacid/skaclient_send.o src/libunixonacid/skaclient_send.lo: src/libu src/libunixonacid/skaclient_sendmsg.o src/libunixonacid/skaclient_sendmsg.lo: src/libunixonacid/skaclient_sendmsg.c src/include/skalibs/skaclient.h src/libunixonacid/skaclient_sendmsgv.o src/libunixonacid/skaclient_sendmsgv.lo: src/libunixonacid/skaclient_sendmsgv.c src/include/skalibs/skaclient.h src/libunixonacid/skaclient_sendv.o src/libunixonacid/skaclient_sendv.lo: src/libunixonacid/skaclient_sendv.c src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h -src/libunixonacid/skaclient_server_ack.o src/libunixonacid/skaclient_server_ack.lo: src/libunixonacid/skaclient_server_ack.c src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/include/skalibs/webipc.h +src/libunixonacid/skaclient_server_ack.o src/libunixonacid/skaclient_server_ack.lo: src/libunixonacid/skaclient_server_ack.c src/include/skalibs/djbunix.h src/include/skalibs/posixishard.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/include/skalibs/webipc.h src/libunixonacid/skaclient_server_bidi_ack.o src/libunixonacid/skaclient_server_bidi_ack.lo: src/libunixonacid/skaclient_server_bidi_ack.c src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_server_init.o src/libunixonacid/skaclient_server_init.lo: src/libunixonacid/skaclient_server_init.c src/include/skalibs/allreadwrite.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_start.o src/libunixonacid/skaclient_start.lo: src/libunixonacid/skaclient_start.c src/include/skalibs/kolbak.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/libunixonacid/skaclient_start_async.o src/libunixonacid/skaclient_start_async.lo: src/libunixonacid/skaclient_start_async.c src/include/skalibs/error.h src/include/skalibs/kolbak.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/include/skalibs/webipc.h -src/libunixonacid/skaclient_start_cb.o src/libunixonacid/skaclient_start_cb.lo: src/libunixonacid/skaclient_start_cb.c src/include/skalibs/error.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h +src/libunixonacid/skaclient_start_cb.o src/libunixonacid/skaclient_start_cb.lo: src/libunixonacid/skaclient_start_cb.c src/include/skalibs/posixishard.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h src/libunixonacid/skaclient_startf.o src/libunixonacid/skaclient_startf.lo: src/libunixonacid/skaclient_startf.c src/include/skalibs/kolbak.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/libunixonacid/skaclient_startf_async.o src/libunixonacid/skaclient_startf_async.lo: src/libunixonacid/skaclient_startf_async.c src/include/skalibs/djbunix.h src/include/skalibs/kolbak.h src/libunixonacid/skaclient-internal.h src/include/skalibs/skaclient.h src/libunixonacid/skaclient_syncify.o src/libunixonacid/skaclient_syncify.lo: src/libunixonacid/skaclient_syncify.c src/include/skalibs/skaclient.h src/libunixonacid/skaclient_zero.o src/libunixonacid/skaclient_zero.lo: src/libunixonacid/skaclient_zero.c src/include/skalibs/skaclient.h src/libunixonacid/stat_at.o src/libunixonacid/stat_at.lo: src/libunixonacid/stat_at.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/unix-transactional.h -src/libunixonacid/textclient_command.o src/libunixonacid/textclient_command.lo: src/libunixonacid/textclient_command.c src/include/skalibs/error.h src/include/skalibs/textclient.h -src/libunixonacid/textclient_commandv.o src/libunixonacid/textclient_commandv.lo: src/libunixonacid/textclient_commandv.c src/include/skalibs/error.h src/include/skalibs/textclient.h +src/libunixonacid/textclient_command.o src/libunixonacid/textclient_command.lo: src/libunixonacid/textclient_command.c src/include/skalibs/posixishard.h src/include/skalibs/textclient.h +src/libunixonacid/textclient_commandv.o src/libunixonacid/textclient_commandv.lo: src/libunixonacid/textclient_commandv.c src/include/skalibs/posixishard.h src/include/skalibs/textclient.h src/libunixonacid/textclient_end.o src/libunixonacid/textclient_end.lo: src/libunixonacid/textclient_end.c src/include/skalibs/djbunix.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/libunixonacid/textclient_server_init.o src/libunixonacid/textclient_server_init.lo: src/libunixonacid/textclient_server_init.c src/include/skalibs/djbunix.h src/include/skalibs/textclient.h -src/libunixonacid/textclient_server_init_frompipe.o src/libunixonacid/textclient_server_init_frompipe.lo: src/libunixonacid/textclient_server_init_frompipe.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/types.h -src/libunixonacid/textclient_server_init_fromsocket.o src/libunixonacid/textclient_server_init_fromsocket.lo: src/libunixonacid/textclient_server_init_fromsocket.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/types.h src/include/skalibs/unix-timed.h -src/libunixonacid/textclient_start.o src/libunixonacid/textclient_start.lo: src/libunixonacid/textclient_start.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/unix-timed.h src/include/skalibs/webipc.h -src/libunixonacid/textclient_startf.o src/libunixonacid/textclient_startf.lo: src/libunixonacid/textclient_startf.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h +src/libunixonacid/textclient_server_init_frompipe.o src/libunixonacid/textclient_server_init_frompipe.lo: src/libunixonacid/textclient_server_init_frompipe.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/posixishard.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/types.h +src/libunixonacid/textclient_server_init_fromsocket.o src/libunixonacid/textclient_server_init_fromsocket.lo: src/libunixonacid/textclient_server_init_fromsocket.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/types.h src/include/skalibs/unix-timed.h +src/libunixonacid/textclient_start.o src/libunixonacid/textclient_start.lo: src/libunixonacid/textclient_start.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/sysdeps.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/include/skalibs/unix-timed.h src/include/skalibs/webipc.h +src/libunixonacid/textclient_startf.o src/libunixonacid/textclient_startf.lo: src/libunixonacid/textclient_startf.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/posixishard.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h src/libunixonacid/textclient_zero.o src/libunixonacid/textclient_zero.lo: src/libunixonacid/textclient_zero.c src/include/skalibs/textclient.h src/libunixonacid/textmessage_handle.o src/libunixonacid/textmessage_handle.lo: src/libunixonacid/textmessage_handle.c src/include/skalibs/textmessage.h src/libunixonacid/textmessage_put.o src/libunixonacid/textmessage_put.lo: src/libunixonacid/textmessage_put.c src/include/skalibs/bufalloc.h src/include/skalibs/textmessage.h src/include/skalibs/uint32.h @@ -820,15 +822,15 @@ src/libunixonacid/unixmessage_bits_closeall.o src/libunixonacid/unixmessage_bits src/libunixonacid/unixmessage_bits_closenone.o src/libunixonacid/unixmessage_bits_closenone.lo: src/libunixonacid/unixmessage_bits_closenone.c src/include/skalibs/bitarray.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_drop.o src/libunixonacid/unixmessage_drop.lo: src/libunixonacid/unixmessage_drop.c src/include/skalibs/djbunix.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_handle.o src/libunixonacid/unixmessage_handle.lo: src/libunixonacid/unixmessage_handle.c src/include/skalibs/unixmessage.h -src/libunixonacid/unixmessage_put.o src/libunixonacid/unixmessage_put.lo: src/libunixonacid/unixmessage_put.c src/include/skalibs/bitarray.h src/include/skalibs/disize.h src/include/skalibs/error.h src/include/skalibs/genalloc.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h -src/libunixonacid/unixmessage_receive.o src/libunixonacid/unixmessage_receive.lo: src/libunixonacid/unixmessage_receive.c src/include/skalibs/allreadwrite.h src/include/skalibs/cbuffer.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/stralloc.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h +src/libunixonacid/unixmessage_put.o src/libunixonacid/unixmessage_put.lo: src/libunixonacid/unixmessage_put.c src/include/skalibs/bitarray.h src/include/skalibs/disize.h src/include/skalibs/genalloc.h src/include/skalibs/posixishard.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h +src/libunixonacid/unixmessage_receive.o src/libunixonacid/unixmessage_receive.lo: src/libunixonacid/unixmessage_receive.c src/include/skalibs/allreadwrite.h src/include/skalibs/cbuffer.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/stralloc.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_receiver_0.o src/libunixonacid/unixmessage_receiver_0.lo: src/libunixonacid/unixmessage_receiver_0.c src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_receiver_free.o src/libunixonacid/unixmessage_receiver_free.lo: src/libunixonacid/unixmessage_receiver_free.c src/include/skalibs/cbuffer.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_receiver_hasmsginbuf.o src/libunixonacid/unixmessage_receiver_hasmsginbuf.lo: src/libunixonacid/unixmessage_receiver_hasmsginbuf.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_receiver_init.o src/libunixonacid/unixmessage_receiver_init.lo: src/libunixonacid/unixmessage_receiver_init.c src/include/skalibs/cbuffer.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_sender_1.o src/libunixonacid/unixmessage_sender_1.lo: src/libunixonacid/unixmessage_sender_1.c src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_sender_closecb.o src/libunixonacid/unixmessage_sender_closecb.lo: src/libunixonacid/unixmessage_sender_closecb.c src/include/skalibs/djbunix.h src/include/skalibs/unixmessage.h -src/libunixonacid/unixmessage_sender_flush.o src/libunixonacid/unixmessage_sender_flush.lo: src/libunixonacid/unixmessage_sender_flush.c src/include/skalibs/allreadwrite.h src/include/skalibs/disize.h src/include/skalibs/djbunix.h src/include/skalibs/genalloc.h src/include/skalibs/nonposix.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h +src/libunixonacid/unixmessage_sender_flush.o src/libunixonacid/unixmessage_sender_flush.lo: src/libunixonacid/unixmessage_sender_flush.c src/include/skalibs/allreadwrite.h src/include/skalibs/disize.h src/include/skalibs/djbunix.h src/include/skalibs/genalloc.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_sender_free.o src/libunixonacid/unixmessage_sender_free.lo: src/libunixonacid/unixmessage_sender_free.c src/include/skalibs/disize.h src/include/skalibs/djbunix.h src/include/skalibs/genalloc.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_sender_getfd.o src/libunixonacid/unixmessage_sender_getfd.lo: src/libunixonacid/unixmessage_sender_getfd.c src/include/skalibs/unixmessage.h src/libunixonacid/unixmessage_sender_init.o src/libunixonacid/unixmessage_sender_init.lo: src/libunixonacid/unixmessage_sender_init.c src/include/skalibs/unixmessage.h diff --git a/src/headers/error-addrinuse b/src/headers/error-addrinuse @@ -1,3 +0,0 @@ - -/* BSD sucks */ -#define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS) || ((e) == EADDRINUSE)) diff --git a/src/headers/error-already b/src/headers/error-already @@ -1 +0,0 @@ -#define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS)) diff --git a/src/headers/error-footer b/src/headers/error-footer @@ -1,2 +0,0 @@ - -#endif diff --git a/src/headers/error-header b/src/headers/error-header @@ -1,9 +0,0 @@ -/* ISC license. */ - -#ifndef ERROR_H -#define ERROR_H - -#include <skalibs/gccattributes.h> - -extern int error_temp (int) gccattr_const ; -#define error_isagain(e) (((e) == EAGAIN) || ((e) == EWOULDBLOCK)) diff --git a/src/headers/error-proto b/src/headers/error-proto @@ -1,3 +0,0 @@ - -/* Did I ever mention that BSD sucks ? */ -#define EPROTO EPROTOTYPE diff --git a/src/include/skalibs/bytestr.h b/src/include/skalibs/bytestr.h @@ -10,7 +10,7 @@ #include <string.h> #include <strings.h> -#include <skalibs/posixplz.h> +#include <skalibs/posixishard.h> #define byte_copy(to, n, from) memmove(to, (from), n) #define byte_copyr(to, n, from) memmove(to, (from), n) diff --git a/src/include/skalibs/error.h b/src/include/skalibs/error.h @@ -0,0 +1,18 @@ +/* ISC license. */ + +#ifndef ERROR_H +#define ERROR_H + +#include <skalibs/sysdeps.h> +#include <skalibs/gccattributes.h> + +extern int error_temp (int) gccattr_const ; +#define error_isagain(e) (((e) == EAGAIN) || ((e) == EWOULDBLOCK)) + +#ifdef SKALIBS_BSD_SUCKS +# define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS) || ((e) == EADDRINUSE)) +#else +# define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS)) +#endif + +#endif diff --git a/src/include/skalibs/nonposix.h b/src/include/skalibs/nonposix.h @@ -35,12 +35,25 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif + + + /* BSD and Linux libcs that are not glibc: _BSD_SOURCE opens up a + lot of extensions. Of course, glibc insisted on changing to a + different macro, because coordination and consistency would make + developers' life too easy. */ + +#ifdef __GLIBC__ #ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE #endif +#else +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#endif - /* NetBSD: of course they had to have their own macros. */ + /* NetBSD: of course they had to have their own macro too. */ #ifndef _NETBSD_SOURCE #define _NETBSD_SOURCE @@ -50,22 +63,13 @@ #endif - /* MacOS: needs this for full SUSv3 conformance. Don't ask. */ + /* MacOS: needs this for full SUSv3 conformance. Standards are hard. */ #ifndef _DARWIN_C_SOURCE #define _DARWIN_C_SOURCE #endif - /* Unfortunately we can't fully avoid #ifdef forests, - because the BSDs are bloody snowflakes. See: setgroups(). */ - -#undef SKALIBS_BSD_SUCKS -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DragonFly__) -# define SKALIBS_BSD_SUCKS -#endif - - /* old versions of BSD and some broken GNU toolchains: system headers are not self-contained, starting with sys/types.h normally always works. */ diff --git a/src/include/skalibs/posixishard.h b/src/include/skalibs/posixishard.h @@ -0,0 +1,30 @@ +/* ISC license. */ + +#ifndef SKALIBS_POSIXISHARD_H +#define SKALIBS_POSIXISHARD_H + +#include <stddef.h> + +#include <skalibs/gccattributes.h> + + /* + This header must be used with some broken OSes who have + serious trouble implementing even easy parts of POSIX. + It's supposed to be included *after* system headers, so + it won't catch behaviour such as "this macro must be defined + prior to including system headers in order to define that + symbol". If that's what you need, include skalibs/nonposix.h + instead, which must happen *before* system headers. + */ + +extern size_t strnlen (char const *, size_t) gccattr_pure ; + +#ifndef EPROTO +#define EPROTO EPROTOTYPE +#endif + +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + +#endif diff --git a/src/include/skalibs/posixplz.h b/src/include/skalibs/posixplz.h @@ -18,17 +18,6 @@ extern char **environ ; /* - Stuff that _is_ POSIX, but some OSes still don't have it. - openat() et al. should be here, but they're impossible to - emulate correctly, and I don't want an app using openat() - to think it has safe POSIX semantics when it doesn't :/ - EPROTO et al. should be here, but ugh ifdef forests. - */ - -extern size_t strnlen (char const *, size_t) gccattr_pure ; - - - /* Non-POSIX functions that some OSes provide and others don't. setgroups() isn't included because it's its own kind of broken. */ diff --git a/src/include/skalibs/skalibs.h b/src/include/skalibs/skalibs.h @@ -4,8 +4,11 @@ #define SKALIBS_H /* - This header includes everything in skalibs except skalibs/config.h - It's heavy! + This header is heavy! It includes everything in skalibs except: + - skalibs/config.h: package configuration + - skalibs/sysdeps.h: system-dependent feature test macros + - skalibs/nonposix.h: pre-system headers definitions for POSIX extensions + - skalibs/posixishard.h: workarounds for failures to respect POSIX */ #include <skalibs/posixplz.h> diff --git a/src/include/skalibs/stddjb.h b/src/include/skalibs/stddjb.h @@ -3,7 +3,6 @@ #ifndef STDDJB_H #define STDDJB_H -#include <skalibs/config.h> #include <skalibs/uint16.h> #include <skalibs/uint32.h> #include <skalibs/uint64.h> diff --git a/src/libposixplz/strnlen.c b/src/libposixplz/strnlen.c @@ -6,7 +6,7 @@ #include <string.h> #include <skalibs/bytestr.h> -#include <skalibs/posixplz.h> +#include <skalibs/posixishard.h> size_t strnlen (char const *s, size_t max) { diff --git a/src/libstddjb/cdb_read.c b/src/libstddjb/cdb_read.c @@ -3,7 +3,8 @@ #include <unistd.h> #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/allreadwrite.h> #include <skalibs/cdb.h> diff --git a/src/libstddjb/ipc_bind.c b/src/libstddjb/ipc_bind.c @@ -1,11 +1,13 @@ /* ISC license. */ #include <skalibs/nonposix.h> + #include <sys/socket.h> #include <sys/un.h> #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/webipc.h> int ipc_bind (int s, char const *p) diff --git a/src/libstddjb/ipc_connect.c b/src/libstddjb/ipc_connect.c @@ -1,11 +1,13 @@ /* ISC license. */ #include <skalibs/nonposix.h> + #include <errno.h> #include <sys/socket.h> #include <sys/un.h> #include <string.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/webipc.h> int ipc_connect (int s, char const *p) diff --git a/src/libstddjb/ipc_recv.c b/src/libstddjb/ipc_recv.c @@ -1,11 +1,13 @@ /* ISC license. */ #include <skalibs/nonposix.h> + #include <errno.h> #include <sys/socket.h> #include <sys/un.h> #include <string.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/webipc.h> ssize_t ipc_recv (int fd, char *s, size_t len, char *path) diff --git a/src/libstddjb/ipc_send.c b/src/libstddjb/ipc_send.c @@ -1,11 +1,13 @@ /* ISC license. */ #include <skalibs/nonposix.h> + #include <errno.h> #include <sys/socket.h> #include <sys/un.h> #include <string.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/webipc.h> ssize_t ipc_send (int fd, char const *s, size_t len, char const *path) diff --git a/src/libstddjb/netstring_get.c b/src/libstddjb/netstring_get.c @@ -1,11 +1,12 @@ /* ISC license. */ #include <errno.h> + +#include <skalibs/posixishard.h> #include <skalibs/types.h> #include <skalibs/allreadwrite.h> #include <skalibs/bytestr.h> #include <skalibs/buffer.h> -#include <skalibs/error.h> #include <skalibs/stralloc.h> #include <skalibs/netstring.h> diff --git a/src/libstddjb/string_unquote_withdelim.c b/src/libstddjb/string_unquote_withdelim.c @@ -1,7 +1,8 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/bytestr.h> #include <skalibs/fmtscan.h> #include <skalibs/skamisc.h> diff --git 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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 ; diff --git a/src/sysdeps/tryeproto.c b/src/sysdeps/tryeproto.c @@ -1,9 +0,0 @@ -/* ISC license. */ - -#include <errno.h> - -static int dummy ; - -#ifndef EPROTO - syntax error ! -#endif