summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure1
-rw-r--r--package/deps.mak101
-rw-r--r--src/include/skalibs/djbunix.h2
-rw-r--r--src/include/skalibs/fcntl.h20
-rw-r--r--src/include/skalibs/gol.h32
-rw-r--r--src/include/skalibs/socket.h2
-rw-r--r--src/libposixplz/mkptemp2.c2
-rw-r--r--src/libstddjb/coe.c2
-rw-r--r--src/libstddjb/fd_ensure_open.c2
-rw-r--r--src/libstddjb/fd_islocked.c2
-rw-r--r--src/libstddjb/fd_lock.c2
-rw-r--r--src/libstddjb/fd_unlock.c2
-rw-r--r--src/libstddjb/filecopy_unsafe.c2
-rw-r--r--src/libstddjb/gol.c52
-rw-r--r--src/libstddjb/gol_argv.c26
-rw-r--r--src/libstddjb/hiercopy_internal.c2
-rw-r--r--src/libstddjb/ipc_accept.c2
-rw-r--r--src/libstddjb/ipc_bind_reuse_lock_perms.c2
-rw-r--r--src/libstddjb/ndelay_off.c2
-rw-r--r--src/libstddjb/ndelay_on.c2
-rw-r--r--src/libstddjb/open2.c28
-rw-r--r--src/libstddjb/open3.c28
-rw-r--r--src/libstddjb/open_append.c2
-rw-r--r--src/libstddjb/open_create.c2
-rw-r--r--src/libstddjb/open_excl.c2
-rw-r--r--src/libstddjb/open_read.c2
-rw-r--r--src/libstddjb/open_trunc.c2
-rw-r--r--src/libstddjb/open_write.c2
-rw-r--r--src/libstddjb/openb_read.c2
-rw-r--r--src/libstddjb/openbc_read.c2
-rw-r--r--src/libstddjb/openc_append.c2
-rw-r--r--src/libstddjb/openc_create.c2
-rw-r--r--src/libstddjb/openc_excl.c2
-rw-r--r--src/libstddjb/openc_read.c2
-rw-r--r--src/libstddjb/openc_trunc.c2
-rw-r--r--src/libstddjb/openc_write.c2
-rw-r--r--src/libstddjb/pipe_internal.c2
-rw-r--r--src/libstddjb/socket_accept4.c2
-rw-r--r--src/libstddjb/socket_accept6.c2
-rw-r--r--src/libstddjb/socket_internal.c2
-rw-r--r--src/libstddjb/socketpair_internal.c3
-rw-r--r--src/libstddjb/uncoe.c2
-rw-r--r--src/libunixonacid/access_at.c2
-rw-r--r--src/libunixonacid/open2_at.c7
-rw-r--r--src/libunixonacid/open3_at.c7
-rw-r--r--src/libunixonacid/open_appendat.c3
-rw-r--r--src/libunixonacid/open_readat.c2
-rw-r--r--src/libunixonacid/open_truncat.c2
-rw-r--r--src/libunixonacid/open_writeat.c2
-rw-r--r--src/libunixonacid/openc_appendat.c2
-rw-r--r--src/libunixonacid/openc_readat.c3
-rw-r--r--src/libunixonacid/openc_truncat.c3
-rw-r--r--src/libunixonacid/openc_writeat.c3
-rw-r--r--src/libunixonacid/stat_at.c8
-rw-r--r--src/libunixonacid/textclient_server_init_frompipe.c2
-rw-r--r--src/sysdeps/tryocloexec.c5
56 files changed, 300 insertions, 108 deletions
diff --git a/configure b/configure
index 8ebaf8d..74ffcc8 100755
--- a/configure
+++ b/configure
@@ -628,6 +628,7 @@ choose cl sopeercred 'SO_PEERCRED'
choose cl getpeerucred 'getpeerucred()'
choose cl ipv6 'IPv6 support' $socket_lib
choose c msgdontwait 'MSG_DONTWAIT'
+choose c ocloexec 'O_CLOEXEC'
choose c odirectory 'O_DIRECTORY'
choose cl openat 'openat()'
choose cl linkat 'linkat()'
diff --git a/package/deps.mak b/package/deps.mak
index 18ccb60..77860a3 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -18,7 +18,7 @@ src/include/skalibs/cdb.h: src/include/skalibs/gccattributes.h
src/include/skalibs/cdbmake.h: src/include/skalibs/buffer.h src/include/skalibs/genalloc.h
src/include/skalibs/datastruct.h: src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/avltreen.h src/include/skalibs/bigkv.h src/include/skalibs/genqdyn.h src/include/skalibs/genset.h src/include/skalibs/gensetdyn.h
src/include/skalibs/djbtime.h: src/include/skalibs/tai.h src/include/skalibs/uint64.h
-src/include/skalibs/djbunix.h: src/include/skalibs/devino.h src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h
+src/include/skalibs/djbunix.h: src/include/skalibs/devino.h src/include/skalibs/fcntl.h src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h
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/error.h: src/include/skalibs/gccattributes.h
@@ -28,6 +28,7 @@ src/include/skalibs/genalloc.h: src/include/skalibs/functypes.h src/include/skal
src/include/skalibs/genqdyn.h: src/include/skalibs/stralloc.h
src/include/skalibs/genset.h: src/include/skalibs/functypes.h
src/include/skalibs/gensetdyn.h: src/include/skalibs/functypes.h src/include/skalibs/genalloc.h src/include/skalibs/stralloc.h
+src/include/skalibs/gol.h: src/include/skalibs/uint64.h
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/strerr.h
@@ -42,7 +43,7 @@ src/include/skalibs/siovec.h: src/include/skalibs/gccattributes.h
src/include/skalibs/skaclient.h: src/include/skalibs/kolbak.h src/include/skalibs/tai.h src/include/skalibs/unixmessage.h
src/include/skalibs/skalibs.h: src/include/skalibs/datastruct.h src/include/skalibs/posixplz.h src/include/skalibs/random.h src/include/skalibs/stdcrypto.h src/include/skalibs/stddjb.h src/include/skalibs/strerr.h src/include/skalibs/unixonacid.h
src/include/skalibs/skamisc.h: src/include/skalibs/buffer.h src/include/skalibs/stralloc.h
-src/include/skalibs/socket.h: src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h src/include/skalibs/tai.h
+src/include/skalibs/socket.h: src/include/skalibs/fcntl.h src/include/skalibs/gccattributes.h src/include/skalibs/posixplz.h src/include/skalibs/tai.h
src/include/skalibs/stat.h: src/include/skalibs/sysdeps.h
src/include/skalibs/stdcrypto.h: src/include/skalibs/blake2s.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/cdbmake.h src/include/skalibs/cspawn.h src/include/skalibs/devino.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/exec.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/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/netstring.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/tai.h src/include/skalibs/types.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h
@@ -163,7 +164,7 @@ src/libposixplz/mkhtemp.o src/libposixplz/mkhtemp.lo: src/libposixplz/mkhtemp.c
src/libposixplz/mklinktemp.o src/libposixplz/mklinktemp.lo: src/libposixplz/mklinktemp.c src/include/skalibs/djbunix.h src/libposixplz/posixplz-internal.h src/include/skalibs/posixplz.h
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/posixplz.h
-src/libposixplz/mkptemp2.o src/libposixplz/mkptemp2.lo: src/libposixplz/mkptemp2.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
+src/libposixplz/mkptemp2.o src/libposixplz/mkptemp2.lo: src/libposixplz/mkptemp2.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/posixplz.h
src/libposixplz/munmap_void.o src/libposixplz/munmap_void.lo: src/libposixplz/munmap_void.c 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/posixishard.h src/include/skalibs/setgroups.h src/include/skalibs/sysdeps.h
src/libposixplz/strcasestr.o src/libposixplz/strcasestr.lo: src/libposixplz/strcasestr.c src/include/skalibs/bytestr.h src/include/skalibs/sysdeps.h
@@ -310,7 +311,7 @@ src/libstddjb/child_spawn1_pipe.o src/libstddjb/child_spawn1_pipe.lo: src/libstd
src/libstddjb/child_spawn1_socket.o src/libstddjb/child_spawn1_socket.lo: src/libstddjb/child_spawn1_socket.c src/libstddjb/cspawn-internal.h src/include/skalibs/cspawn.h src/include/skalibs/socket.h
src/libstddjb/child_spawn2.o src/libstddjb/child_spawn2.lo: src/libstddjb/child_spawn2.c src/include/skalibs/cspawn.h src/include/skalibs/djbunix.h
src/libstddjb/child_spawn3.o src/libstddjb/child_spawn3.lo: src/libstddjb/child_spawn3.c src/include/skalibs/cspawn.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/types.h
-src/libstddjb/coe.o src/libstddjb/coe.lo: src/libstddjb/coe.c src/include/skalibs/djbunix.h
+src/libstddjb/coe.o src/libstddjb/coe.lo: src/libstddjb/coe.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
src/libstddjb/cspawn.o src/libstddjb/cspawn.lo: src/libstddjb/cspawn.c src/include/skalibs/allreadwrite.h src/include/skalibs/config.h src/include/skalibs/cspawn.h src/include/skalibs/djbunix.h src/include/skalibs/exec.h src/include/skalibs/nonposix.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
src/libstddjb/deepsleepuntil.o src/libstddjb/deepsleepuntil.lo: src/libstddjb/deepsleepuntil.c src/include/skalibs/iopause.h src/include/skalibs/tai.h
src/libstddjb/devino_cmp.o src/libstddjb/devino_cmp.lo: src/libstddjb/devino_cmp.c src/include/skalibs/devino.h
@@ -326,9 +327,9 @@ src/libstddjb/fd_chown.o src/libstddjb/fd_chown.lo: src/libstddjb/fd_chown.c src
src/libstddjb/fd_close.o src/libstddjb/fd_close.lo: src/libstddjb/fd_close.c src/include/skalibs/djbunix.h
src/libstddjb/fd_copy.o src/libstddjb/fd_copy.lo: src/libstddjb/fd_copy.c src/include/skalibs/djbunix.h
src/libstddjb/fd_copy2.o src/libstddjb/fd_copy2.lo: src/libstddjb/fd_copy2.c src/include/skalibs/djbunix.h
-src/libstddjb/fd_ensure_open.o src/libstddjb/fd_ensure_open.lo: src/libstddjb/fd_ensure_open.c src/include/skalibs/djbunix.h
-src/libstddjb/fd_islocked.o src/libstddjb/fd_islocked.lo: src/libstddjb/fd_islocked.c src/include/skalibs/djbunix.h
-src/libstddjb/fd_lock.o src/libstddjb/fd_lock.lo: src/libstddjb/fd_lock.c src/include/skalibs/djbunix.h src/include/skalibs/error.h
+src/libstddjb/fd_ensure_open.o src/libstddjb/fd_ensure_open.lo: src/libstddjb/fd_ensure_open.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
+src/libstddjb/fd_islocked.o src/libstddjb/fd_islocked.lo: src/libstddjb/fd_islocked.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
+src/libstddjb/fd_lock.o src/libstddjb/fd_lock.lo: src/libstddjb/fd_lock.c src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/fcntl.h
src/libstddjb/fd_move.o src/libstddjb/fd_move.lo: src/libstddjb/fd_move.c src/include/skalibs/djbunix.h
src/libstddjb/fd_move2.o src/libstddjb/fd_move2.lo: src/libstddjb/fd_move2.c src/include/skalibs/djbunix.h
src/libstddjb/fd_read.o src/libstddjb/fd_read.lo: src/libstddjb/fd_read.c src/include/skalibs/allreadwrite.h
@@ -337,11 +338,11 @@ src/libstddjb/fd_recv.o src/libstddjb/fd_recv.lo: src/libstddjb/fd_recv.c src/in
src/libstddjb/fd_send.o src/libstddjb/fd_send.lo: src/libstddjb/fd_send.c src/include/skalibs/allreadwrite.h
src/libstddjb/fd_shutdown.o src/libstddjb/fd_shutdown.lo: src/libstddjb/fd_shutdown.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
src/libstddjb/fd_sync.o src/libstddjb/fd_sync.lo: src/libstddjb/fd_sync.c src/include/skalibs/djbunix.h
-src/libstddjb/fd_unlock.o src/libstddjb/fd_unlock.lo: src/libstddjb/fd_unlock.c src/include/skalibs/djbunix.h
+src/libstddjb/fd_unlock.o src/libstddjb/fd_unlock.lo: src/libstddjb/fd_unlock.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
src/libstddjb/fd_write.o src/libstddjb/fd_write.lo: src/libstddjb/fd_write.c src/include/skalibs/allreadwrite.h
src/libstddjb/fd_writev.o src/libstddjb/fd_writev.lo: src/libstddjb/fd_writev.c src/include/skalibs/allreadwrite.h
src/libstddjb/filecopy_suffix.o src/libstddjb/filecopy_suffix.lo: src/libstddjb/filecopy_suffix.c src/include/skalibs/djbunix.h
-src/libstddjb/filecopy_unsafe.o src/libstddjb/filecopy_unsafe.lo: src/libstddjb/filecopy_unsafe.c src/include/skalibs/djbunix.h
+src/libstddjb/filecopy_unsafe.o src/libstddjb/filecopy_unsafe.lo: src/libstddjb/filecopy_unsafe.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
src/libstddjb/fmtscan_asc.o src/libstddjb/fmtscan_asc.lo: src/libstddjb/fmtscan_asc.c src/include/skalibs/fmtscan.h
src/libstddjb/fmtscan_num.o src/libstddjb/fmtscan_num.lo: src/libstddjb/fmtscan_num.c src/include/skalibs/fmtscan.h
src/libstddjb/gcspawn.o src/libstddjb/gcspawn.lo: src/libstddjb/gcspawn.c src/include/skalibs/allreadwrite.h src/include/skalibs/cspawn.h src/include/skalibs/djbunix.h src/include/skalibs/types.h
@@ -356,8 +357,10 @@ src/libstddjb/genwrite_stderr.o src/libstddjb/genwrite_stderr.lo: src/libstddjb/
src/libstddjb/genwrite_stdout.o src/libstddjb/genwrite_stdout.lo: src/libstddjb/genwrite_stdout.c src/include/skalibs/buffer.h src/include/skalibs/genwrite.h
src/libstddjb/getlnmax.o src/libstddjb/getlnmax.lo: src/libstddjb/getlnmax.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h
src/libstddjb/getlnmaxsep.o src/libstddjb/getlnmaxsep.lo: src/libstddjb/getlnmaxsep.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h
+src/libstddjb/gol.o src/libstddjb/gol.lo: src/libstddjb/gol.c src/include/skalibs/gol.h
+src/libstddjb/gol_argv.o src/libstddjb/gol_argv.lo: src/libstddjb/gol_argv.c src/include/skalibs/gol.h src/include/skalibs/strerr.h
src/libstddjb/hiercopy.o src/libstddjb/hiercopy.lo: src/libstddjb/hiercopy.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h
-src/libstddjb/hiercopy_internal.o src/libstddjb/hiercopy_internal.lo: src/libstddjb/hiercopy_internal.c src/include/skalibs/direntry.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/hiercopy_internal.o src/libstddjb/hiercopy_internal.lo: src/libstddjb/hiercopy_internal.c src/include/skalibs/direntry.h src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/stralloc.h
src/libstddjb/hiercopy_loose.o src/libstddjb/hiercopy_loose.lo: src/libstddjb/hiercopy_loose.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h
src/libstddjb/hiercopy_loose_tmp.o src/libstddjb/hiercopy_loose_tmp.lo: src/libstddjb/hiercopy_loose_tmp.c src/include/skalibs/djbunix.h
src/libstddjb/hiercopy_tmp.o src/libstddjb/hiercopy_tmp.lo: src/libstddjb/hiercopy_tmp.c src/include/skalibs/djbunix.h
@@ -391,10 +394,10 @@ src/libstddjb/ip4_scanu32.o src/libstddjb/ip4_scanu32.lo: src/libstddjb/ip4_scan
src/libstddjb/ip6_fmt.o src/libstddjb/ip6_fmt.lo: src/libstddjb/ip6_fmt.c src/include/skalibs/diuint.h src/include/skalibs/fmtscan.h
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/socket.h src/include/skalibs/sysdeps.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/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.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/socket.h
src/libstddjb/ipc_bind_reuse.o src/libstddjb/ipc_bind_reuse.lo: src/libstddjb/ipc_bind_reuse.c src/include/skalibs/socket.h
-src/libstddjb/ipc_bind_reuse_lock_perms.o src/libstddjb/ipc_bind_reuse_lock_perms.lo: src/libstddjb/ipc_bind_reuse_lock_perms.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h
+src/libstddjb/ipc_bind_reuse_lock_perms.o src/libstddjb/ipc_bind_reuse_lock_perms.lo: src/libstddjb/ipc_bind_reuse_lock_perms.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h
src/libstddjb/ipc_bind_reuse_perms.o src/libstddjb/ipc_bind_reuse_perms.lo: src/libstddjb/ipc_bind_reuse_perms.c src/include/skalibs/socket.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/socket.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/socket.h
@@ -424,8 +427,8 @@ src/libstddjb/ltm64_from_localtm.o src/libstddjb/ltm64_from_localtm.lo: src/libs
src/libstddjb/ltm64_from_sysclock.o src/libstddjb/ltm64_from_sysclock.lo: src/libstddjb/ltm64_from_sysclock.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h
src/libstddjb/ltm64_from_tai.o src/libstddjb/ltm64_from_tai.lo: src/libstddjb/ltm64_from_tai.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h
src/libstddjb/ltm64_from_utc.o src/libstddjb/ltm64_from_utc.lo: src/libstddjb/ltm64_from_utc.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
-src/libstddjb/ndelay_off.o src/libstddjb/ndelay_off.lo: src/libstddjb/ndelay_off.c src/include/skalibs/djbunix.h
-src/libstddjb/ndelay_on.o src/libstddjb/ndelay_on.lo: src/libstddjb/ndelay_on.c src/include/skalibs/djbunix.h
+src/libstddjb/ndelay_off.o src/libstddjb/ndelay_off.lo: src/libstddjb/ndelay_off.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
+src/libstddjb/ndelay_on.o src/libstddjb/ndelay_on.lo: src/libstddjb/ndelay_on.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
src/libstddjb/netstring_append.o src/libstddjb/netstring_append.lo: src/libstddjb/netstring_append.c src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h
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
@@ -433,24 +436,24 @@ src/libstddjb/netstring_encode.o src/libstddjb/netstring_encode.lo: src/libstddj
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
-src/libstddjb/open3.o src/libstddjb/open3.lo: src/libstddjb/open3.c src/include/skalibs/nonposix.h
-src/libstddjb/open_append.o src/libstddjb/open_append.lo: src/libstddjb/open_append.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/open_create.o src/libstddjb/open_create.lo: src/libstddjb/open_create.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/open_excl.o src/libstddjb/open_excl.lo: src/libstddjb/open_excl.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/open_read.o src/libstddjb/open_read.lo: src/libstddjb/open_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
+src/libstddjb/open2.o src/libstddjb/open2.lo: src/libstddjb/open2.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/open3.o src/libstddjb/open3.lo: src/libstddjb/open3.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/open_append.o src/libstddjb/open_append.lo: src/libstddjb/open_append.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/open_create.o src/libstddjb/open_create.lo: src/libstddjb/open_create.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/open_excl.o src/libstddjb/open_excl.lo: src/libstddjb/open_excl.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/open_read.o src/libstddjb/open_read.lo: src/libstddjb/open_read.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
src/libstddjb/open_readb.o src/libstddjb/open_readb.lo: src/libstddjb/open_readb.c src/include/skalibs/djbunix.h
-src/libstddjb/open_trunc.o src/libstddjb/open_trunc.lo: src/libstddjb/open_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/open_write.o src/libstddjb/open_write.lo: src/libstddjb/open_write.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openb_read.o src/libstddjb/openb_read.lo: src/libstddjb/openb_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openbc_read.o src/libstddjb/openbc_read.lo: src/libstddjb/openbc_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openc_append.o src/libstddjb/openc_append.lo: src/libstddjb/openc_append.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openc_create.o src/libstddjb/openc_create.lo: src/libstddjb/openc_create.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openc_excl.o src/libstddjb/openc_excl.lo: src/libstddjb/openc_excl.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openc_read.o src/libstddjb/openc_read.lo: src/libstddjb/openc_read.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
+src/libstddjb/open_trunc.o src/libstddjb/open_trunc.lo: src/libstddjb/open_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/open_write.o src/libstddjb/open_write.lo: src/libstddjb/open_write.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openb_read.o src/libstddjb/openb_read.lo: src/libstddjb/openb_read.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openbc_read.o src/libstddjb/openbc_read.lo: src/libstddjb/openbc_read.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_append.o src/libstddjb/openc_append.lo: src/libstddjb/openc_append.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_create.o src/libstddjb/openc_create.lo: src/libstddjb/openc_create.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_excl.o src/libstddjb/openc_excl.lo: src/libstddjb/openc_excl.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_read.o src/libstddjb/openc_read.lo: src/libstddjb/openc_read.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
src/libstddjb/openc_readb.o src/libstddjb/openc_readb.lo: src/libstddjb/openc_readb.c src/include/skalibs/djbunix.h
-src/libstddjb/openc_trunc.o src/libstddjb/openc_trunc.lo: src/libstddjb/openc_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
-src/libstddjb/openc_write.o src/libstddjb/openc_write.lo: src/libstddjb/openc_write.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_trunc.o src/libstddjb/openc_trunc.lo: src/libstddjb/openc_trunc.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
+src/libstddjb/openc_write.o src/libstddjb/openc_write.lo: src/libstddjb/openc_write.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h
src/libstddjb/openreadfileclose.o src/libstddjb/openreadfileclose.lo: src/libstddjb/openreadfileclose.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
src/libstddjb/openreadnclose.o src/libstddjb/openreadnclose.lo: src/libstddjb/openreadnclose.c src/include/skalibs/djbunix.h
src/libstddjb/openreadnclose_nb.o src/libstddjb/openreadnclose_nb.lo: src/libstddjb/openreadnclose_nb.c src/include/skalibs/djbunix.h
@@ -462,7 +465,7 @@ src/libstddjb/openwritevnclose5.o src/libstddjb/openwritevnclose5.lo: src/libstd
src/libstddjb/openwritevnclose_suffix6.o src/libstddjb/openwritevnclose_suffix6.lo: src/libstddjb/openwritevnclose_suffix6.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
src/libstddjb/openwritevnclose_unsafe5.o src/libstddjb/openwritevnclose_unsafe5.lo: src/libstddjb/openwritevnclose_unsafe5.c src/include/skalibs/djbunix.h src/include/skalibs/posixplz.h
src/libstddjb/path_canonicalize.o src/libstddjb/path_canonicalize.lo: src/libstddjb/path_canonicalize.c src/include/skalibs/djbunix.h
-src/libstddjb/pipe_internal.o src/libstddjb/pipe_internal.lo: src/libstddjb/pipe_internal.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/pipe_internal.o src/libstddjb/pipe_internal.lo: src/libstddjb/pipe_internal.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
src/libstddjb/prog.o src/libstddjb/prog.lo: src/libstddjb/prog.c src/include/skalibs/strerr.h
src/libstddjb/readnclose.o src/libstddjb/readnclose.lo: src/libstddjb/readnclose.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h
src/libstddjb/rm_rf.o src/libstddjb/rm_rf.lo: src/libstddjb/rm_rf.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h
@@ -510,9 +513,9 @@ src/libstddjb/skagetlnsep.o src/libstddjb/skagetlnsep.lo: src/libstddjb/skagetln
src/libstddjb/skagetlnsep_loose.o src/libstddjb/skagetlnsep_loose.lo: src/libstddjb/skagetlnsep_loose.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
src/libstddjb/skalibs_tzisright.o src/libstddjb/skalibs_tzisright.lo: src/libstddjb/skalibs_tzisright.c src/libstddjb/djbtime-internal.h
src/libstddjb/slurpn.o src/libstddjb/slurpn.lo: src/libstddjb/slurpn.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
-src/libstddjb/socket_accept4.o src/libstddjb/socket_accept4.lo: src/libstddjb/socket_accept4.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h
+src/libstddjb/socket_accept4.o src/libstddjb/socket_accept4.lo: src/libstddjb/socket_accept4.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h
src/libstddjb/socket_accept4_u32.o src/libstddjb/socket_accept4_u32.lo: src/libstddjb/socket_accept4_u32.c src/include/skalibs/socket.h src/include/skalibs/uint32.h
-src/libstddjb/socket_accept6.o src/libstddjb/socket_accept6.lo: src/libstddjb/socket_accept6.c src/include/skalibs/djbunix.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h
+src/libstddjb/socket_accept6.o src/libstddjb/socket_accept6.lo: src/libstddjb/socket_accept6.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h src/include/skalibs/uint16.h
src/libstddjb/socket_bind4.o src/libstddjb/socket_bind4.lo: src/libstddjb/socket_bind4.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
src/libstddjb/socket_bind4r.o src/libstddjb/socket_bind4r.lo: src/libstddjb/socket_bind4r.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h
src/libstddjb/socket_bind6.o src/libstddjb/socket_bind6.lo: src/libstddjb/socket_bind6.c src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
@@ -525,7 +528,7 @@ src/libstddjb/socket_deadlineconnstamp4.o src/libstddjb/socket_deadlineconnstamp
src/libstddjb/socket_deadlineconnstamp46.o src/libstddjb/socket_deadlineconnstamp46.lo: src/libstddjb/socket_deadlineconnstamp46.c src/include/skalibs/error.h src/include/skalibs/ip46.h src/include/skalibs/socket.h
src/libstddjb/socket_deadlineconnstamp4_u32.o src/libstddjb/socket_deadlineconnstamp4_u32.lo: src/libstddjb/socket_deadlineconnstamp4_u32.c src/include/skalibs/socket.h src/include/skalibs/uint32.h
src/libstddjb/socket_deadlineconnstamp6.o src/libstddjb/socket_deadlineconnstamp6.lo: src/libstddjb/socket_deadlineconnstamp6.c src/include/skalibs/error.h src/include/skalibs/socket.h
-src/libstddjb/socket_internal.o src/libstddjb/socket_internal.lo: src/libstddjb/socket_internal.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h
+src/libstddjb/socket_internal.o src/libstddjb/socket_internal.lo: src/libstddjb/socket_internal.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h
src/libstddjb/socket_ioloop.o src/libstddjb/socket_ioloop.lo: src/libstddjb/socket_ioloop.c src/include/skalibs/error.h src/include/skalibs/iopause.h src/include/skalibs/socket.h
src/libstddjb/socket_ioloop_send4.o src/libstddjb/socket_ioloop_send4.lo: src/libstddjb/socket_ioloop_send4.c src/include/skalibs/socket.h
src/libstddjb/socket_ioloop_send6.o src/libstddjb/socket_ioloop_send6.lo: src/libstddjb/socket_ioloop_send6.c src/include/skalibs/socket.h
@@ -549,7 +552,7 @@ src/libstddjb/socket_tryreservein.o src/libstddjb/socket_tryreservein.lo: src/li
src/libstddjb/socket_udp4.o src/libstddjb/socket_udp4.lo: src/libstddjb/socket_udp4.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h
src/libstddjb/socket_udp6.o src/libstddjb/socket_udp6.lo: src/libstddjb/socket_udp6.c src/include/skalibs/djbunix.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h
src/libstddjb/socket_waitconn.o src/libstddjb/socket_waitconn.lo: src/libstddjb/socket_waitconn.c src/include/skalibs/allreadwrite.h src/include/skalibs/iopause.h src/include/skalibs/socket.h
-src/libstddjb/socketpair_internal.o src/libstddjb/socketpair_internal.lo: src/libstddjb/socketpair_internal.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h
+src/libstddjb/socketpair_internal.o src/libstddjb/socketpair_internal.lo: src/libstddjb/socketpair_internal.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/sysdeps.h
src/libstddjb/stamp.o src/libstddjb/stamp.lo: src/libstddjb/stamp.c src/include/skalibs/tai.h
src/libstddjb/str_chr.o src/libstddjb/str_chr.lo: src/libstddjb/str_chr.c src/include/skalibs/bytestr.h
src/libstddjb/str_fmt.o src/libstddjb/str_fmt.lo: src/libstddjb/str_fmt.c src/include/skalibs/fmtscan.h
@@ -696,7 +699,7 @@ src/libstddjb/uint64_scan_base_max.o src/libstddjb/uint64_scan_base_max.lo: src/
src/libstddjb/uint64_scanlist.o src/libstddjb/uint64_scanlist.lo: src/libstddjb/uint64_scanlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint64.h
src/libstddjb/uint64_unpack.o src/libstddjb/uint64_unpack.lo: src/libstddjb/uint64_unpack.c src/include/skalibs/uint64.h
src/libstddjb/uint64_unpack_big.o src/libstddjb/uint64_unpack_big.lo: src/libstddjb/uint64_unpack_big.c src/include/skalibs/uint64.h
-src/libstddjb/uncoe.o src/libstddjb/uncoe.lo: src/libstddjb/uncoe.c src/include/skalibs/djbunix.h
+src/libstddjb/uncoe.o src/libstddjb/uncoe.lo: src/libstddjb/uncoe.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h
src/libstddjb/unsanitize_read.o src/libstddjb/unsanitize_read.lo: src/libstddjb/unsanitize_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/error.h
src/libstddjb/utc_from_localtm.o src/libstddjb/utc_from_localtm.lo: src/libstddjb/utc_from_localtm.c src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
src/libstddjb/utc_from_ltm64.o src/libstddjb/utc_from_ltm64.lo: src/libstddjb/utc_from_ltm64.c src/include/skalibs/config.h src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
@@ -715,7 +718,7 @@ src/libstddjb/waitn_reap_posix.o src/libstddjb/waitn_reap_posix.lo: src/libstddj
src/libstddjb/waitpid_nointr.o src/libstddjb/waitpid_nointr.lo: src/libstddjb/waitpid_nointr.c src/include/skalibs/djbunix.h
src/libstddjb/writenclose_unsafe5.o src/libstddjb/writenclose_unsafe5.lo: src/libstddjb/writenclose_unsafe5.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h
src/libstddjb/writevnclose_unsafe5.o src/libstddjb/writevnclose_unsafe5.lo: src/libstddjb/writevnclose_unsafe5.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/siovec.h
-src/libunixonacid/access_at.o src/libunixonacid/access_at.lo: src/libunixonacid/access_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/access_at.o src/libunixonacid/access_at.lo: src/libunixonacid/access_at.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/unix-transactional.h
src/libunixonacid/ancil_recv_fd.o src/libunixonacid/ancil_recv_fd.lo: src/libunixonacid/ancil_recv_fd.c src/include/skalibs/allreadwrite.h src/include/skalibs/ancil.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h src/include/skalibs/sysdeps.h
src/libunixonacid/ancil_send_fd.o src/libunixonacid/ancil_send_fd.lo: src/libunixonacid/ancil_send_fd.c src/include/skalibs/ancil.h src/include/skalibs/nonposix.h src/include/skalibs/posixishard.h
src/libunixonacid/atomic_rm_rf.o src/libunixonacid/atomic_rm_rf.lo: src/libunixonacid/atomic_rm_rf.c src/include/skalibs/skamisc.h src/include/skalibs/unix-transactional.h
@@ -735,23 +738,23 @@ src/libunixonacid/kolbak_enqueue.o src/libunixonacid/kolbak_enqueue.lo: src/libu
src/libunixonacid/kolbak_queue_init.o src/libunixonacid/kolbak_queue_init.lo: src/libunixonacid/kolbak_queue_init.c src/include/skalibs/kolbak.h
src/libunixonacid/kolbak_unenqueue.o src/libunixonacid/kolbak_unenqueue.lo: src/libunixonacid/kolbak_unenqueue.c src/include/skalibs/kolbak.h
src/libunixonacid/netstring_timed_get.o src/libunixonacid/netstring_timed_get.lo: src/libunixonacid/netstring_timed_get.c src/include/skalibs/buffer.h src/include/skalibs/iopause.h src/include/skalibs/netstring.h src/include/skalibs/unix-timed.h
-src/libunixonacid/open2_at.o src/libunixonacid/open2_at.lo: src/libunixonacid/open2_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/open3_at.o src/libunixonacid/open3_at.lo: src/libunixonacid/open3_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/open_appendat.o src/libunixonacid/open_appendat.lo: src/libunixonacid/open_appendat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/open2_at.o src/libunixonacid/open2_at.lo: src/libunixonacid/open2_at.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/open3_at.o src/libunixonacid/open3_at.lo: src/libunixonacid/open3_at.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/open_appendat.o src/libunixonacid/open_appendat.lo: src/libunixonacid/open_appendat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/open_appendatb.o src/libunixonacid/open_appendatb.lo: src/libunixonacid/open_appendatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/open_readat.o src/libunixonacid/open_readat.lo: src/libunixonacid/open_readat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/open_readat.o src/libunixonacid/open_readat.lo: src/libunixonacid/open_readat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/open_readatb.o src/libunixonacid/open_readatb.lo: src/libunixonacid/open_readatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/open_truncat.o src/libunixonacid/open_truncat.lo: src/libunixonacid/open_truncat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/open_truncat.o src/libunixonacid/open_truncat.lo: src/libunixonacid/open_truncat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/open_truncatb.o src/libunixonacid/open_truncatb.lo: src/libunixonacid/open_truncatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/open_writeat.o src/libunixonacid/open_writeat.lo: src/libunixonacid/open_writeat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/open_writeat.o src/libunixonacid/open_writeat.lo: src/libunixonacid/open_writeat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/open_writeatb.o src/libunixonacid/open_writeatb.lo: src/libunixonacid/open_writeatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/openc_appendat.o src/libunixonacid/openc_appendat.lo: src/libunixonacid/openc_appendat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/openc_appendat.o src/libunixonacid/openc_appendat.lo: src/libunixonacid/openc_appendat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/openc_appendatb.o src/libunixonacid/openc_appendatb.lo: src/libunixonacid/openc_appendatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/openc_readat.o src/libunixonacid/openc_readat.lo: src/libunixonacid/openc_readat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/openc_readat.o src/libunixonacid/openc_readat.lo: src/libunixonacid/openc_readat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/openc_readatb.o src/libunixonacid/openc_readatb.lo: src/libunixonacid/openc_readatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/openc_truncat.o src/libunixonacid/openc_truncat.lo: src/libunixonacid/openc_truncat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/openc_truncat.o src/libunixonacid/openc_truncat.lo: src/libunixonacid/openc_truncat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/openc_truncatb.o src/libunixonacid/openc_truncatb.lo: src/libunixonacid/openc_truncatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
-src/libunixonacid/openc_writeat.o src/libunixonacid/openc_writeat.lo: src/libunixonacid/openc_writeat.c src/include/skalibs/unix-transactional.h
+src/libunixonacid/openc_writeat.o src/libunixonacid/openc_writeat.lo: src/libunixonacid/openc_writeat.c src/include/skalibs/fcntl.h src/include/skalibs/unix-transactional.h
src/libunixonacid/openc_writeatb.o src/libunixonacid/openc_writeatb.lo: src/libunixonacid/openc_writeatb.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
src/libunixonacid/opendir_at.o src/libunixonacid/opendir_at.lo: src/libunixonacid/opendir_at.c src/include/skalibs/direntry.h src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/unix-transactional.h
src/libunixonacid/opengetlnclose.o src/libunixonacid/opengetlnclose.lo: src/libunixonacid/opengetlnclose.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/unix-transactional.h
@@ -781,12 +784,12 @@ src/libunixonacid/skaclient_startf.o src/libunixonacid/skaclient_startf.lo: src/
src/libunixonacid/skaclient_startf_async.o src/libunixonacid/skaclient_startf_async.lo: src/libunixonacid/skaclient_startf_async.c src/include/skalibs/cspawn.h 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/stat_at.o src/libunixonacid/stat_at.lo: src/libunixonacid/stat_at.c src/include/skalibs/djbunix.h src/include/skalibs/fcntl.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/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/cspawn.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/cspawn.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_frompipe.o src/libunixonacid/textclient_server_init_frompipe.lo: src/libunixonacid/textclient_server_init_frompipe.c src/include/skalibs/allreadwrite.h src/include/skalibs/cspawn.h src/include/skalibs/fcntl.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/posixishard.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h
src/libunixonacid/textclient_start.o src/libunixonacid/textclient_start.lo: src/libunixonacid/textclient_start.c src/include/skalibs/djbunix.h src/include/skalibs/posixishard.h src/include/skalibs/socket.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h
src/libunixonacid/textclient_startf.o src/libunixonacid/textclient_startf.lo: src/libunixonacid/textclient_startf.c src/include/skalibs/allreadwrite.h src/include/skalibs/cspawn.h src/include/skalibs/posixishard.h src/include/skalibs/textclient.h src/include/skalibs/textmessage.h
diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h
index 68ec3b7..5bef6ec 100644
--- a/src/include/skalibs/djbunix.h
+++ b/src/include/skalibs/djbunix.h
@@ -6,11 +6,11 @@
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/wait.h>
-#include <fcntl.h>
#include <skalibs/gccattributes.h>
#include <skalibs/stralloc.h>
#include <skalibs/devino.h>
+#include <skalibs/fcntl.h>
extern int coe (int) ;
extern int uncoe (int) ;
diff --git a/src/include/skalibs/fcntl.h b/src/include/skalibs/fcntl.h
new file mode 100644
index 0000000..fa91343
--- /dev/null
+++ b/src/include/skalibs/fcntl.h
@@ -0,0 +1,20 @@
+/* ISC license. */
+
+#ifndef SKALIBS_FCNTL_H
+#define SKALIBS_FCNTL_H
+
+#include <fcntl.h>
+
+ /*
+ Old MacOS X doesn't have O_CLOEXEC.
+ We define it to something completely out of the way so we
+ can still use it in userspace.
+ Workarounds in syscalls will be enabled via the
+ SKALIBS_HASOCLOEXEC sysdep.
+ */
+
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0x40000000
+#endif
+
+#endif
diff --git a/src/include/skalibs/gol.h b/src/include/skalibs/gol.h
new file mode 100644
index 0000000..bcab96c
--- /dev/null
+++ b/src/include/skalibs/gol.h
@@ -0,0 +1,32 @@
+/* ISC license. */
+
+#ifndef SKALIBS_GOL_H
+#define SKALIBS_GOL_H
+
+ /* Parsing of long (and short) options. */
+
+#include <stdint.h>
+
+#include <skalibs/uint64.h>
+
+typedef struct gol_bool_s gol_bool, gol_bool ;
+struct gol_bool_s
+{
+ char const *lo ;
+ uint8_t so : 7 ;
+ uint8_t set : 1 ;
+ uint64_t mask ;
+} ;
+
+typedef struct gol_arg_s gol_arg, gol_arg_ref ;
+struct gol_arg_s
+{
+ char const *lo ;
+ uint8_t so : 7 ;
+ unsigned int i ;
+} ;
+
+extern int gol (char const *const *, unsigned int, gol_bool const *, unsigned int, gol_arg const *a, unsigned int, uint64_t *, char const **, int *) ;
+extern unsigned int gol_argv (int, char const *const *, gol_bool const *, unsigned int, gol_arg const *a, unsigned int, uint64_t *, char const **) ;
+
+#endif
diff --git a/src/include/skalibs/socket.h b/src/include/skalibs/socket.h
index 85340bb..f13b2ee 100644
--- a/src/include/skalibs/socket.h
+++ b/src/include/skalibs/socket.h
@@ -5,11 +5,11 @@
#include <stddef.h>
#include <stdint.h>
-#include <fcntl.h>
#include <skalibs/gccattributes.h>
#include <skalibs/posixplz.h>
#include <skalibs/tai.h>
+#include <skalibs/fcntl.h>
typedef ssize_t socket_io_func (int, char *, size_t, char *, uint16_t *) ;
typedef socket_io_func *socket_io_func_ref ;
diff --git a/src/libposixplz/mkptemp2.c b/src/libposixplz/mkptemp2.c
index e4e9120..4e4f64a 100644
--- a/src/libposixplz/mkptemp2.c
+++ b/src/libposixplz/mkptemp2.c
@@ -1,8 +1,8 @@
/* ISC license. */
-#include <fcntl.h>
#include <sys/stat.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/posixplz.h>
diff --git a/src/libstddjb/coe.c b/src/libstddjb/coe.c
index a32c4ef..469a7c5 100644
--- a/src/libstddjb/coe.c
+++ b/src/libstddjb/coe.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int coe (int fd)
diff --git a/src/libstddjb/fd_ensure_open.c b/src/libstddjb/fd_ensure_open.c
index 4c1b63c..2867da1 100644
--- a/src/libstddjb/fd_ensure_open.c
+++ b/src/libstddjb/fd_ensure_open.c
@@ -1,8 +1,8 @@
/* ISC license. */
#include <errno.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int fd_ensure_open (int fd, int w)
diff --git a/src/libstddjb/fd_islocked.c b/src/libstddjb/fd_islocked.c
index 50603c0..6089ee8 100644
--- a/src/libstddjb/fd_islocked.c
+++ b/src/libstddjb/fd_islocked.c
@@ -1,8 +1,8 @@
/* ISC license. */
-#include <fcntl.h>
#include <unistd.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int fd_islocked (int fd)
diff --git a/src/libstddjb/fd_lock.c b/src/libstddjb/fd_lock.c
index a4ebaa5..e5d8a42 100644
--- a/src/libstddjb/fd_lock.c
+++ b/src/libstddjb/fd_lock.c
@@ -1,10 +1,10 @@
/* ISC license. */
-#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <skalibs/error.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int fd_lock (int fd, int w, int nb)
diff --git a/src/libstddjb/fd_unlock.c b/src/libstddjb/fd_unlock.c
index 0e6ac0e..64984b9 100644
--- a/src/libstddjb/fd_unlock.c
+++ b/src/libstddjb/fd_unlock.c
@@ -1,9 +1,9 @@
/* ISC license. */
-#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
void fd_unlock (int fd)
diff --git a/src/libstddjb/filecopy_unsafe.c b/src/libstddjb/filecopy_unsafe.c
index a6410c1..41f33bd 100644
--- a/src/libstddjb/filecopy_unsafe.c
+++ b/src/libstddjb/filecopy_unsafe.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int filecopy_unsafe (char const *src, char const *dst, unsigned int mode)
diff --git a/src/libstddjb/gol.c b/src/libstddjb/gol.c
new file mode 100644
index 0000000..e61d7f3
--- /dev/null
+++ b/src/libstddjb/gol.c
@@ -0,0 +1,52 @@
+/* ISC license. */
+
+#include <string.h>
+
+#include <skalibs/gol.h>
+
+int gol (char const *const *argv, unsigned int argc, gol_bool const *b, unsigned int bn, gol_arg const *a, unsigned int an, uint64_t *br, char const **ar, int *problem)
+{
+ for (unsigned int i = 0 ; i < argc ; i++)
+ {
+ if (argv[i][0] != '-' || !argv[i][1]) return i ;
+ if (argv[i][1] == '-')
+ {
+ unsigned int j = 0 ;
+ char const *x ;
+ if (!argv[i][2]) return i+1 ;
+ x = strchr(argv[i]+2, '=') ;
+ if (x)
+ {
+ size_t len = x - argv[i] - 2 ;
+ for (; j < an ; j++) if (!strncmp(argv[i] + 2, a[j].lo, len) && !a[j].lo[len]) break ;
+ if (j >= an) return (*problem = -1, -1-i) ;
+ ar[a[j].i] = x + 1 ;
+ }
+ else
+ {
+ for (; j < bn ; j++) if (!strcmp(argv[i] + 2, b[j].lo)) break ;
+ if (j >= bn) return (*problem = -1, -1-i) ;
+ if (b[j].set) *br |= b[j].mask ; else *br &= b[j].mask ;
+ }
+ }
+ else
+ {
+ char const *p = argv[i] + 1 ;
+ for (; !*p ; p++)
+ {
+ unsigned int j = 0 ;
+ for (; j < an ; j++) if (*p == a[j].so) break ;
+ if (j < an)
+ {
+ if (p[1]) ar[a[j].i] == p + 1 ;
+ else if (i+1 < argc && strcmp(argv[i+1], "--")) ar[a[j].i] = argv[++i] ;
+ break ;
+ }
+ for (j = 0 ; j < bn ; j++) if (*p == b[j].so) break ;
+ if (j >= bn) return (*problem = p - argv[i], -1-i) ;
+ if (b[j].set) *br |= b[j].mask ; else *br &= b[j].mask ;
+ }
+ }
+ }
+ return argc ;
+}
diff --git a/src/libstddjb/gol_argv.c b/src/libstddjb/gol_argv.c
new file mode 100644
index 0000000..2538f5a
--- /dev/null
+++ b/src/libstddjb/gol_argv.c
@@ -0,0 +1,26 @@
+/* ISC license. */
+
+#include <string.h>
+
+#include <skalibs/gol.h>
+#include <skalibs/strerr.h>
+
+unsigned int gol_argv (int argc, char const *const *argv, gol_bool const *b, unsigned int bn, gol_arg const *a, unsigned int an, uint64_t *br, char const **ar)
+{
+ int problem = 0 ;
+ int r ;
+ if (!argc) strerr_diefu1x(100, "gol: invalid argv") ;
+ if (argc == 1) return 1 ;
+ r = gol(argv + 1, argc - 1, b, bn, a, an, br, ar, &problem) ;
+
+ if (r < 0)
+ {
+ if (problem >= 0)
+ {
+ char s[2] = { argv[-r][problem], 0 } ;
+ strerr_dief4x(100, "unrecognized ", "short", "option: ", s) ;
+ }
+ else strerr_dief3x(100, "unrecognized ", "option: ", argv[-r]) ;
+ }
+ else return r + 1 ;
+}
diff --git a/src/libstddjb/hiercopy_internal.c b/src/libstddjb/hiercopy_internal.c
index c512463..5d216a3 100644
--- a/src/libstddjb/hiercopy_internal.c
+++ b/src/libstddjb/hiercopy_internal.c
@@ -4,10 +4,10 @@
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
-#include <fcntl.h>
#include <skalibs/stralloc.h>
#include <skalibs/direntry.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
static int dircopy (char const *src, char const *dst, mode_t mode, stralloc *tmp, unsigned int options)
diff --git a/src/libstddjb/ipc_accept.c b/src/libstddjb/ipc_accept.c
index 9d5d82c..83886ff 100644
--- a/src/libstddjb/ipc_accept.c
+++ b/src/libstddjb/ipc_accept.c
@@ -6,9 +6,9 @@
#include <sys/un.h>
#include <string.h>
#include <errno.h>
-#include <fcntl.h>
#include <skalibs/bytestr.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/ipc_bind_reuse_lock_perms.c b/src/libstddjb/ipc_bind_reuse_lock_perms.c
index 6e4d9ff..f47ba19 100644
--- a/src/libstddjb/ipc_bind_reuse_lock_perms.c
+++ b/src/libstddjb/ipc_bind_reuse_lock_perms.c
@@ -2,13 +2,13 @@
#include <skalibs/nonposix.h>
-#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/ndelay_off.c b/src/libstddjb/ndelay_off.c
index 5ea68c6..1d23f08 100644
--- a/src/libstddjb/ndelay_off.c
+++ b/src/libstddjb/ndelay_off.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int ndelay_off (int fd)
diff --git a/src/libstddjb/ndelay_on.c b/src/libstddjb/ndelay_on.c
index 1bf9527..2a899b8 100644
--- a/src/libstddjb/ndelay_on.c
+++ b/src/libstddjb/ndelay_on.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int ndelay_on (int fd)
diff --git a/src/libstddjb/open2.c b/src/libstddjb/open2.c
index 1d2682e..0f23183 100644
--- a/src/libstddjb/open2.c
+++ b/src/libstddjb/open2.c
@@ -1,14 +1,38 @@
/* ISC license. */
+#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
+
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+#include <skalibs/fcntl.h>
+#include <skalibs/djbunix.h>
+
+#ifdef SKALIBS_HASOCLOEXEC
+
int open2 (char const *s, unsigned int flags)
{
int r ;
do r = open(s, flags) ;
- while ((r == -1) && (errno == EINTR)) ;
+ while (r == -1 && errno == EINTR) ;
return r ;
}
+
+#else
+
+int open2 (char const *s, unsigned int flags)
+{
+ int fd ;
+ do fd = open(s, flags & ~O_CLOEXEC) ;
+ while (fd == -1 && errno == EINTR) ;
+ if (fd == -1) return -1 ;
+ if (flags & O_CLOEXEC && coe(fd) == -1)
+ {
+ fd_close(fd) ;
+ return -1 ;
+ }
+ return fd ;
+}
+
+#endif
diff --git a/src/libstddjb/open3.c b/src/libstddjb/open3.c
index 21fd904..a9ff9e6 100644
--- a/src/libstddjb/open3.c
+++ b/src/libstddjb/open3.c
@@ -1,14 +1,38 @@
/* ISC license. */
+#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
+
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+#include <skalibs/fcntl.h>
+#include <skalibs/djbunix.h>
+
+#ifdef SKALIBS_HASOCLOEXEC
+
int open3 (char const *s, unsigned int flags, unsigned int mode)
{
int r ;
do r = open(s, flags, mode) ;
- while ((r == -1) && (errno == EINTR)) ;
+ while (r == -1 && errno == EINTR) ;
return r ;
}
+
+#else
+
+int open3 (char const *s, unsigned int flags, unsigned int mode)
+{
+ int fd ;
+ do fd = open(s, flags & ~O_CLOEXEC, mode) ;
+ while (fd == -1 && errno == EINTR) ;
+ if (fd == -1) return -1 ;
+ if (flags & O_CLOEXEC && coe(fd) == -1)
+ {
+ fd_close(fd) ;
+ return -1 ;
+ }
+ return fd ;
+}
+
+#endif
diff --git a/src/libstddjb/open_append.c b/src/libstddjb/open_append.c
index 7486312..74f1bca 100644
--- a/src/libstddjb/open_append.c
+++ b/src/libstddjb/open_append.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_append (char const *fn)
diff --git a/src/libstddjb/open_create.c b/src/libstddjb/open_create.c
index db072d1..6eeb57a 100644
--- a/src/libstddjb/open_create.c
+++ b/src/libstddjb/open_create.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_create (char const *fn)
diff --git a/src/libstddjb/open_excl.c b/src/libstddjb/open_excl.c
index 83c7770..e93d194 100644
--- a/src/libstddjb/open_excl.c
+++ b/src/libstddjb/open_excl.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_excl (char const *fn)
diff --git a/src/libstddjb/open_read.c b/src/libstddjb/open_read.c
index cc1b191..327dd08 100644
--- a/src/libstddjb/open_read.c
+++ b/src/libstddjb/open_read.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_read (char const *fn)
diff --git a/src/libstddjb/open_trunc.c b/src/libstddjb/open_trunc.c
index b34e3c2..8333934 100644
--- a/src/libstddjb/open_trunc.c
+++ b/src/libstddjb/open_trunc.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_trunc (char const *fn)
diff --git a/src/libstddjb/open_write.c b/src/libstddjb/open_write.c
index 42a92c3..14045c7 100644
--- a/src/libstddjb/open_write.c
+++ b/src/libstddjb/open_write.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int open_write (char const *fn)
diff --git a/src/libstddjb/openb_read.c b/src/libstddjb/openb_read.c
index 19ec073..cd7925a 100644
--- a/src/libstddjb/openb_read.c
+++ b/src/libstddjb/openb_read.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openb_read (char const *fn)
diff --git a/src/libstddjb/openbc_read.c b/src/libstddjb/openbc_read.c
index 4783780..bd4713e 100644
--- a/src/libstddjb/openbc_read.c
+++ b/src/libstddjb/openbc_read.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openbc_read (char const *fn)
diff --git a/src/libstddjb/openc_append.c b/src/libstddjb/openc_append.c
index 9765aa6..e0375dd 100644
--- a/src/libstddjb/openc_append.c
+++ b/src/libstddjb/openc_append.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_append (char const *fn)
diff --git a/src/libstddjb/openc_create.c b/src/libstddjb/openc_create.c
index 2c0dd86..98e535b 100644
--- a/src/libstddjb/openc_create.c
+++ b/src/libstddjb/openc_create.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_create (char const *fn)
diff --git a/src/libstddjb/openc_excl.c b/src/libstddjb/openc_excl.c
index 9a45913..97e5531 100644
--- a/src/libstddjb/openc_excl.c
+++ b/src/libstddjb/openc_excl.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_excl (char const *fn)
diff --git a/src/libstddjb/openc_read.c b/src/libstddjb/openc_read.c
index 57a23bc..6cb77fe 100644
--- a/src/libstddjb/openc_read.c
+++ b/src/libstddjb/openc_read.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_read (char const *fn)
diff --git a/src/libstddjb/openc_trunc.c b/src/libstddjb/openc_trunc.c
index ca39160..bda44be 100644
--- a/src/libstddjb/openc_trunc.c
+++ b/src/libstddjb/openc_trunc.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_trunc (char const *fn)
diff --git a/src/libstddjb/openc_write.c b/src/libstddjb/openc_write.c
index 518c460..4310cfb 100644
--- a/src/libstddjb/openc_write.c
+++ b/src/libstddjb/openc_write.c
@@ -1,7 +1,7 @@
/* ISC license. */
#include <skalibs/nonposix.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int openc_write (char const *fn)
diff --git a/src/libstddjb/pipe_internal.c b/src/libstddjb/pipe_internal.c
index dc7cfe6..972f595 100644
--- a/src/libstddjb/pipe_internal.c
+++ b/src/libstddjb/pipe_internal.c
@@ -17,8 +17,8 @@ int pipe_internal (int *p, unsigned int flags)
#else
#include <unistd.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int pipe_internal (int *p, unsigned int flags)
diff --git a/src/libstddjb/socket_accept4.c b/src/libstddjb/socket_accept4.c
index 36f3dc2..0c11023 100644
--- a/src/libstddjb/socket_accept4.c
+++ b/src/libstddjb/socket_accept4.c
@@ -7,9 +7,9 @@
#include <netinet/in.h>
#include <string.h>
#include <errno.h>
-#include <fcntl.h>
#include <skalibs/uint16.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/socket_accept6.c b/src/libstddjb/socket_accept6.c
index 2c18540..229178d 100644
--- a/src/libstddjb/socket_accept6.c
+++ b/src/libstddjb/socket_accept6.c
@@ -7,9 +7,9 @@
#include <netinet/in.h>
#include <string.h>
#include <errno.h>
-#include <fcntl.h>
#include <skalibs/uint16.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/ip46.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/socket_internal.c b/src/libstddjb/socket_internal.c
index 39c6e38..3371b9a 100644
--- a/src/libstddjb/socket_internal.c
+++ b/src/libstddjb/socket_internal.c
@@ -4,8 +4,8 @@
#include <skalibs/nonposix.h>
#include <sys/socket.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/socketpair_internal.c b/src/libstddjb/socketpair_internal.c
index 0cedce2..8e46374 100644
--- a/src/libstddjb/socketpair_internal.c
+++ b/src/libstddjb/socketpair_internal.c
@@ -2,10 +2,11 @@
#include <skalibs/sysdeps.h>
#include <skalibs/nonposix.h>
+
#include <sys/socket.h>
#include <errno.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/socket.h>
diff --git a/src/libstddjb/uncoe.c b/src/libstddjb/uncoe.c
index be7b90c..55804ff 100644
--- a/src/libstddjb/uncoe.c
+++ b/src/libstddjb/uncoe.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
int uncoe (int fd)
diff --git a/src/libunixonacid/access_at.c b/src/libunixonacid/access_at.c
index 69fdce4..e7f988c 100644
--- a/src/libunixonacid/access_at.c
+++ b/src/libunixonacid/access_at.c
@@ -10,9 +10,9 @@
#include <skalibs/nonposix.h>
-#include <fcntl.h>
#include <unistd.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int access_at (int dirfd, char const *file, int amode, unsigned int flag)
diff --git a/src/libunixonacid/open2_at.c b/src/libunixonacid/open2_at.c
index 76d79cc..d96c0b7 100644
--- a/src/libunixonacid/open2_at.c
+++ b/src/libunixonacid/open2_at.c
@@ -11,14 +11,14 @@
#include <skalibs/nonposix.h>
#include <errno.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open2_at (int dirfd, char const *file, int flags)
{
int fd ;
- do fd = openat(dirfd, file, flags) ;
+ do fd = openat(dirfd, file, flags) ; /* all systems supporting openat() have O_CLOEXEC */
while (fd == -1 && errno == EINTR) ;
return fd ;
}
@@ -26,8 +26,9 @@ int open2_at (int dirfd, char const *file, int flags)
#else
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>
diff --git a/src/libunixonacid/open3_at.c b/src/libunixonacid/open3_at.c
index 063092d..742a579 100644
--- a/src/libunixonacid/open3_at.c
+++ b/src/libunixonacid/open3_at.c
@@ -11,14 +11,14 @@
#include <skalibs/nonposix.h>
#include <errno.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open3_at (int dirfd, char const *file, int flags, unsigned int mode)
{
int fd ;
- do fd = openat(dirfd, file, flags, mode) ;
+ do fd = openat(dirfd, file, flags, mode) ; /* all systems that support openat() have O_CLOEXEC */
while (fd == -1 && errno == EINTR) ;
return fd ;
}
@@ -26,8 +26,9 @@ int open3_at (int dirfd, char const *file, int flags, unsigned int mode)
#else
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>
diff --git a/src/libunixonacid/open_appendat.c b/src/libunixonacid/open_appendat.c
index 5ad73d1..66a3cb4 100644
--- a/src/libunixonacid/open_appendat.c
+++ b/src/libunixonacid/open_appendat.c
@@ -1,7 +1,8 @@
/* ISC license. */
#include <sys/stat.h>
-#include <fcntl.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open_appendat (int fd, char const *name)
diff --git a/src/libunixonacid/open_readat.c b/src/libunixonacid/open_readat.c
index 05f6926..7149329 100644
--- a/src/libunixonacid/open_readat.c
+++ b/src/libunixonacid/open_readat.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open_readat (int fd, char const *name)
diff --git a/src/libunixonacid/open_truncat.c b/src/libunixonacid/open_truncat.c
index ce4f132..d7c61bf 100644
--- a/src/libunixonacid/open_truncat.c
+++ b/src/libunixonacid/open_truncat.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open_truncat (int fd, char const *name)
diff --git a/src/libunixonacid/open_writeat.c b/src/libunixonacid/open_writeat.c
index 695e343..9206f08 100644
--- a/src/libunixonacid/open_writeat.c
+++ b/src/libunixonacid/open_writeat.c
@@ -1,6 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int open_writeat (int fd, char const *name)
diff --git a/src/libunixonacid/openc_appendat.c b/src/libunixonacid/openc_appendat.c
index 70b6df7..88228c5 100644
--- a/src/libunixonacid/openc_appendat.c
+++ b/src/libunixonacid/openc_appendat.c
@@ -1,8 +1,8 @@
/* ISC license. */
#include <sys/stat.h>
-#include <fcntl.h>
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int openc_appendat (int fd, char const *name)
diff --git a/src/libunixonacid/openc_readat.c b/src/libunixonacid/openc_readat.c
index dc092b6..3284977 100644
--- a/src/libunixonacid/openc_readat.c
+++ b/src/libunixonacid/openc_readat.c
@@ -1,7 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
-
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int openc_readat (int fd, char const *name)
diff --git a/src/libunixonacid/openc_truncat.c b/src/libunixonacid/openc_truncat.c
index 8ce50d2..55d1123 100644
--- a/src/libunixonacid/openc_truncat.c
+++ b/src/libunixonacid/openc_truncat.c
@@ -1,7 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
-
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int openc_truncat (int fd, char const *name)
diff --git a/src/libunixonacid/openc_writeat.c b/src/libunixonacid/openc_writeat.c
index e584e57..c79c652 100644
--- a/src/libunixonacid/openc_writeat.c
+++ b/src/libunixonacid/openc_writeat.c
@@ -1,7 +1,6 @@
/* ISC license. */
-#include <fcntl.h>
-
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int openc_writeat (int fd, char const *name)
diff --git a/src/libunixonacid/stat_at.c b/src/libunixonacid/stat_at.c
index 2d04d57..e4040d5 100644
--- a/src/libunixonacid/stat_at.c
+++ b/src/libunixonacid/stat_at.c
@@ -9,8 +9,10 @@
#endif
#include <skalibs/nonposix.h>
+
#include <sys/stat.h>
-#include <fcntl.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/unix-transactional.h>
int stat_at (int dirfd, char const *file, struct stat *st)
@@ -27,9 +29,11 @@ int lstat_at (int dirfd, char const *file, struct stat *st)
/* OpenBSD plz. lstat() is POSIX. */
#include <skalibs/nonposix.h>
+
#include <sys/stat.h>
-#include <fcntl.h>
#include <errno.h>
+
+#include <skalibs/fcntl.h>
#include <skalibs/djbunix.h>
#include <skalibs/unix-transactional.h>
diff --git a/src/libunixonacid/textclient_server_init_frompipe.c b/src/libunixonacid/textclient_server_init_frompipe.c
index d5d9d97..3909deb 100644
--- a/src/libunixonacid/textclient_server_init_frompipe.c
+++ b/src/libunixonacid/textclient_server_init_frompipe.c
@@ -2,9 +2,9 @@
#include <sys/uio.h>
#include <stdlib.h>
-#include <fcntl.h>
#include <errno.h>
+#include <skalibs/fcntl.h>
#include <skalibs/types.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/cspawn.h>
diff --git a/src/sysdeps/tryocloexec.c b/src/sysdeps/tryocloexec.c
new file mode 100644
index 0000000..bd318ae
--- /dev/null
+++ b/src/sysdeps/tryocloexec.c
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#include <fcntl.h>
+
+int dummy = O_CLOEXEC ;