From 3534b428629be185e096be99e3bd5fdfe32d5544 Mon Sep 17 00:00:00 2001
From: Laurent Bercot
Date: Thu, 18 Sep 2014 18:55:44 +0000
Subject: initial commit with rc for skalibs-2.0.0.0
---
.gitignore | 5 +
AUTHORS | 21 +
CHANGES | 260 +++++++
COPYING | 13 +
INSTALL | 139 ++++
Makefile | 236 +++++++
README | 26 +
README.macosx | 4 +
README.solaris | 12 +
configure | 590 ++++++++++++++++
doc/crosscompile.html | 93 +++
doc/djblegacy.html | 151 ++++
doc/flags.html | 313 +++++++++
doc/index.html | 131 ++++
doc/libbiguint/index.html | 391 +++++++++++
doc/libdatastruct/index.html | 40 ++
doc/librandom/index.html | 113 +++
doc/libskarnet.html | 100 +++
doc/libstdcrypto/index.html | 110 +++
doc/libstddjb/alloc.html | 98 +++
doc/libstddjb/allreadwrite.html | 145 ++++
doc/libstddjb/bitarray.html | 131 ++++
doc/libstddjb/djbtime.html | 201 ++++++
doc/libstddjb/djbunix.html | 760 +++++++++++++++++++++
doc/libstddjb/gccattributes.html | 48 ++
doc/libstddjb/genalloc.html | 46 ++
doc/libstddjb/genwrite.html | 98 +++
doc/libstddjb/index.html | 125 ++++
doc/libstddjb/iopause.html | 196 ++++++
doc/libstddjb/ip46.html | 172 +++++
doc/libstddjb/lolstdio.html | 91 +++
doc/libstddjb/safewrappers.html | 91 +++
doc/libstddjb/selfpipe.html | 242 +++++++
doc/libstddjb/stralloc.html | 118 ++++
doc/libstddjb/tai.html | 462 +++++++++++++
doc/libunixonacid/index.html | 58 ++
doc/libunixonacid/kolbak.html | 40 ++
doc/libunixonacid/skaclient.html | 34 +
doc/libunixonacid/unix-timed.html | 34 +
doc/libunixonacid/unix-transactional.html | 34 +
doc/libunixonacid/unixmessage.html | 40 ++
doc/license.html | 82 +++
doc/upgrade.html | 34 +
package/deps.mak | 756 ++++++++++++++++++++
package/info | 4 +
patch-for-solaris | 17 +
src/etc/leapsecs.dat | Bin 0 -> 200 bytes
src/headers/error-addrinuse | 3 +
src/headers/error-already | 1 +
src/headers/error-footer | 2 +
src/headers/error-header | 12 +
src/headers/error-proto | 3 +
src/headers/gidstuff-16 | 7 +
src/headers/gidstuff-32 | 7 +
src/headers/gidstuff-64 | 7 +
src/headers/gidstuff-footer | 2 +
src/headers/gidstuff-header | 5 +
src/headers/ip46-footer | 10 +
src/headers/ip46-header | 34 +
src/headers/ip46-with | 24 +
src/headers/ip46-without | 28 +
src/headers/setgroups-footer | 2 +
src/headers/setgroups-header | 5 +
src/headers/setgroups-stub | 2 +
src/headers/uint-16 | 34 +
src/headers/uint-32 | 34 +
src/headers/uint-64 | 34 +
src/headers/uint-footer | 10 +
src/headers/uint-header | 5 +
src/headers/uint16-bendian | 3 +
src/headers/uint16-footer | 40 ++
src/headers/uint16-header | 9 +
src/headers/uint16-lendian | 3 +
src/headers/uint32-bendian | 3 +
src/headers/uint32-footer | 39 ++
src/headers/uint32-header | 9 +
src/headers/uint32-inttypesh | 3 +
src/headers/uint32-lendian | 3 +
src/headers/uint32-noulong32 | 2 +
src/headers/uint32-stdinth | 3 +
src/headers/uint32-ulong32 | 2 +
src/headers/uint64-bendian | 3 +
src/headers/uint64-footer | 39 ++
src/headers/uint64-header | 5 +
src/headers/uint64-lendian | 3 +
src/headers/uint64-noulong64 | 2 +
src/headers/uint64-stdinth | 3 +
src/headers/uint64-ulong64 | 1 +
src/headers/ulong-32 | 32 +
src/headers/ulong-64 | 32 +
src/headers/ulong-footer | 10 +
src/headers/ulong-header | 5 +
src/headers/ushort-16 | 34 +
src/headers/ushort-32 | 34 +
src/headers/ushort-footer | 10 +
src/headers/ushort-header | 5 +
src/include/skalibs/alloc.h | 16 +
src/include/skalibs/allreadwrite.h | 27 +
src/include/skalibs/avlnode.h | 44 ++
src/include/skalibs/avltree.h | 55 ++
src/include/skalibs/avltreen.h | 87 +++
src/include/skalibs/biguint.h | 46 ++
src/include/skalibs/bitarray.h | 33 +
src/include/skalibs/bufalloc.h | 36 +
src/include/skalibs/buffer.h | 134 ++++
src/include/skalibs/bytestr.h | 65 ++
src/include/skalibs/cbuffer.h | 62 ++
src/include/skalibs/cdb.h | 51 ++
src/include/skalibs/cdb_make.h | 27 +
src/include/skalibs/datastruct.h | 12 +
src/include/skalibs/direntry.h | 13 +
src/include/skalibs/diuint.h | 15 +
src/include/skalibs/diuint32.h | 17 +
src/include/skalibs/djbtime.h | 70 ++
src/include/skalibs/djbunix.h | 149 ++++
src/include/skalibs/env.h | 26 +
src/include/skalibs/envalloc.h | 15 +
src/include/skalibs/environ.h | 8 +
src/include/skalibs/fmtscan.h | 53 ++
src/include/skalibs/functypes.h | 33 +
src/include/skalibs/gccattributes.h | 61 ++
src/include/skalibs/genalloc.h | 35 +
src/include/skalibs/genset.h | 37 +
src/include/skalibs/gensetdyn.h | 40 ++
src/include/skalibs/genwrite.h | 35 +
src/include/skalibs/getpeereid.h | 10 +
src/include/skalibs/iobuffer.h | 117 ++++
src/include/skalibs/iopause.h | 32 +
src/include/skalibs/kolbak.h | 32 +
src/include/skalibs/lolstdio.h | 30 +
src/include/skalibs/md5.h | 21 +
src/include/skalibs/mininetstring.h | 13 +
src/include/skalibs/netstring.h | 24 +
src/include/skalibs/nonposix.h | 58 ++
src/include/skalibs/nsig.h | 13 +
src/include/skalibs/random.h | 33 +
src/include/skalibs/randomegd.h | 10 +
src/include/skalibs/rc4.h | 19 +
src/include/skalibs/rrandom.h | 36 +
src/include/skalibs/segfault.h | 11 +
src/include/skalibs/selfpipe.h | 17 +
src/include/skalibs/sgetopt.h | 46 ++
src/include/skalibs/sha1.h | 22 +
src/include/skalibs/sha256.h | 29 +
src/include/skalibs/sig.h | 61 ++
src/include/skalibs/siovec.h | 29 +
src/include/skalibs/skaclient.h | 115 ++++
src/include/skalibs/skalibs.h | 19 +
src/include/skalibs/skamisc.h | 29 +
src/include/skalibs/socket.h | 122 ++++
src/include/skalibs/stdcrypto.h | 11 +
src/include/skalibs/stddjb.h | 60 ++
src/include/skalibs/stralloc.h | 40 ++
src/include/skalibs/strerr.h | 139 ++++
src/include/skalibs/strerr2.h | 267 ++++++++
src/include/skalibs/surf.h | 29 +
src/include/skalibs/tai.h | 140 ++++
src/include/skalibs/unirandom.h | 57 ++
src/include/skalibs/unirandomdev.h | 19 +
src/include/skalibs/unirandomegd.h | 17 +
src/include/skalibs/unisurf.h | 16 +
src/include/skalibs/unix-timed.h | 36 +
src/include/skalibs/unix-transactional.h | 59 ++
src/include/skalibs/unixmessage.h | 103 +++
src/include/skalibs/unixonacid.h | 12 +
src/include/skalibs/webipc.h | 60 ++
src/libbiguint/bu_addc.c | 22 +
src/libbiguint/bu_addmod.c | 11 +
src/libbiguint/bu_cmp.c | 18 +
src/libbiguint/bu_copy.c | 21 +
src/libbiguint/bu_copy_internal.c | 9 +
src/libbiguint/bu_div.c | 23 +
src/libbiguint/bu_div_internal.c | 46 ++
src/libbiguint/bu_divmod.c | 32 +
src/libbiguint/bu_divmod_internal.c | 37 +
src/libbiguint/bu_fmt.c | 19 +
src/libbiguint/bu_gcd.c | 33 +
src/libbiguint/bu_invmod.c | 12 +
src/libbiguint/bu_len.c | 10 +
src/libbiguint/bu_mod.c | 10 +
src/libbiguint/bu_mul.c | 32 +
src/libbiguint/bu_mulmod.c | 16 +
src/libbiguint/bu_pack.c | 9 +
src/libbiguint/bu_pack_big.c | 10 +
src/libbiguint/bu_scan.c | 18 +
src/libbiguint/bu_scan_internal.c | 21 +
src/libbiguint/bu_scanlen.c | 12 +
src/libbiguint/bu_slbc.c | 17 +
src/libbiguint/bu_srbc.c | 15 +
src/libbiguint/bu_subc.c | 22 +
src/libbiguint/bu_submod.c | 12 +
src/libbiguint/bu_unpack.c | 9 +
src/libbiguint/bu_unpack_big.c | 10 +
src/libbiguint/bu_zero.c | 9 +
src/libdatastruct/avlnode-internal.h | 15 +
src/libdatastruct/avlnode_delete.c | 72 ++
src/libdatastruct/avlnode_doublerotate.c | 19 +
src/libdatastruct/avlnode_extreme.c | 12 +
src/libdatastruct/avlnode_extremenode.c | 10 +
src/libdatastruct/avlnode_height.c | 15 +
src/libdatastruct/avlnode_insertnode.c | 42 ++
src/libdatastruct/avlnode_iter.c | 26 +
src/libdatastruct/avlnode_rotate.c | 15 +
src/libdatastruct/avlnode_search.c | 12 +
src/libdatastruct/avlnode_searchnode.c | 16 +
src/libdatastruct/avlnode_zero.c | 5 +
src/libdatastruct/avltree_delete.c | 16 +
src/libdatastruct/avltree_free.c | 10 +
src/libdatastruct/avltree_init.c | 16 +
src/libdatastruct/avltree_insert.c | 11 +
src/libdatastruct/avltree_newnode.c | 18 +
src/libdatastruct/avltree_zero.c | 5 +
src/libdatastruct/avltreen_delete.c | 16 +
src/libdatastruct/avltreen_init.c | 15 +
src/libdatastruct/avltreen_insert.c | 11 +
src/libdatastruct/avltreen_newnode.c | 18 +
src/libdatastruct/genset.c | 27 +
src/libdatastruct/genset_iter.c | 19 +
src/libdatastruct/gensetdyn_delete.c | 11 +
src/libdatastruct/gensetdyn_free.c | 12 +
src/libdatastruct/gensetdyn_init.c | 15 +
src/libdatastruct/gensetdyn_iter.c | 26 +
src/libdatastruct/gensetdyn_new.c | 14 +
src/libdatastruct/gensetdyn_ready.c | 26 +
src/libdatastruct/gensetdyn_zero.c | 5 +
src/librandom/badrandom_char.c | 13 +
src/librandom/badrandom_finish.c | 12 +
src/librandom/badrandom_here.c | 40 ++
src/librandom/badrandom_init.c | 10 +
src/librandom/badrandom_int.c | 12 +
src/librandom/badrandom_string.c | 12 +
src/librandom/goodrandom_char.c | 13 +
src/librandom/goodrandom_finish.c | 12 +
src/librandom/goodrandom_here.c | 40 ++
src/librandom/goodrandom_init.c | 10 +
src/librandom/goodrandom_int.c | 12 +
src/librandom/goodrandom_string.c | 12 +
src/librandom/random-internal.h | 20 +
src/librandom/random_mask2.c | 35 +
src/librandom/random_name.c | 13 +
src/librandom/random_sauniquename.c | 25 +
src/librandom/random_unsort.c | 17 +
src/librandom/randomegd_open.c | 20 +
src/librandom/randomegd_readb.c | 27 +
src/librandom/randomegd_readnb.c | 28 +
src/librandom/rrandom_add.c | 13 +
src/librandom/rrandom_finish.c | 14 +
src/librandom/rrandom_name.c | 13 +
src/librandom/rrandom_read.c | 21 +
src/librandom/rrandom_readint.c | 24 +
src/librandom/surf.c | 54 ++
src/librandom/surf_autoinit.c | 10 +
src/librandom/surf_here.c | 8 +
src/librandom/surf_init.c | 10 +
src/librandom/surf_makeseed.c | 35 +
src/librandom/surf_sinit.c | 13 +
src/librandom/unidevrandom.c | 38 ++
src/librandom/unidevurandom.c | 38 ++
src/librandom/unihasegd.c | 38 ++
src/librandom/unirandom_finish.c | 12 +
src/librandom/unirandom_init.c | 12 +
src/librandom/unirandom_readb.c | 10 +
src/librandom/unirandom_readnb.c | 10 +
src/librandom/unirandom_register.c | 16 +
src/librandom/unirandomdev.c | 50 ++
src/librandom/unirandomegd.c | 37 +
src/librandom/unisurf.c | 23 +
src/librandom/unisurf_init.c | 18 +
src/libstdcrypto/INCLUDE | 5 +
src/libstdcrypto/Makefile | 7 +
src/libstdcrypto/md5-internal.h | 11 +
src/libstdcrypto/md5_final.c | 30 +
src/libstdcrypto/md5_init.c | 13 +
src/libstdcrypto/md5_transform.c | 91 +++
src/libstdcrypto/md5_update.c | 37 +
src/libstdcrypto/rc4.c | 20 +
src/libstdcrypto/rc4_init.c | 26 +
src/libstdcrypto/sha1-internal.h | 12 +
src/libstdcrypto/sha1_feed.c | 24 +
src/libstdcrypto/sha1_final.c | 18 +
src/libstdcrypto/sha1_init.c | 16 +
src/libstdcrypto/sha1_transform.c | 42 ++
src/libstdcrypto/sha1_update.c | 10 +
src/libstdcrypto/sha256-internal.h | 12 +
src/libstdcrypto/sha256_feed.c | 23 +
src/libstdcrypto/sha256_final.c | 31 +
src/libstdcrypto/sha256_init.c | 9 +
src/libstdcrypto/sha256_transform.c | 53 ++
src/libstdcrypto/sha256_update.c | 10 +
src/libstddjb/absolutepath.c | 12 +
src/libstddjb/absolutepath_tmp.c | 62 ++
src/libstddjb/alloc-internal.h | 21 +
src/libstddjb/alloc.c | 49 ++
src/libstddjb/alloc_0.c | 13 +
src/libstddjb/allread.c | 8 +
src/libstddjb/allreadwrite.c | 19 +
src/libstddjb/allwrite.c | 8 +
src/libstddjb/baprintf.c | 15 +
src/libstddjb/basename.c | 19 +
src/libstddjb/bitarray_and.c | 10 +
src/libstddjb/bitarray_clearsetn.c | 24 +
src/libstddjb/bitarray_firstclear.c | 14 +
src/libstddjb/bitarray_firstset.c | 14 +
src/libstddjb/bitarray_not.c | 18 +
src/libstddjb/bitarray_or.c | 10 +
src/libstddjb/bitarray_testandpoke.c | 11 +
src/libstddjb/bitarray_xor.c | 10 +
src/libstddjb/bprintf.c | 15 +
src/libstddjb/bufalloc_1.c | 9 +
src/libstddjb/bufalloc_2.c | 9 +
src/libstddjb/bufalloc_clean.c | 14 +
src/libstddjb/bufalloc_flush.c | 11 +
src/libstddjb/bufalloc_getfd.c | 8 +
src/libstddjb/bufalloc_getlen.c | 8 +
src/libstddjb/bufalloc_init.c | 12 +
src/libstddjb/buffer_0.c | 8 +
src/libstddjb/buffer_0f1.c | 8 +
src/libstddjb/buffer_0small.c | 8 +
src/libstddjb/buffer_1.c | 8 +
src/libstddjb/buffer_1small.c | 8 +
src/libstddjb/buffer_2.c | 8 +
src/libstddjb/buffer_fill.c | 17 +
src/libstddjb/buffer_flush.c | 20 +
src/libstddjb/buffer_flush1read.c | 10 +
src/libstddjb/buffer_get.c | 12 +
src/libstddjb/buffer_getall.c | 18 +
src/libstddjb/buffer_getallnf.c | 15 +
src/libstddjb/buffer_getfd.c | 8 +
src/libstddjb/buffer_getlen.c | 8 +
src/libstddjb/buffer_getv.c | 15 +
src/libstddjb/buffer_getvall.c | 18 +
src/libstddjb/buffer_getvallnf.c | 16 +
src/libstddjb/buffer_init.c | 13 +
src/libstddjb/buffer_put.c | 10 +
src/libstddjb/buffer_putall.c | 16 +
src/libstddjb/buffer_putallnf.c | 15 +
src/libstddjb/buffer_putflush.c | 11 +
src/libstddjb/buffer_putv.c | 12 +
src/libstddjb/buffer_putvall.c | 15 +
src/libstddjb/buffer_putvallnf.c | 15 +
src/libstddjb/buffer_putvflush.c | 12 +
src/libstddjb/buffer_read.c | 15 +
src/libstddjb/buffer_write.c | 15 +
src/libstddjb/byte_chr.c | 33 +
src/libstddjb/byte_copy.c | 14 +
src/libstddjb/byte_count.c | 10 +
src/libstddjb/byte_cr.c | 22 +
src/libstddjb/byte_diff.c | 22 +
src/libstddjb/byte_in.c | 14 +
src/libstddjb/byte_rchr.c | 12 +
src/libstddjb/byte_zero.c | 15 +
src/libstddjb/case_diffb.c | 18 +
src/libstddjb/case_diffs.c | 18 +
src/libstddjb/case_lowerb.c | 13 +
src/libstddjb/case_lowers.c | 13 +
src/libstddjb/case_startb.c | 9 +
src/libstddjb/case_str.c | 32 +
src/libstddjb/case_upperb.c | 13 +
src/libstddjb/case_uppers.c | 13 +
src/libstddjb/cbuffer_get.c | 11 +
src/libstddjb/cbuffer_getv.c | 11 +
src/libstddjb/cbuffer_init.c | 13 +
src/libstddjb/cbuffer_put.c | 11 +
src/libstddjb/cbuffer_putv.c | 11 +
src/libstddjb/cbuffer_rpeek.c | 21 +
src/libstddjb/cbuffer_rseek.c | 10 +
src/libstddjb/cbuffer_unget.c | 10 +
src/libstddjb/cbuffer_unput.c | 10 +
src/libstddjb/cbuffer_wpeek.c | 22 +
src/libstddjb/cbuffer_wseek.c | 10 +
src/libstddjb/cdb_findnext.c | 67 ++
src/libstddjb/cdb_free.c | 11 +
src/libstddjb/cdb_hash.c | 17 +
src/libstddjb/cdb_init_map.c | 23 +
src/libstddjb/cdb_make.c | 145 ++++
src/libstddjb/cdb_mapfile.c | 20 +
src/libstddjb/cdb_nextkey.c | 23 +
src/libstddjb/cdb_read.c | 24 +
src/libstddjb/cdb_successor.c | 17 +
src/libstddjb/cdb_zero.c | 5 +
src/libstddjb/child_spawn.c | 228 +++++++
src/libstddjb/child_spawn0.c | 73 ++
src/libstddjb/child_spawn1.c | 115 ++++
src/libstddjb/coe.c | 11 +
src/libstddjb/deepsleepuntil.c | 10 +
src/libstddjb/dir_close.c | 14 +
src/libstddjb/dirname.c | 19 +
src/libstddjb/djbtime-internal.h | 23 +
src/libstddjb/doublefork.c | 53 ++
src/libstddjb/env_addmodif.c | 18 +
src/libstddjb/env_get.c | 9 +
src/libstddjb/env_get2.c | 18 +
src/libstddjb/env_len.c | 10 +
src/libstddjb/env_make.c | 16 +
src/libstddjb/env_merge.c | 25 +
src/libstddjb/env_string.c | 19 +
src/libstddjb/envalloc_0.c | 10 +
src/libstddjb/envalloc_make.c | 18 +
src/libstddjb/envalloc_merge.c | 15 +
src/libstddjb/envalloc_uniq.c | 31 +
src/libstddjb/envdir.c | 84 +++
src/libstddjb/error_str.c | 277 ++++++++
src/libstddjb/error_temp.c | 78 +++
src/libstddjb/execvep.c | 38 ++
src/libstddjb/fd_cat.c | 25 +
src/libstddjb/fd_catn.c | 42 ++
src/libstddjb/fd_chdir.c | 14 +
src/libstddjb/fd_chmod.c | 17 +
src/libstddjb/fd_chown.c | 15 +
src/libstddjb/fd_close.c | 15 +
src/libstddjb/fd_copy.c | 15 +
src/libstddjb/fd_copy2.c | 17 +
src/libstddjb/fd_ensure_open.c | 25 +
src/libstddjb/fd_move.c | 15 +
src/libstddjb/fd_move2.c | 37 +
src/libstddjb/fd_read.c | 13 +
src/libstddjb/fd_readv.c | 14 +
src/libstddjb/fd_recv.c | 14 +
src/libstddjb/fd_select.c | 14 +
src/libstddjb/fd_send.c | 14 +
src/libstddjb/fd_sync.c | 14 +
src/libstddjb/fd_write.c | 13 +
src/libstddjb/fd_writev.c | 14 +
src/libstddjb/fmtscan-internal.h | 105 +++
src/libstddjb/fmtscan_asc.c | 9 +
src/libstddjb/fmtscan_num.c | 16 +
src/libstddjb/genalloc_deepfree.c | 12 +
src/libstddjb/genwrite_flush_bufalloc.c | 10 +
src/libstddjb/genwrite_flush_buffer.c | 10 +
src/libstddjb/genwrite_flush_stralloc.c | 9 +
src/libstddjb/genwrite_put_bufalloc.c | 10 +
src/libstddjb/genwrite_put_buffer.c | 10 +
src/libstddjb/genwrite_put_stralloc.c | 10 +
src/libstddjb/genwrite_stderr.c | 6 +
src/libstddjb/genwrite_stdout.c | 6 +
src/libstddjb/getlnmax.c | 28 +
src/libstddjb/getlnmaxsep.c | 28 +
src/libstddjb/getpeereid.c | 68 ++
src/libstddjb/int_scan.c | 6 +
src/libstddjb/iobuffer_fill.c | 14 +
src/libstddjb/iobuffer_flush.c | 14 +
src/libstddjb/iobuffer_init.c | 17 +
src/libstddjb/iobuffer_kfromu.c | 41 ++
src/libstddjb/iobuffer_salvage.c | 19 +
src/libstddjb/iobuffer_ufromk.c | 39 ++
src/libstddjb/iobufferk_fill.c | 49 ++
src/libstddjb/iobufferk_finish.c | 50 ++
src/libstddjb/iobufferk_flush.c | 61 ++
src/libstddjb/iobufferk_init.c | 78 +++
src/libstddjb/iobufferk_isworking.c | 48 ++
src/libstddjb/iobufferk_nosys.c | 10 +
src/libstddjb/iobufferu_fill.c | 11 +
src/libstddjb/iobufferu_finish.c | 9 +
src/libstddjb/iobufferu_flush.c | 11 +
src/libstddjb/iobufferu_init.c | 15 +
src/libstddjb/iopause.c | 24 +
src/libstddjb/iopause_poll.c | 19 +
src/libstddjb/iopause_ppoll.c | 44 ++
src/libstddjb/iopause_select.c | 63 ++
src/libstddjb/iopause_stamp.c | 22 +
src/libstddjb/iovec_from_siovec.c | 14 +
src/libstddjb/ip46_scan.c | 18 +
src/libstddjb/ip46_scanlist.c | 28 +
src/libstddjb/ip4_fmt.c | 20 +
src/libstddjb/ip4_fmtu32.c | 11 +
src/libstddjb/ip4_scan.c | 23 +
src/libstddjb/ip4_scanlist.c | 18 +
src/libstddjb/ip4_scanlist_u32.c | 19 +
src/libstddjb/ip4_scanu32.c | 12 +
src/libstddjb/ip6_fmt.c | 79 +++
src/libstddjb/ip6_scan.c | 35 +
src/libstddjb/ip6_scanlist.c | 20 +
src/libstddjb/ipc_accept.c | 48 ++
src/libstddjb/ipc_bind.c | 20 +
src/libstddjb/ipc_bind_reuse.c | 14 +
src/libstddjb/ipc_connect.c | 25 +
src/libstddjb/ipc_connected.c | 20 +
src/libstddjb/ipc_dgram.c | 11 +
src/libstddjb/ipc_eid.c | 15 +
src/libstddjb/ipc_listen.c | 10 +
src/libstddjb/ipc_local.c | 23 +
src/libstddjb/ipc_pair.c | 11 +
src/libstddjb/ipc_recv.c | 33 +
src/libstddjb/ipc_send.c | 20 +
src/libstddjb/ipc_stream.c | 11 +
src/libstddjb/ipc_timed_connect.c | 26 +
src/libstddjb/leapsecs_add.c | 19 +
src/libstddjb/leapsecs_here.c | 9 +
src/libstddjb/leapsecs_init.c | 34 +
src/libstddjb/leapsecs_sub.c | 22 +
src/libstddjb/localtm_fmt.c | 17 +
src/libstddjb/localtm_from_ltm64.c | 23 +
src/libstddjb/localtm_from_sysclock.c | 12 +
src/libstddjb/localtm_from_tai.c | 14 +
src/libstddjb/localtm_from_utc.c | 12 +
src/libstddjb/localtm_scan.c | 40 ++
src/libstddjb/localtmn_fmt.c | 12 +
src/libstddjb/localtmn_from_sysclock.c | 13 +
src/libstddjb/localtmn_from_tain.c | 13 +
src/libstddjb/localtmn_scan.c | 21 +
src/libstddjb/lock_ex.c | 37 +
src/libstddjb/lock_exnb.c | 38 ++
src/libstddjb/lock_sh.c | 37 +
src/libstddjb/lock_shnb.c | 38 ++
src/libstddjb/lock_un.c | 37 +
src/libstddjb/lolprintf.c | 15 +
src/libstddjb/long_fmt.c | 10 +
src/libstddjb/long_scan.c | 6 +
src/libstddjb/ltm64_from_localtm.c | 17 +
src/libstddjb/ltm64_from_sysclock.c | 24 +
src/libstddjb/ltm64_from_tai.c | 23 +
src/libstddjb/ltm64_from_utc.c | 23 +
src/libstddjb/mininetstring_read.c | 44 ++
src/libstddjb/mininetstring_write.c | 37 +
src/libstddjb/ndelay_off.c | 11 +
src/libstddjb/ndelay_on.c | 11 +
src/libstddjb/netstring_append.c | 19 +
src/libstddjb/netstring_appendv.c | 27 +
src/libstddjb/netstring_decode.c | 22 +
src/libstddjb/netstring_encode.c | 17 +
src/libstddjb/netstring_get.c | 54 ++
src/libstddjb/netstring_put.c | 36 +
src/libstddjb/ntp_from_tain.c | 23 +
src/libstddjb/open2.c | 15 +
src/libstddjb/open3.c | 15 +
src/libstddjb/open_append.c | 10 +
src/libstddjb/open_create.c | 10 +
src/libstddjb/open_excl.c | 10 +
src/libstddjb/open_read.c | 10 +
src/libstddjb/open_readb.c | 15 +
src/libstddjb/open_trunc.c | 10 +
src/libstddjb/open_write.c | 10 +
src/libstddjb/openreadclose.c | 21 +
src/libstddjb/openreadfileclose.c | 37 +
src/libstddjb/openreadnclose.c | 21 +
src/libstddjb/openslurpclose.c | 18 +
src/libstddjb/openwritenclose_suffix.c | 29 +
src/libstddjb/openwritenclose_unsafe.c | 32 +
src/libstddjb/pathexec.c | 12 +
src/libstddjb/pathexec0.c | 12 +
src/libstddjb/pathexec0_run.c | 10 +
src/libstddjb/pathexec_fromenv.c | 17 +
src/libstddjb/pathexec_r.c | 8 +
src/libstddjb/pathexec_r_name.c | 13 +
src/libstddjb/pathexec_run.c | 12 +
src/libstddjb/pipe_internal.c | 45 ++
src/libstddjb/prog.c | 7 +
src/libstddjb/prot.c | 19 +
src/libstddjb/prot_grps.c | 17 +
src/libstddjb/prot_readgroups.c | 28 +
src/libstddjb/realpath.c | 11 +
src/libstddjb/realpath_tmp.c | 26 +
src/libstddjb/rm_rf.c | 11 +
src/libstddjb/rm_rf_in_tmp.c | 93 +++
src/libstddjb/rm_rf_tmp.c | 18 +
src/libstddjb/rmstar.c | 11 +
src/libstddjb/sabasename.c | 17 +
src/libstddjb/sadirname.c | 18 +
src/libstddjb/sagetcwd.c | 27 +
src/libstddjb/sagethostname.c | 27 +
src/libstddjb/sanitize_read.c | 11 +
src/libstddjb/sareadlink.c | 27 +
src/libstddjb/satmp.c | 6 +
src/libstddjb/sauniquename.c | 28 +
src/libstddjb/seek_cur.c | 10 +
src/libstddjb/seek_set.c | 13 +
src/libstddjb/selfpipe-internal.h | 28 +
src/libstddjb/selfpipe_finish.c | 35 +
src/libstddjb/selfpipe_init.c | 27 +
src/libstddjb/selfpipe_internal.c | 31 +
src/libstddjb/selfpipe_read.c | 31 +
src/libstddjb/selfpipe_trap.c | 51 ++
src/libstddjb/selfpipe_trapset.c | 64 ++
src/libstddjb/selfpipe_untrap.c | 54 ++
src/libstddjb/sgetopt.c | 24 +
src/libstddjb/short_scan.c | 6 +
src/libstddjb/sig.c | 18 +
src/libstddjb/sig_block.c | 12 +
src/libstddjb/sig_blocknone.c | 11 +
src/libstddjb/sig_blockset.c | 9 +
src/libstddjb/sig_catch.c | 11 +
src/libstddjb/sig_pause.c | 11 +
src/libstddjb/sig_push.c | 11 +
src/libstddjb/sig_restoreto.c | 17 +
src/libstddjb/sig_shield.c | 17 +
src/libstddjb/sig_stack.c | 29 +
src/libstddjb/sig_unblock.c | 12 +
src/libstddjb/sig_unshield.c | 17 +
src/libstddjb/sigfpe.c | 9 +
src/libstddjb/sigsegv.c | 9 +
src/libstddjb/siovec_bytechr.c | 17 +
src/libstddjb/siovec_bytein.c | 17 +
src/libstddjb/siovec_deal.c | 24 +
src/libstddjb/siovec_from_iovec.c | 14 +
src/libstddjb/siovec_gather.c | 18 +
src/libstddjb/siovec_len.c | 10 +
src/libstddjb/siovec_scatter.c | 18 +
src/libstddjb/siovec_seek.c | 25 +
src/libstddjb/skagetln.c | 27 +
src/libstddjb/skagetlnsep.c | 27 +
src/libstddjb/skasig_dfl.c | 7 +
src/libstddjb/skasigaction.c | 24 +
src/libstddjb/slurp.c | 31 +
src/libstddjb/socket_accept4.c | 39 ++
src/libstddjb/socket_accept4_u32.c | 13 +
src/libstddjb/socket_accept6.c | 55 ++
src/libstddjb/socket_bind4.c | 19 +
src/libstddjb/socket_bind4r.c | 13 +
src/libstddjb/socket_bind6.c | 34 +
src/libstddjb/socket_bind6r.c | 13 +
src/libstddjb/socket_conn4.c | 24 +
src/libstddjb/socket_conn4_u32.c | 12 +
src/libstddjb/socket_conn6.c | 38 ++
src/libstddjb/socket_connected.c | 20 +
src/libstddjb/socket_deadlineconnstamp4.c | 14 +
src/libstddjb/socket_deadlineconnstamp46.c | 15 +
src/libstddjb/socket_deadlineconnstamp4_u32.c | 13 +
src/libstddjb/socket_deadlineconnstamp6.c | 14 +
src/libstddjb/socket_delay.c | 13 +
src/libstddjb/socket_internal.c | 33 +
src/libstddjb/socket_ioloop.c | 30 +
src/libstddjb/socket_ioloop_send4.c | 8 +
src/libstddjb/socket_ioloop_send6.c | 8 +
src/libstddjb/socket_local4.c | 20 +
src/libstddjb/socket_local46.c | 36 +
src/libstddjb/socket_local6.c | 37 +
src/libstddjb/socket_recv4.c | 22 +
src/libstddjb/socket_recv6.c | 39 ++
src/libstddjb/socket_remote4.c | 20 +
src/libstddjb/socket_remote46.c | 36 +
src/libstddjb/socket_remote6.c | 36 +
src/libstddjb/socket_send4.c | 22 +
src/libstddjb/socket_send6.c | 39 ++
src/libstddjb/socket_tcp4.c | 11 +
src/libstddjb/socket_tcp6.c | 38 ++
src/libstddjb/socket_timeoutconn.c | 13 +
src/libstddjb/socket_tryr.c | 14 +
src/libstddjb/socket_udp4.c | 11 +
src/libstddjb/socket_udp6.c | 38 ++
src/libstddjb/socket_waitconn.c | 25 +
src/libstddjb/socketpair_internal.c | 56 ++
src/libstddjb/stamp.c | 7 +
src/libstddjb/str_chr.c | 33 +
src/libstddjb/str_cpy.c | 16 +
src/libstddjb/str_diff.c | 24 +
src/libstddjb/str_diffn.c | 19 +
src/libstddjb/str_fmt.c | 9 +
src/libstddjb/str_len.c | 21 +
src/libstddjb/str_rchr.c | 28 +
src/libstddjb/str_start.c | 16 +
src/libstddjb/str_strn.c | 36 +
src/libstddjb/stralloc_append.c | 8 +
src/libstddjb/stralloc_catb.c | 12 +
src/libstddjb/stralloc_catv.c | 21 +
src/libstddjb/stralloc_copyb.c | 12 +
src/libstddjb/stralloc_free.c | 10 +
src/libstddjb/stralloc_insertb.c | 15 +
src/libstddjb/stralloc_ready_tuned.c | 25 +
src/libstddjb/stralloc_reverse.c | 15 +
src/libstddjb/stralloc_reverse_blocks.c | 17 +
src/libstddjb/stralloc_shrink.c | 14 +
src/libstddjb/stralloc_zero.c | 5 +
src/libstddjb/strerr.c | 35 +
src/libstddjb/strerr_sys.c | 22 +
src/libstddjb/string_format.c | 33 +
src/libstddjb/string_quote.c | 17 +
src/libstddjb/string_quote_nodelim.c | 9 +
src/libstddjb/string_quote_nodelim_mustquote.c | 62 ++
src/libstddjb/string_unquote.c | 20 +
src/libstddjb/string_unquote_nodelim.c | 11 +
src/libstddjb/string_unquote_withdelim.c | 60 ++
src/libstddjb/strn_fmt.c | 21 +
src/libstddjb/subgetopt.c | 63 ++
src/libstddjb/subgetopt_here.c | 7 +
src/libstddjb/sysclock_from_localtm.c | 15 +
src/libstddjb/sysclock_from_localtmn.c | 13 +
src/libstddjb/sysclock_from_ltm64.c | 26 +
src/libstddjb/sysclock_from_tai.c | 23 +
src/libstddjb/sysclock_from_utc.c | 27 +
src/libstddjb/sysclock_get.c | 42 ++
src/libstddjb/sysclock_set.c | 53 ++
src/libstddjb/tai_add.c | 8 +
src/libstddjb/tai_from_localtm.c | 14 +
src/libstddjb/tai_from_ltm64.c | 23 +
src/libstddjb/tai_from_sysclock.c | 23 +
src/libstddjb/tai_from_timespec.c | 11 +
src/libstddjb/tai_from_timeval.c | 10 +
src/libstddjb/tai_from_utc.c | 14 +
src/libstddjb/tai_now.c | 13 +
src/libstddjb/tai_pack.c | 9 +
src/libstddjb/tai_pack_little.c | 9 +
src/libstddjb/tai_relative_from_timespec.c | 11 +
src/libstddjb/tai_relative_from_timeval.c | 10 +
src/libstddjb/tai_sub.c | 8 +
src/libstddjb/tai_unpack.c | 9 +
src/libstddjb/tai_unpack_little.c | 9 +
src/libstddjb/tain_add.c | 14 +
src/libstddjb/tain_addsec.c | 20 +
src/libstddjb/tain_approx.c | 8 +
src/libstddjb/tain_clockmon.c | 47 ++
src/libstddjb/tain_fmt.c | 11 +
src/libstddjb/tain_frac.c | 8 +
src/libstddjb/tain_from_localtmn.c | 13 +
src/libstddjb/tain_from_millisecs.c | 12 +
src/libstddjb/tain_from_ntp.c | 17 +
src/libstddjb/tain_from_timespec.c | 13 +
src/libstddjb/tain_from_timeval.c | 12 +
src/libstddjb/tain_half.c | 10 +
src/libstddjb/tain_infinite_relative.c | 5 +
src/libstddjb/tain_less.c | 10 +
src/libstddjb/tain_nano500.c | 5 +
src/libstddjb/tain_now.c | 49 ++
src/libstddjb/tain_pack.c | 10 +
src/libstddjb/tain_pack_little.c | 10 +
src/libstddjb/tain_relative_from_timespec.c | 13 +
src/libstddjb/tain_relative_from_timeval.c | 12 +
src/libstddjb/tain_scan.c | 12 +
src/libstddjb/tain_setnow.c | 13 +
src/libstddjb/tain_sub.c | 15 +
src/libstddjb/tain_sysclock.c | 12 +
src/libstddjb/tain_to_millisecs.c | 11 +
src/libstddjb/tain_ulong.c | 9 +
src/libstddjb/tain_unpack.c | 10 +
src/libstddjb/tain_unpack_little.c | 10 +
src/libstddjb/timespec_from_tai.c | 12 +
src/libstddjb/timespec_from_tai_relative.c | 19 +
src/libstddjb/timespec_from_tain.c | 14 +
src/libstddjb/timespec_from_tain_relative.c | 14 +
src/libstddjb/timestamp.c | 9 +
src/libstddjb/timestamp_fmt.c | 9 +
src/libstddjb/timestamp_r.c | 10 +
src/libstddjb/timestamp_scan.c | 11 +
src/libstddjb/timeval_from_tai.c | 11 +
src/libstddjb/timeval_from_tai_relative.c | 18 +
src/libstddjb/timeval_from_tain.c | 13 +
src/libstddjb/timeval_from_tain_relative.c | 13 +
src/libstddjb/ucharn_findlen.c | 10 +
src/libstddjb/ucharn_fmt.c | 14 +
src/libstddjb/ucharn_fmt_little.c | 14 +
src/libstddjb/ucharn_scan.c | 18 +
src/libstddjb/ucharn_scan_little.c | 18 +
src/libstddjb/ucspi_get.c | 22 +
src/libstddjb/uint160_scan.c | 6 +
src/libstddjb/uint16_fmtlist.c | 6 +
src/libstddjb/uint16_pack.c | 10 +
src/libstddjb/uint16_pack_big.c | 10 +
src/libstddjb/uint16_reverse.c | 14 +
src/libstddjb/uint16_scan.c | 6 +
src/libstddjb/uint16_scanlist.c | 6 +
src/libstddjb/uint16_unpack.c | 11 +
src/libstddjb/uint16_unpack_big.c | 11 +
src/libstddjb/uint320_scan.c | 6 +
src/libstddjb/uint32_fmtlist.c | 6 +
src/libstddjb/uint32_pack.c | 12 +
src/libstddjb/uint32_pack_big.c | 12 +
src/libstddjb/uint32_reverse.c | 17 +
src/libstddjb/uint32_scan.c | 6 +
src/libstddjb/uint32_scanlist.c | 6 +
src/libstddjb/uint32_unpack.c | 13 +
src/libstddjb/uint32_unpack_big.c | 13 +
src/libstddjb/uint640_fmt.c | 10 +
src/libstddjb/uint640_scan.c | 6 +
src/libstddjb/uint64_fmt.c | 19 +
src/libstddjb/uint64_fmtlist.c | 6 +
src/libstddjb/uint64_pack.c | 16 +
src/libstddjb/uint64_pack_big.c | 16 +
src/libstddjb/uint64_reverse.c | 15 +
src/libstddjb/uint64_scan.c | 6 +
src/libstddjb/uint64_scanlist.c | 6 +
src/libstddjb/uint64_unpack.c | 17 +
src/libstddjb/uint64_unpack_big.c | 17 +
src/libstddjb/uncoe.c | 11 +
src/libstddjb/unsanitize_read.c | 11 +
src/libstddjb/utc_from_localtm.c | 15 +
src/libstddjb/utc_from_ltm64.c | 23 +
src/libstddjb/utc_from_sysclock.c | 25 +
src/libstddjb/utc_from_tai.c | 14 +
src/libstddjb/vbaprintf.c | 23 +
src/libstddjb/vbprintf.c | 25 +
src/libstddjb/wait_nointr.c | 15 +
src/libstddjb/wait_pid_nohang.c | 17 +
src/libstddjb/wait_pids_nohang.c | 23 +
src/libstddjb/wait_reap.c | 11 +
src/libstddjb/waitn.c | 18 +
src/libstddjb/waitn_reap.c | 19 +
src/libstddjb/waitpid_nointr.c | 15 +
src/libunixonacid/bufalloc_timed_flush.c | 16 +
src/libunixonacid/buffer_timed_fill.c | 17 +
src/libunixonacid/buffer_timed_flush.c | 16 +
src/libunixonacid/buffer_timed_get.c | 30 +
src/libunixonacid/dd_cancel.c | 17 +
src/libunixonacid/dd_close.c | 9 +
src/libunixonacid/dd_commit.c | 68 ++
src/libunixonacid/dd_commit_devino.c | 16 +
src/libunixonacid/dd_open_read.c | 14 +
src/libunixonacid/dd_open_write.c | 34 +
src/libunixonacid/kolbak_call.c | 13 +
src/libunixonacid/kolbak_enqueue.c | 15 +
src/libunixonacid/kolbak_queue_init.c | 14 +
src/libunixonacid/kolbak_unenqueue.c | 11 +
src/libunixonacid/mkdir_unique.c | 24 +
src/libunixonacid/netstring_timed_get.c | 24 +
src/libunixonacid/open2_at.c | 60 ++
src/libunixonacid/open3_at.c | 60 ++
src/libunixonacid/open_appendat.c | 11 +
src/libunixonacid/open_appendatb.c | 12 +
src/libunixonacid/open_readat.c | 10 +
src/libunixonacid/open_readatb.c | 12 +
src/libunixonacid/open_truncat.c | 10 +
src/libunixonacid/open_truncatb.c | 12 +
src/libunixonacid/open_writeat.c | 10 +
src/libunixonacid/open_writeatb.c | 12 +
src/libunixonacid/opengetlnclose.c | 24 +
src/libunixonacid/opengetlnclose_at.c | 24 +
src/libunixonacid/openreadnclose_at.c | 19 +
src/libunixonacid/openslurpclose_at.c | 21 +
src/libunixonacid/openwritenclose.c | 11 +
src/libunixonacid/openwritenclose_at.c | 24 +
src/libunixonacid/openwritenclose_devino.c | 12 +
src/libunixonacid/openwritenclose_devino_tmp.c | 35 +
src/libunixonacid/openwritenclose_tmp.c | 11 +
src/libunixonacid/skaclient-internal.h | 15 +
src/libunixonacid/skaclient_default_cb.c | 14 +
src/libunixonacid/skaclient_end.c | 21 +
src/libunixonacid/skaclient_init.c | 32 +
src/libunixonacid/skaclient_put.c | 10 +
src/libunixonacid/skaclient_putmsg.c | 16 +
src/libunixonacid/skaclient_putmsgv.c | 16 +
src/libunixonacid/skaclient_putv.c | 11 +
src/libunixonacid/skaclient_send.c | 11 +
src/libunixonacid/skaclient_sendmsg.c | 15 +
src/libunixonacid/skaclient_sendmsgv.c | 15 +
src/libunixonacid/skaclient_sendv.c | 12 +
src/libunixonacid/skaclient_server_ack.c | 30 +
src/libunixonacid/skaclient_server_bidi_ack.c | 12 +
src/libunixonacid/skaclient_server_init.c | 15 +
src/libunixonacid/skaclient_start.c | 43 ++
src/libunixonacid/skaclient_start_async.c | 52 ++
src/libunixonacid/skaclient_start_cb.c | 18 +
src/libunixonacid/skaclient_startf.c | 46 ++
src/libunixonacid/skaclient_startf_async.c | 61 ++
src/libunixonacid/skaclient_zero.c | 5 +
src/libunixonacid/timed_flush.c | 26 +
src/libunixonacid/timed_get.c | 22 +
src/libunixonacid/timed_getln.c | 32 +
src/libunixonacid/timed_getlnmax.c | 33 +
src/libunixonacid/unixmessage_bits_closeall.c | 7 +
src/libunixonacid/unixmessage_bits_closenone.c | 7 +
src/libunixonacid/unixmessage_handle.c | 19 +
src/libunixonacid/unixmessage_put.c | 83 +++
src/libunixonacid/unixmessage_read.c | 60 ++
src/libunixonacid/unixmessage_receive.c | 44 ++
src/libunixonacid/unixmessage_receiver_free.c | 11 +
src/libunixonacid/unixmessage_receiver_init.c | 17 +
src/libunixonacid/unixmessage_sender_flush.c | 82 +++
src/libunixonacid/unixmessage_sender_free.c | 29 +
src/libunixonacid/unixmessage_sender_getfd.c | 8 +
src/libunixonacid/unixmessage_sender_init.c | 14 +
src/libunixonacid/unixmessage_sender_timed_flush.c | 17 +
src/libunixonacid/unixmessage_sender_zero.c | 5 +
src/libunixonacid/unixmessage_timed_handle.c | 30 +
src/libunixonacid/unixmessage_timed_receive.c | 29 +
src/libunixonacid/unixmessage_v_zero.c | 5 +
src/libunixonacid/unixmessage_zero.c | 5 +
src/sysdeps/tryaccept4.c | 33 +
src/sysdeps/tryancilautoclose.c | 116 ++++
src/sysdeps/tryclockmon.c | 11 +
src/sysdeps/tryclockrt.c | 11 +
src/sysdeps/trycmsgcloexec.c | 25 +
src/sysdeps/trydevrandom.c | 54 ++
src/sysdeps/trydevurandom.c | 31 +
src/sysdeps/tryendianness.c | 43 ++
src/sysdeps/tryeproto.c | 7 +
src/sysdeps/tryeventfd.c | 10 +
src/sysdeps/tryflock.c | 13 +
src/sysdeps/trygetpeereid.c | 15 +
src/sysdeps/trygetpeerucred.c | 20 +
src/sysdeps/tryipv6.c | 35 +
src/sysdeps/trylinkat.c | 29 +
src/sysdeps/trylsock.c | 26 +
src/sysdeps/trymalloc0.c | 4 +
src/sysdeps/tryopenat.c | 29 +
src/sysdeps/trypipe2.c | 17 +
src/sysdeps/tryposixspawn.c | 16 +
src/sysdeps/tryppoll.c | 18 +
src/sysdeps/tryrevoke.c | 7 +
src/sysdeps/trysendfile.c | 10 +
src/sysdeps/trysetgroups.c | 27 +
src/sysdeps/trysettimeofday.c | 27 +
src/sysdeps/trysignalfd.c | 13 +
src/sysdeps/trysizeofgid.c | 8 +
src/sysdeps/trysizeoftime.c | 8 +
src/sysdeps/trysizeofuint.c | 7 +
src/sysdeps/trysizeofulong.c | 7 +
src/sysdeps/trysizeofushort.c | 7 +
src/sysdeps/trysopeercred.c | 29 +
src/sysdeps/trysplice.c | 28 +
src/sysdeps/trystrcasestr.c | 21 +
src/sysdeps/tryuint64t.c | 5 +
tools/gen-deps.sh | 50 ++
tools/install.sh | 64 ++
901 files changed, 26382 insertions(+)
create mode 100644 .gitignore
create mode 100644 AUTHORS
create mode 100644 CHANGES
create mode 100644 COPYING
create mode 100644 INSTALL
create mode 100644 Makefile
create mode 100644 README
create mode 100644 README.macosx
create mode 100644 README.solaris
create mode 100755 configure
create mode 100644 doc/crosscompile.html
create mode 100644 doc/djblegacy.html
create mode 100644 doc/flags.html
create mode 100644 doc/index.html
create mode 100644 doc/libbiguint/index.html
create mode 100644 doc/libdatastruct/index.html
create mode 100644 doc/librandom/index.html
create mode 100644 doc/libskarnet.html
create mode 100644 doc/libstdcrypto/index.html
create mode 100644 doc/libstddjb/alloc.html
create mode 100644 doc/libstddjb/allreadwrite.html
create mode 100644 doc/libstddjb/bitarray.html
create mode 100644 doc/libstddjb/djbtime.html
create mode 100644 doc/libstddjb/djbunix.html
create mode 100644 doc/libstddjb/gccattributes.html
create mode 100644 doc/libstddjb/genalloc.html
create mode 100644 doc/libstddjb/genwrite.html
create mode 100644 doc/libstddjb/index.html
create mode 100644 doc/libstddjb/iopause.html
create mode 100644 doc/libstddjb/ip46.html
create mode 100644 doc/libstddjb/lolstdio.html
create mode 100644 doc/libstddjb/safewrappers.html
create mode 100644 doc/libstddjb/selfpipe.html
create mode 100644 doc/libstddjb/stralloc.html
create mode 100644 doc/libstddjb/tai.html
create mode 100644 doc/libunixonacid/index.html
create mode 100644 doc/libunixonacid/kolbak.html
create mode 100644 doc/libunixonacid/skaclient.html
create mode 100644 doc/libunixonacid/unix-timed.html
create mode 100644 doc/libunixonacid/unix-transactional.html
create mode 100644 doc/libunixonacid/unixmessage.html
create mode 100644 doc/license.html
create mode 100644 doc/upgrade.html
create mode 100644 package/deps.mak
create mode 100644 package/info
create mode 100755 patch-for-solaris
create mode 100644 src/etc/leapsecs.dat
create mode 100644 src/headers/error-addrinuse
create mode 100644 src/headers/error-already
create mode 100644 src/headers/error-footer
create mode 100644 src/headers/error-header
create mode 100644 src/headers/error-proto
create mode 100644 src/headers/gidstuff-16
create mode 100644 src/headers/gidstuff-32
create mode 100644 src/headers/gidstuff-64
create mode 100644 src/headers/gidstuff-footer
create mode 100644 src/headers/gidstuff-header
create mode 100644 src/headers/ip46-footer
create mode 100644 src/headers/ip46-header
create mode 100644 src/headers/ip46-with
create mode 100644 src/headers/ip46-without
create mode 100644 src/headers/setgroups-footer
create mode 100644 src/headers/setgroups-header
create mode 100644 src/headers/setgroups-stub
create mode 100644 src/headers/uint-16
create mode 100644 src/headers/uint-32
create mode 100644 src/headers/uint-64
create mode 100644 src/headers/uint-footer
create mode 100644 src/headers/uint-header
create mode 100644 src/headers/uint16-bendian
create mode 100644 src/headers/uint16-footer
create mode 100644 src/headers/uint16-header
create mode 100644 src/headers/uint16-lendian
create mode 100644 src/headers/uint32-bendian
create mode 100644 src/headers/uint32-footer
create mode 100644 src/headers/uint32-header
create mode 100644 src/headers/uint32-inttypesh
create mode 100644 src/headers/uint32-lendian
create mode 100644 src/headers/uint32-noulong32
create mode 100644 src/headers/uint32-stdinth
create mode 100644 src/headers/uint32-ulong32
create mode 100644 src/headers/uint64-bendian
create mode 100644 src/headers/uint64-footer
create mode 100644 src/headers/uint64-header
create mode 100644 src/headers/uint64-lendian
create mode 100644 src/headers/uint64-noulong64
create mode 100644 src/headers/uint64-stdinth
create mode 100644 src/headers/uint64-ulong64
create mode 100644 src/headers/ulong-32
create mode 100644 src/headers/ulong-64
create mode 100644 src/headers/ulong-footer
create mode 100644 src/headers/ulong-header
create mode 100644 src/headers/ushort-16
create mode 100644 src/headers/ushort-32
create mode 100644 src/headers/ushort-footer
create mode 100644 src/headers/ushort-header
create mode 100644 src/include/skalibs/alloc.h
create mode 100644 src/include/skalibs/allreadwrite.h
create mode 100644 src/include/skalibs/avlnode.h
create mode 100644 src/include/skalibs/avltree.h
create mode 100644 src/include/skalibs/avltreen.h
create mode 100644 src/include/skalibs/biguint.h
create mode 100644 src/include/skalibs/bitarray.h
create mode 100644 src/include/skalibs/bufalloc.h
create mode 100644 src/include/skalibs/buffer.h
create mode 100644 src/include/skalibs/bytestr.h
create mode 100644 src/include/skalibs/cbuffer.h
create mode 100644 src/include/skalibs/cdb.h
create mode 100644 src/include/skalibs/cdb_make.h
create mode 100644 src/include/skalibs/datastruct.h
create mode 100644 src/include/skalibs/direntry.h
create mode 100644 src/include/skalibs/diuint.h
create mode 100644 src/include/skalibs/diuint32.h
create mode 100644 src/include/skalibs/djbtime.h
create mode 100644 src/include/skalibs/djbunix.h
create mode 100644 src/include/skalibs/env.h
create mode 100644 src/include/skalibs/envalloc.h
create mode 100644 src/include/skalibs/environ.h
create mode 100644 src/include/skalibs/fmtscan.h
create mode 100644 src/include/skalibs/functypes.h
create mode 100644 src/include/skalibs/gccattributes.h
create mode 100644 src/include/skalibs/genalloc.h
create mode 100644 src/include/skalibs/genset.h
create mode 100644 src/include/skalibs/gensetdyn.h
create mode 100644 src/include/skalibs/genwrite.h
create mode 100644 src/include/skalibs/getpeereid.h
create mode 100644 src/include/skalibs/iobuffer.h
create mode 100644 src/include/skalibs/iopause.h
create mode 100644 src/include/skalibs/kolbak.h
create mode 100644 src/include/skalibs/lolstdio.h
create mode 100644 src/include/skalibs/md5.h
create mode 100644 src/include/skalibs/mininetstring.h
create mode 100644 src/include/skalibs/netstring.h
create mode 100644 src/include/skalibs/nonposix.h
create mode 100644 src/include/skalibs/nsig.h
create mode 100644 src/include/skalibs/random.h
create mode 100644 src/include/skalibs/randomegd.h
create mode 100644 src/include/skalibs/rc4.h
create mode 100644 src/include/skalibs/rrandom.h
create mode 100644 src/include/skalibs/segfault.h
create mode 100644 src/include/skalibs/selfpipe.h
create mode 100644 src/include/skalibs/sgetopt.h
create mode 100644 src/include/skalibs/sha1.h
create mode 100644 src/include/skalibs/sha256.h
create mode 100644 src/include/skalibs/sig.h
create mode 100644 src/include/skalibs/siovec.h
create mode 100644 src/include/skalibs/skaclient.h
create mode 100644 src/include/skalibs/skalibs.h
create mode 100644 src/include/skalibs/skamisc.h
create mode 100644 src/include/skalibs/socket.h
create mode 100644 src/include/skalibs/stdcrypto.h
create mode 100644 src/include/skalibs/stddjb.h
create mode 100644 src/include/skalibs/stralloc.h
create mode 100644 src/include/skalibs/strerr.h
create mode 100644 src/include/skalibs/strerr2.h
create mode 100644 src/include/skalibs/surf.h
create mode 100644 src/include/skalibs/tai.h
create mode 100644 src/include/skalibs/unirandom.h
create mode 100644 src/include/skalibs/unirandomdev.h
create mode 100644 src/include/skalibs/unirandomegd.h
create mode 100644 src/include/skalibs/unisurf.h
create mode 100644 src/include/skalibs/unix-timed.h
create mode 100644 src/include/skalibs/unix-transactional.h
create mode 100644 src/include/skalibs/unixmessage.h
create mode 100644 src/include/skalibs/unixonacid.h
create mode 100644 src/include/skalibs/webipc.h
create mode 100644 src/libbiguint/bu_addc.c
create mode 100644 src/libbiguint/bu_addmod.c
create mode 100644 src/libbiguint/bu_cmp.c
create mode 100644 src/libbiguint/bu_copy.c
create mode 100644 src/libbiguint/bu_copy_internal.c
create mode 100644 src/libbiguint/bu_div.c
create mode 100644 src/libbiguint/bu_div_internal.c
create mode 100644 src/libbiguint/bu_divmod.c
create mode 100644 src/libbiguint/bu_divmod_internal.c
create mode 100644 src/libbiguint/bu_fmt.c
create mode 100644 src/libbiguint/bu_gcd.c
create mode 100644 src/libbiguint/bu_invmod.c
create mode 100644 src/libbiguint/bu_len.c
create mode 100644 src/libbiguint/bu_mod.c
create mode 100644 src/libbiguint/bu_mul.c
create mode 100644 src/libbiguint/bu_mulmod.c
create mode 100644 src/libbiguint/bu_pack.c
create mode 100644 src/libbiguint/bu_pack_big.c
create mode 100644 src/libbiguint/bu_scan.c
create mode 100644 src/libbiguint/bu_scan_internal.c
create mode 100644 src/libbiguint/bu_scanlen.c
create mode 100644 src/libbiguint/bu_slbc.c
create mode 100644 src/libbiguint/bu_srbc.c
create mode 100644 src/libbiguint/bu_subc.c
create mode 100644 src/libbiguint/bu_submod.c
create mode 100644 src/libbiguint/bu_unpack.c
create mode 100644 src/libbiguint/bu_unpack_big.c
create mode 100644 src/libbiguint/bu_zero.c
create mode 100644 src/libdatastruct/avlnode-internal.h
create mode 100644 src/libdatastruct/avlnode_delete.c
create mode 100644 src/libdatastruct/avlnode_doublerotate.c
create mode 100644 src/libdatastruct/avlnode_extreme.c
create mode 100644 src/libdatastruct/avlnode_extremenode.c
create mode 100644 src/libdatastruct/avlnode_height.c
create mode 100644 src/libdatastruct/avlnode_insertnode.c
create mode 100644 src/libdatastruct/avlnode_iter.c
create mode 100644 src/libdatastruct/avlnode_rotate.c
create mode 100644 src/libdatastruct/avlnode_search.c
create mode 100644 src/libdatastruct/avlnode_searchnode.c
create mode 100644 src/libdatastruct/avlnode_zero.c
create mode 100644 src/libdatastruct/avltree_delete.c
create mode 100644 src/libdatastruct/avltree_free.c
create mode 100644 src/libdatastruct/avltree_init.c
create mode 100644 src/libdatastruct/avltree_insert.c
create mode 100644 src/libdatastruct/avltree_newnode.c
create mode 100644 src/libdatastruct/avltree_zero.c
create mode 100644 src/libdatastruct/avltreen_delete.c
create mode 100644 src/libdatastruct/avltreen_init.c
create mode 100644 src/libdatastruct/avltreen_insert.c
create mode 100644 src/libdatastruct/avltreen_newnode.c
create mode 100644 src/libdatastruct/genset.c
create mode 100644 src/libdatastruct/genset_iter.c
create mode 100644 src/libdatastruct/gensetdyn_delete.c
create mode 100644 src/libdatastruct/gensetdyn_free.c
create mode 100644 src/libdatastruct/gensetdyn_init.c
create mode 100644 src/libdatastruct/gensetdyn_iter.c
create mode 100644 src/libdatastruct/gensetdyn_new.c
create mode 100644 src/libdatastruct/gensetdyn_ready.c
create mode 100644 src/libdatastruct/gensetdyn_zero.c
create mode 100644 src/librandom/badrandom_char.c
create mode 100644 src/librandom/badrandom_finish.c
create mode 100644 src/librandom/badrandom_here.c
create mode 100644 src/librandom/badrandom_init.c
create mode 100644 src/librandom/badrandom_int.c
create mode 100644 src/librandom/badrandom_string.c
create mode 100644 src/librandom/goodrandom_char.c
create mode 100644 src/librandom/goodrandom_finish.c
create mode 100644 src/librandom/goodrandom_here.c
create mode 100644 src/librandom/goodrandom_init.c
create mode 100644 src/librandom/goodrandom_int.c
create mode 100644 src/librandom/goodrandom_string.c
create mode 100644 src/librandom/random-internal.h
create mode 100644 src/librandom/random_mask2.c
create mode 100644 src/librandom/random_name.c
create mode 100644 src/librandom/random_sauniquename.c
create mode 100644 src/librandom/random_unsort.c
create mode 100644 src/librandom/randomegd_open.c
create mode 100644 src/librandom/randomegd_readb.c
create mode 100644 src/librandom/randomegd_readnb.c
create mode 100644 src/librandom/rrandom_add.c
create mode 100644 src/librandom/rrandom_finish.c
create mode 100644 src/librandom/rrandom_name.c
create mode 100644 src/librandom/rrandom_read.c
create mode 100644 src/librandom/rrandom_readint.c
create mode 100644 src/librandom/surf.c
create mode 100644 src/librandom/surf_autoinit.c
create mode 100644 src/librandom/surf_here.c
create mode 100644 src/librandom/surf_init.c
create mode 100644 src/librandom/surf_makeseed.c
create mode 100644 src/librandom/surf_sinit.c
create mode 100644 src/librandom/unidevrandom.c
create mode 100644 src/librandom/unidevurandom.c
create mode 100644 src/librandom/unihasegd.c
create mode 100644 src/librandom/unirandom_finish.c
create mode 100644 src/librandom/unirandom_init.c
create mode 100644 src/librandom/unirandom_readb.c
create mode 100644 src/librandom/unirandom_readnb.c
create mode 100644 src/librandom/unirandom_register.c
create mode 100644 src/librandom/unirandomdev.c
create mode 100644 src/librandom/unirandomegd.c
create mode 100644 src/librandom/unisurf.c
create mode 100644 src/librandom/unisurf_init.c
create mode 100644 src/libstdcrypto/INCLUDE
create mode 100644 src/libstdcrypto/Makefile
create mode 100644 src/libstdcrypto/md5-internal.h
create mode 100644 src/libstdcrypto/md5_final.c
create mode 100644 src/libstdcrypto/md5_init.c
create mode 100644 src/libstdcrypto/md5_transform.c
create mode 100644 src/libstdcrypto/md5_update.c
create mode 100644 src/libstdcrypto/rc4.c
create mode 100644 src/libstdcrypto/rc4_init.c
create mode 100644 src/libstdcrypto/sha1-internal.h
create mode 100644 src/libstdcrypto/sha1_feed.c
create mode 100644 src/libstdcrypto/sha1_final.c
create mode 100644 src/libstdcrypto/sha1_init.c
create mode 100644 src/libstdcrypto/sha1_transform.c
create mode 100644 src/libstdcrypto/sha1_update.c
create mode 100644 src/libstdcrypto/sha256-internal.h
create mode 100644 src/libstdcrypto/sha256_feed.c
create mode 100644 src/libstdcrypto/sha256_final.c
create mode 100644 src/libstdcrypto/sha256_init.c
create mode 100644 src/libstdcrypto/sha256_transform.c
create mode 100644 src/libstdcrypto/sha256_update.c
create mode 100644 src/libstddjb/absolutepath.c
create mode 100644 src/libstddjb/absolutepath_tmp.c
create mode 100644 src/libstddjb/alloc-internal.h
create mode 100644 src/libstddjb/alloc.c
create mode 100644 src/libstddjb/alloc_0.c
create mode 100644 src/libstddjb/allread.c
create mode 100644 src/libstddjb/allreadwrite.c
create mode 100644 src/libstddjb/allwrite.c
create mode 100644 src/libstddjb/baprintf.c
create mode 100644 src/libstddjb/basename.c
create mode 100644 src/libstddjb/bitarray_and.c
create mode 100644 src/libstddjb/bitarray_clearsetn.c
create mode 100644 src/libstddjb/bitarray_firstclear.c
create mode 100644 src/libstddjb/bitarray_firstset.c
create mode 100644 src/libstddjb/bitarray_not.c
create mode 100644 src/libstddjb/bitarray_or.c
create mode 100644 src/libstddjb/bitarray_testandpoke.c
create mode 100644 src/libstddjb/bitarray_xor.c
create mode 100644 src/libstddjb/bprintf.c
create mode 100644 src/libstddjb/bufalloc_1.c
create mode 100644 src/libstddjb/bufalloc_2.c
create mode 100644 src/libstddjb/bufalloc_clean.c
create mode 100644 src/libstddjb/bufalloc_flush.c
create mode 100644 src/libstddjb/bufalloc_getfd.c
create mode 100644 src/libstddjb/bufalloc_getlen.c
create mode 100644 src/libstddjb/bufalloc_init.c
create mode 100644 src/libstddjb/buffer_0.c
create mode 100644 src/libstddjb/buffer_0f1.c
create mode 100644 src/libstddjb/buffer_0small.c
create mode 100644 src/libstddjb/buffer_1.c
create mode 100644 src/libstddjb/buffer_1small.c
create mode 100644 src/libstddjb/buffer_2.c
create mode 100644 src/libstddjb/buffer_fill.c
create mode 100644 src/libstddjb/buffer_flush.c
create mode 100644 src/libstddjb/buffer_flush1read.c
create mode 100644 src/libstddjb/buffer_get.c
create mode 100644 src/libstddjb/buffer_getall.c
create mode 100644 src/libstddjb/buffer_getallnf.c
create mode 100644 src/libstddjb/buffer_getfd.c
create mode 100644 src/libstddjb/buffer_getlen.c
create mode 100644 src/libstddjb/buffer_getv.c
create mode 100644 src/libstddjb/buffer_getvall.c
create mode 100644 src/libstddjb/buffer_getvallnf.c
create mode 100644 src/libstddjb/buffer_init.c
create mode 100644 src/libstddjb/buffer_put.c
create mode 100644 src/libstddjb/buffer_putall.c
create mode 100644 src/libstddjb/buffer_putallnf.c
create mode 100644 src/libstddjb/buffer_putflush.c
create mode 100644 src/libstddjb/buffer_putv.c
create mode 100644 src/libstddjb/buffer_putvall.c
create mode 100644 src/libstddjb/buffer_putvallnf.c
create mode 100644 src/libstddjb/buffer_putvflush.c
create mode 100644 src/libstddjb/buffer_read.c
create mode 100644 src/libstddjb/buffer_write.c
create mode 100644 src/libstddjb/byte_chr.c
create mode 100644 src/libstddjb/byte_copy.c
create mode 100644 src/libstddjb/byte_count.c
create mode 100644 src/libstddjb/byte_cr.c
create mode 100644 src/libstddjb/byte_diff.c
create mode 100644 src/libstddjb/byte_in.c
create mode 100644 src/libstddjb/byte_rchr.c
create mode 100644 src/libstddjb/byte_zero.c
create mode 100644 src/libstddjb/case_diffb.c
create mode 100644 src/libstddjb/case_diffs.c
create mode 100644 src/libstddjb/case_lowerb.c
create mode 100644 src/libstddjb/case_lowers.c
create mode 100644 src/libstddjb/case_startb.c
create mode 100644 src/libstddjb/case_str.c
create mode 100644 src/libstddjb/case_upperb.c
create mode 100644 src/libstddjb/case_uppers.c
create mode 100644 src/libstddjb/cbuffer_get.c
create mode 100644 src/libstddjb/cbuffer_getv.c
create mode 100644 src/libstddjb/cbuffer_init.c
create mode 100644 src/libstddjb/cbuffer_put.c
create mode 100644 src/libstddjb/cbuffer_putv.c
create mode 100644 src/libstddjb/cbuffer_rpeek.c
create mode 100644 src/libstddjb/cbuffer_rseek.c
create mode 100644 src/libstddjb/cbuffer_unget.c
create mode 100644 src/libstddjb/cbuffer_unput.c
create mode 100644 src/libstddjb/cbuffer_wpeek.c
create mode 100644 src/libstddjb/cbuffer_wseek.c
create mode 100644 src/libstddjb/cdb_findnext.c
create mode 100644 src/libstddjb/cdb_free.c
create mode 100644 src/libstddjb/cdb_hash.c
create mode 100644 src/libstddjb/cdb_init_map.c
create mode 100644 src/libstddjb/cdb_make.c
create mode 100644 src/libstddjb/cdb_mapfile.c
create mode 100644 src/libstddjb/cdb_nextkey.c
create mode 100644 src/libstddjb/cdb_read.c
create mode 100644 src/libstddjb/cdb_successor.c
create mode 100644 src/libstddjb/cdb_zero.c
create mode 100644 src/libstddjb/child_spawn.c
create mode 100644 src/libstddjb/child_spawn0.c
create mode 100644 src/libstddjb/child_spawn1.c
create mode 100644 src/libstddjb/coe.c
create mode 100644 src/libstddjb/deepsleepuntil.c
create mode 100644 src/libstddjb/dir_close.c
create mode 100644 src/libstddjb/dirname.c
create mode 100644 src/libstddjb/djbtime-internal.h
create mode 100644 src/libstddjb/doublefork.c
create mode 100644 src/libstddjb/env_addmodif.c
create mode 100644 src/libstddjb/env_get.c
create mode 100644 src/libstddjb/env_get2.c
create mode 100644 src/libstddjb/env_len.c
create mode 100644 src/libstddjb/env_make.c
create mode 100644 src/libstddjb/env_merge.c
create mode 100644 src/libstddjb/env_string.c
create mode 100644 src/libstddjb/envalloc_0.c
create mode 100644 src/libstddjb/envalloc_make.c
create mode 100644 src/libstddjb/envalloc_merge.c
create mode 100644 src/libstddjb/envalloc_uniq.c
create mode 100644 src/libstddjb/envdir.c
create mode 100644 src/libstddjb/error_str.c
create mode 100644 src/libstddjb/error_temp.c
create mode 100644 src/libstddjb/execvep.c
create mode 100644 src/libstddjb/fd_cat.c
create mode 100644 src/libstddjb/fd_catn.c
create mode 100644 src/libstddjb/fd_chdir.c
create mode 100644 src/libstddjb/fd_chmod.c
create mode 100644 src/libstddjb/fd_chown.c
create mode 100644 src/libstddjb/fd_close.c
create mode 100644 src/libstddjb/fd_copy.c
create mode 100644 src/libstddjb/fd_copy2.c
create mode 100644 src/libstddjb/fd_ensure_open.c
create mode 100644 src/libstddjb/fd_move.c
create mode 100644 src/libstddjb/fd_move2.c
create mode 100644 src/libstddjb/fd_read.c
create mode 100644 src/libstddjb/fd_readv.c
create mode 100644 src/libstddjb/fd_recv.c
create mode 100644 src/libstddjb/fd_select.c
create mode 100644 src/libstddjb/fd_send.c
create mode 100644 src/libstddjb/fd_sync.c
create mode 100644 src/libstddjb/fd_write.c
create mode 100644 src/libstddjb/fd_writev.c
create mode 100644 src/libstddjb/fmtscan-internal.h
create mode 100644 src/libstddjb/fmtscan_asc.c
create mode 100644 src/libstddjb/fmtscan_num.c
create mode 100644 src/libstddjb/genalloc_deepfree.c
create mode 100644 src/libstddjb/genwrite_flush_bufalloc.c
create mode 100644 src/libstddjb/genwrite_flush_buffer.c
create mode 100644 src/libstddjb/genwrite_flush_stralloc.c
create mode 100644 src/libstddjb/genwrite_put_bufalloc.c
create mode 100644 src/libstddjb/genwrite_put_buffer.c
create mode 100644 src/libstddjb/genwrite_put_stralloc.c
create mode 100644 src/libstddjb/genwrite_stderr.c
create mode 100644 src/libstddjb/genwrite_stdout.c
create mode 100644 src/libstddjb/getlnmax.c
create mode 100644 src/libstddjb/getlnmaxsep.c
create mode 100644 src/libstddjb/getpeereid.c
create mode 100644 src/libstddjb/int_scan.c
create mode 100644 src/libstddjb/iobuffer_fill.c
create mode 100644 src/libstddjb/iobuffer_flush.c
create mode 100644 src/libstddjb/iobuffer_init.c
create mode 100644 src/libstddjb/iobuffer_kfromu.c
create mode 100644 src/libstddjb/iobuffer_salvage.c
create mode 100644 src/libstddjb/iobuffer_ufromk.c
create mode 100644 src/libstddjb/iobufferk_fill.c
create mode 100644 src/libstddjb/iobufferk_finish.c
create mode 100644 src/libstddjb/iobufferk_flush.c
create mode 100644 src/libstddjb/iobufferk_init.c
create mode 100644 src/libstddjb/iobufferk_isworking.c
create mode 100644 src/libstddjb/iobufferk_nosys.c
create mode 100644 src/libstddjb/iobufferu_fill.c
create mode 100644 src/libstddjb/iobufferu_finish.c
create mode 100644 src/libstddjb/iobufferu_flush.c
create mode 100644 src/libstddjb/iobufferu_init.c
create mode 100644 src/libstddjb/iopause.c
create mode 100644 src/libstddjb/iopause_poll.c
create mode 100644 src/libstddjb/iopause_ppoll.c
create mode 100644 src/libstddjb/iopause_select.c
create mode 100644 src/libstddjb/iopause_stamp.c
create mode 100644 src/libstddjb/iovec_from_siovec.c
create mode 100644 src/libstddjb/ip46_scan.c
create mode 100644 src/libstddjb/ip46_scanlist.c
create mode 100644 src/libstddjb/ip4_fmt.c
create mode 100644 src/libstddjb/ip4_fmtu32.c
create mode 100644 src/libstddjb/ip4_scan.c
create mode 100644 src/libstddjb/ip4_scanlist.c
create mode 100644 src/libstddjb/ip4_scanlist_u32.c
create mode 100644 src/libstddjb/ip4_scanu32.c
create mode 100644 src/libstddjb/ip6_fmt.c
create mode 100644 src/libstddjb/ip6_scan.c
create mode 100644 src/libstddjb/ip6_scanlist.c
create mode 100644 src/libstddjb/ipc_accept.c
create mode 100644 src/libstddjb/ipc_bind.c
create mode 100644 src/libstddjb/ipc_bind_reuse.c
create mode 100644 src/libstddjb/ipc_connect.c
create mode 100644 src/libstddjb/ipc_connected.c
create mode 100644 src/libstddjb/ipc_dgram.c
create mode 100644 src/libstddjb/ipc_eid.c
create mode 100644 src/libstddjb/ipc_listen.c
create mode 100644 src/libstddjb/ipc_local.c
create mode 100644 src/libstddjb/ipc_pair.c
create mode 100644 src/libstddjb/ipc_recv.c
create mode 100644 src/libstddjb/ipc_send.c
create mode 100644 src/libstddjb/ipc_stream.c
create mode 100644 src/libstddjb/ipc_timed_connect.c
create mode 100644 src/libstddjb/leapsecs_add.c
create mode 100644 src/libstddjb/leapsecs_here.c
create mode 100644 src/libstddjb/leapsecs_init.c
create mode 100644 src/libstddjb/leapsecs_sub.c
create mode 100644 src/libstddjb/localtm_fmt.c
create mode 100644 src/libstddjb/localtm_from_ltm64.c
create mode 100644 src/libstddjb/localtm_from_sysclock.c
create mode 100644 src/libstddjb/localtm_from_tai.c
create mode 100644 src/libstddjb/localtm_from_utc.c
create mode 100644 src/libstddjb/localtm_scan.c
create mode 100644 src/libstddjb/localtmn_fmt.c
create mode 100644 src/libstddjb/localtmn_from_sysclock.c
create mode 100644 src/libstddjb/localtmn_from_tain.c
create mode 100644 src/libstddjb/localtmn_scan.c
create mode 100644 src/libstddjb/lock_ex.c
create mode 100644 src/libstddjb/lock_exnb.c
create mode 100644 src/libstddjb/lock_sh.c
create mode 100644 src/libstddjb/lock_shnb.c
create mode 100644 src/libstddjb/lock_un.c
create mode 100644 src/libstddjb/lolprintf.c
create mode 100644 src/libstddjb/long_fmt.c
create mode 100644 src/libstddjb/long_scan.c
create mode 100644 src/libstddjb/ltm64_from_localtm.c
create mode 100644 src/libstddjb/ltm64_from_sysclock.c
create mode 100644 src/libstddjb/ltm64_from_tai.c
create mode 100644 src/libstddjb/ltm64_from_utc.c
create mode 100644 src/libstddjb/mininetstring_read.c
create mode 100644 src/libstddjb/mininetstring_write.c
create mode 100644 src/libstddjb/ndelay_off.c
create mode 100644 src/libstddjb/ndelay_on.c
create mode 100644 src/libstddjb/netstring_append.c
create mode 100644 src/libstddjb/netstring_appendv.c
create mode 100644 src/libstddjb/netstring_decode.c
create mode 100644 src/libstddjb/netstring_encode.c
create mode 100644 src/libstddjb/netstring_get.c
create mode 100644 src/libstddjb/netstring_put.c
create mode 100644 src/libstddjb/ntp_from_tain.c
create mode 100644 src/libstddjb/open2.c
create mode 100644 src/libstddjb/open3.c
create mode 100644 src/libstddjb/open_append.c
create mode 100644 src/libstddjb/open_create.c
create mode 100644 src/libstddjb/open_excl.c
create mode 100644 src/libstddjb/open_read.c
create mode 100644 src/libstddjb/open_readb.c
create mode 100644 src/libstddjb/open_trunc.c
create mode 100644 src/libstddjb/open_write.c
create mode 100644 src/libstddjb/openreadclose.c
create mode 100644 src/libstddjb/openreadfileclose.c
create mode 100644 src/libstddjb/openreadnclose.c
create mode 100644 src/libstddjb/openslurpclose.c
create mode 100644 src/libstddjb/openwritenclose_suffix.c
create mode 100644 src/libstddjb/openwritenclose_unsafe.c
create mode 100644 src/libstddjb/pathexec.c
create mode 100644 src/libstddjb/pathexec0.c
create mode 100644 src/libstddjb/pathexec0_run.c
create mode 100644 src/libstddjb/pathexec_fromenv.c
create mode 100644 src/libstddjb/pathexec_r.c
create mode 100644 src/libstddjb/pathexec_r_name.c
create mode 100644 src/libstddjb/pathexec_run.c
create mode 100644 src/libstddjb/pipe_internal.c
create mode 100644 src/libstddjb/prog.c
create mode 100644 src/libstddjb/prot.c
create mode 100644 src/libstddjb/prot_grps.c
create mode 100644 src/libstddjb/prot_readgroups.c
create mode 100644 src/libstddjb/realpath.c
create mode 100644 src/libstddjb/realpath_tmp.c
create mode 100644 src/libstddjb/rm_rf.c
create mode 100644 src/libstddjb/rm_rf_in_tmp.c
create mode 100644 src/libstddjb/rm_rf_tmp.c
create mode 100644 src/libstddjb/rmstar.c
create mode 100644 src/libstddjb/sabasename.c
create mode 100644 src/libstddjb/sadirname.c
create mode 100644 src/libstddjb/sagetcwd.c
create mode 100644 src/libstddjb/sagethostname.c
create mode 100644 src/libstddjb/sanitize_read.c
create mode 100644 src/libstddjb/sareadlink.c
create mode 100644 src/libstddjb/satmp.c
create mode 100644 src/libstddjb/sauniquename.c
create mode 100644 src/libstddjb/seek_cur.c
create mode 100644 src/libstddjb/seek_set.c
create mode 100644 src/libstddjb/selfpipe-internal.h
create mode 100644 src/libstddjb/selfpipe_finish.c
create mode 100644 src/libstddjb/selfpipe_init.c
create mode 100644 src/libstddjb/selfpipe_internal.c
create mode 100644 src/libstddjb/selfpipe_read.c
create mode 100644 src/libstddjb/selfpipe_trap.c
create mode 100644 src/libstddjb/selfpipe_trapset.c
create mode 100644 src/libstddjb/selfpipe_untrap.c
create mode 100644 src/libstddjb/sgetopt.c
create mode 100644 src/libstddjb/short_scan.c
create mode 100644 src/libstddjb/sig.c
create mode 100644 src/libstddjb/sig_block.c
create mode 100644 src/libstddjb/sig_blocknone.c
create mode 100644 src/libstddjb/sig_blockset.c
create mode 100644 src/libstddjb/sig_catch.c
create mode 100644 src/libstddjb/sig_pause.c
create mode 100644 src/libstddjb/sig_push.c
create mode 100644 src/libstddjb/sig_restoreto.c
create mode 100644 src/libstddjb/sig_shield.c
create mode 100644 src/libstddjb/sig_stack.c
create mode 100644 src/libstddjb/sig_unblock.c
create mode 100644 src/libstddjb/sig_unshield.c
create mode 100644 src/libstddjb/sigfpe.c
create mode 100644 src/libstddjb/sigsegv.c
create mode 100644 src/libstddjb/siovec_bytechr.c
create mode 100644 src/libstddjb/siovec_bytein.c
create mode 100644 src/libstddjb/siovec_deal.c
create mode 100644 src/libstddjb/siovec_from_iovec.c
create mode 100644 src/libstddjb/siovec_gather.c
create mode 100644 src/libstddjb/siovec_len.c
create mode 100644 src/libstddjb/siovec_scatter.c
create mode 100644 src/libstddjb/siovec_seek.c
create mode 100644 src/libstddjb/skagetln.c
create mode 100644 src/libstddjb/skagetlnsep.c
create mode 100644 src/libstddjb/skasig_dfl.c
create mode 100644 src/libstddjb/skasigaction.c
create mode 100644 src/libstddjb/slurp.c
create mode 100644 src/libstddjb/socket_accept4.c
create mode 100644 src/libstddjb/socket_accept4_u32.c
create mode 100644 src/libstddjb/socket_accept6.c
create mode 100644 src/libstddjb/socket_bind4.c
create mode 100644 src/libstddjb/socket_bind4r.c
create mode 100644 src/libstddjb/socket_bind6.c
create mode 100644 src/libstddjb/socket_bind6r.c
create mode 100644 src/libstddjb/socket_conn4.c
create mode 100644 src/libstddjb/socket_conn4_u32.c
create mode 100644 src/libstddjb/socket_conn6.c
create mode 100644 src/libstddjb/socket_connected.c
create mode 100644 src/libstddjb/socket_deadlineconnstamp4.c
create mode 100644 src/libstddjb/socket_deadlineconnstamp46.c
create mode 100644 src/libstddjb/socket_deadlineconnstamp4_u32.c
create mode 100644 src/libstddjb/socket_deadlineconnstamp6.c
create mode 100644 src/libstddjb/socket_delay.c
create mode 100644 src/libstddjb/socket_internal.c
create mode 100644 src/libstddjb/socket_ioloop.c
create mode 100644 src/libstddjb/socket_ioloop_send4.c
create mode 100644 src/libstddjb/socket_ioloop_send6.c
create mode 100644 src/libstddjb/socket_local4.c
create mode 100644 src/libstddjb/socket_local46.c
create mode 100644 src/libstddjb/socket_local6.c
create mode 100644 src/libstddjb/socket_recv4.c
create mode 100644 src/libstddjb/socket_recv6.c
create mode 100644 src/libstddjb/socket_remote4.c
create mode 100644 src/libstddjb/socket_remote46.c
create mode 100644 src/libstddjb/socket_remote6.c
create mode 100644 src/libstddjb/socket_send4.c
create mode 100644 src/libstddjb/socket_send6.c
create mode 100644 src/libstddjb/socket_tcp4.c
create mode 100644 src/libstddjb/socket_tcp6.c
create mode 100644 src/libstddjb/socket_timeoutconn.c
create mode 100644 src/libstddjb/socket_tryr.c
create mode 100644 src/libstddjb/socket_udp4.c
create mode 100644 src/libstddjb/socket_udp6.c
create mode 100644 src/libstddjb/socket_waitconn.c
create mode 100644 src/libstddjb/socketpair_internal.c
create mode 100644 src/libstddjb/stamp.c
create mode 100644 src/libstddjb/str_chr.c
create mode 100644 src/libstddjb/str_cpy.c
create mode 100644 src/libstddjb/str_diff.c
create mode 100644 src/libstddjb/str_diffn.c
create mode 100644 src/libstddjb/str_fmt.c
create mode 100644 src/libstddjb/str_len.c
create mode 100644 src/libstddjb/str_rchr.c
create mode 100644 src/libstddjb/str_start.c
create mode 100644 src/libstddjb/str_strn.c
create mode 100644 src/libstddjb/stralloc_append.c
create mode 100644 src/libstddjb/stralloc_catb.c
create mode 100644 src/libstddjb/stralloc_catv.c
create mode 100644 src/libstddjb/stralloc_copyb.c
create mode 100644 src/libstddjb/stralloc_free.c
create mode 100644 src/libstddjb/stralloc_insertb.c
create mode 100644 src/libstddjb/stralloc_ready_tuned.c
create mode 100644 src/libstddjb/stralloc_reverse.c
create mode 100644 src/libstddjb/stralloc_reverse_blocks.c
create mode 100644 src/libstddjb/stralloc_shrink.c
create mode 100644 src/libstddjb/stralloc_zero.c
create mode 100644 src/libstddjb/strerr.c
create mode 100644 src/libstddjb/strerr_sys.c
create mode 100644 src/libstddjb/string_format.c
create mode 100644 src/libstddjb/string_quote.c
create mode 100644 src/libstddjb/string_quote_nodelim.c
create mode 100644 src/libstddjb/string_quote_nodelim_mustquote.c
create mode 100644 src/libstddjb/string_unquote.c
create mode 100644 src/libstddjb/string_unquote_nodelim.c
create mode 100644 src/libstddjb/string_unquote_withdelim.c
create mode 100644 src/libstddjb/strn_fmt.c
create mode 100644 src/libstddjb/subgetopt.c
create mode 100644 src/libstddjb/subgetopt_here.c
create mode 100644 src/libstddjb/sysclock_from_localtm.c
create mode 100644 src/libstddjb/sysclock_from_localtmn.c
create mode 100644 src/libstddjb/sysclock_from_ltm64.c
create mode 100644 src/libstddjb/sysclock_from_tai.c
create mode 100644 src/libstddjb/sysclock_from_utc.c
create mode 100644 src/libstddjb/sysclock_get.c
create mode 100644 src/libstddjb/sysclock_set.c
create mode 100644 src/libstddjb/tai_add.c
create mode 100644 src/libstddjb/tai_from_localtm.c
create mode 100644 src/libstddjb/tai_from_ltm64.c
create mode 100644 src/libstddjb/tai_from_sysclock.c
create mode 100644 src/libstddjb/tai_from_timespec.c
create mode 100644 src/libstddjb/tai_from_timeval.c
create mode 100644 src/libstddjb/tai_from_utc.c
create mode 100644 src/libstddjb/tai_now.c
create mode 100644 src/libstddjb/tai_pack.c
create mode 100644 src/libstddjb/tai_pack_little.c
create mode 100644 src/libstddjb/tai_relative_from_timespec.c
create mode 100644 src/libstddjb/tai_relative_from_timeval.c
create mode 100644 src/libstddjb/tai_sub.c
create mode 100644 src/libstddjb/tai_unpack.c
create mode 100644 src/libstddjb/tai_unpack_little.c
create mode 100644 src/libstddjb/tain_add.c
create mode 100644 src/libstddjb/tain_addsec.c
create mode 100644 src/libstddjb/tain_approx.c
create mode 100644 src/libstddjb/tain_clockmon.c
create mode 100644 src/libstddjb/tain_fmt.c
create mode 100644 src/libstddjb/tain_frac.c
create mode 100644 src/libstddjb/tain_from_localtmn.c
create mode 100644 src/libstddjb/tain_from_millisecs.c
create mode 100644 src/libstddjb/tain_from_ntp.c
create mode 100644 src/libstddjb/tain_from_timespec.c
create mode 100644 src/libstddjb/tain_from_timeval.c
create mode 100644 src/libstddjb/tain_half.c
create mode 100644 src/libstddjb/tain_infinite_relative.c
create mode 100644 src/libstddjb/tain_less.c
create mode 100644 src/libstddjb/tain_nano500.c
create mode 100644 src/libstddjb/tain_now.c
create mode 100644 src/libstddjb/tain_pack.c
create mode 100644 src/libstddjb/tain_pack_little.c
create mode 100644 src/libstddjb/tain_relative_from_timespec.c
create mode 100644 src/libstddjb/tain_relative_from_timeval.c
create mode 100644 src/libstddjb/tain_scan.c
create mode 100644 src/libstddjb/tain_setnow.c
create mode 100644 src/libstddjb/tain_sub.c
create mode 100644 src/libstddjb/tain_sysclock.c
create mode 100644 src/libstddjb/tain_to_millisecs.c
create mode 100644 src/libstddjb/tain_ulong.c
create mode 100644 src/libstddjb/tain_unpack.c
create mode 100644 src/libstddjb/tain_unpack_little.c
create mode 100644 src/libstddjb/timespec_from_tai.c
create mode 100644 src/libstddjb/timespec_from_tai_relative.c
create mode 100644 src/libstddjb/timespec_from_tain.c
create mode 100644 src/libstddjb/timespec_from_tain_relative.c
create mode 100644 src/libstddjb/timestamp.c
create mode 100644 src/libstddjb/timestamp_fmt.c
create mode 100644 src/libstddjb/timestamp_r.c
create mode 100644 src/libstddjb/timestamp_scan.c
create mode 100644 src/libstddjb/timeval_from_tai.c
create mode 100644 src/libstddjb/timeval_from_tai_relative.c
create mode 100644 src/libstddjb/timeval_from_tain.c
create mode 100644 src/libstddjb/timeval_from_tain_relative.c
create mode 100644 src/libstddjb/ucharn_findlen.c
create mode 100644 src/libstddjb/ucharn_fmt.c
create mode 100644 src/libstddjb/ucharn_fmt_little.c
create mode 100644 src/libstddjb/ucharn_scan.c
create mode 100644 src/libstddjb/ucharn_scan_little.c
create mode 100644 src/libstddjb/ucspi_get.c
create mode 100644 src/libstddjb/uint160_scan.c
create mode 100644 src/libstddjb/uint16_fmtlist.c
create mode 100644 src/libstddjb/uint16_pack.c
create mode 100644 src/libstddjb/uint16_pack_big.c
create mode 100644 src/libstddjb/uint16_reverse.c
create mode 100644 src/libstddjb/uint16_scan.c
create mode 100644 src/libstddjb/uint16_scanlist.c
create mode 100644 src/libstddjb/uint16_unpack.c
create mode 100644 src/libstddjb/uint16_unpack_big.c
create mode 100644 src/libstddjb/uint320_scan.c
create mode 100644 src/libstddjb/uint32_fmtlist.c
create mode 100644 src/libstddjb/uint32_pack.c
create mode 100644 src/libstddjb/uint32_pack_big.c
create mode 100644 src/libstddjb/uint32_reverse.c
create mode 100644 src/libstddjb/uint32_scan.c
create mode 100644 src/libstddjb/uint32_scanlist.c
create mode 100644 src/libstddjb/uint32_unpack.c
create mode 100644 src/libstddjb/uint32_unpack_big.c
create mode 100644 src/libstddjb/uint640_fmt.c
create mode 100644 src/libstddjb/uint640_scan.c
create mode 100644 src/libstddjb/uint64_fmt.c
create mode 100644 src/libstddjb/uint64_fmtlist.c
create mode 100644 src/libstddjb/uint64_pack.c
create mode 100644 src/libstddjb/uint64_pack_big.c
create mode 100644 src/libstddjb/uint64_reverse.c
create mode 100644 src/libstddjb/uint64_scan.c
create mode 100644 src/libstddjb/uint64_scanlist.c
create mode 100644 src/libstddjb/uint64_unpack.c
create mode 100644 src/libstddjb/uint64_unpack_big.c
create mode 100644 src/libstddjb/uncoe.c
create mode 100644 src/libstddjb/unsanitize_read.c
create mode 100644 src/libstddjb/utc_from_localtm.c
create mode 100644 src/libstddjb/utc_from_ltm64.c
create mode 100644 src/libstddjb/utc_from_sysclock.c
create mode 100644 src/libstddjb/utc_from_tai.c
create mode 100644 src/libstddjb/vbaprintf.c
create mode 100644 src/libstddjb/vbprintf.c
create mode 100644 src/libstddjb/wait_nointr.c
create mode 100644 src/libstddjb/wait_pid_nohang.c
create mode 100644 src/libstddjb/wait_pids_nohang.c
create mode 100644 src/libstddjb/wait_reap.c
create mode 100644 src/libstddjb/waitn.c
create mode 100644 src/libstddjb/waitn_reap.c
create mode 100644 src/libstddjb/waitpid_nointr.c
create mode 100644 src/libunixonacid/bufalloc_timed_flush.c
create mode 100644 src/libunixonacid/buffer_timed_fill.c
create mode 100644 src/libunixonacid/buffer_timed_flush.c
create mode 100644 src/libunixonacid/buffer_timed_get.c
create mode 100644 src/libunixonacid/dd_cancel.c
create mode 100644 src/libunixonacid/dd_close.c
create mode 100644 src/libunixonacid/dd_commit.c
create mode 100644 src/libunixonacid/dd_commit_devino.c
create mode 100644 src/libunixonacid/dd_open_read.c
create mode 100644 src/libunixonacid/dd_open_write.c
create mode 100644 src/libunixonacid/kolbak_call.c
create mode 100644 src/libunixonacid/kolbak_enqueue.c
create mode 100644 src/libunixonacid/kolbak_queue_init.c
create mode 100644 src/libunixonacid/kolbak_unenqueue.c
create mode 100644 src/libunixonacid/mkdir_unique.c
create mode 100644 src/libunixonacid/netstring_timed_get.c
create mode 100644 src/libunixonacid/open2_at.c
create mode 100644 src/libunixonacid/open3_at.c
create mode 100644 src/libunixonacid/open_appendat.c
create mode 100644 src/libunixonacid/open_appendatb.c
create mode 100644 src/libunixonacid/open_readat.c
create mode 100644 src/libunixonacid/open_readatb.c
create mode 100644 src/libunixonacid/open_truncat.c
create mode 100644 src/libunixonacid/open_truncatb.c
create mode 100644 src/libunixonacid/open_writeat.c
create mode 100644 src/libunixonacid/open_writeatb.c
create mode 100644 src/libunixonacid/opengetlnclose.c
create mode 100644 src/libunixonacid/opengetlnclose_at.c
create mode 100644 src/libunixonacid/openreadnclose_at.c
create mode 100644 src/libunixonacid/openslurpclose_at.c
create mode 100644 src/libunixonacid/openwritenclose.c
create mode 100644 src/libunixonacid/openwritenclose_at.c
create mode 100644 src/libunixonacid/openwritenclose_devino.c
create mode 100644 src/libunixonacid/openwritenclose_devino_tmp.c
create mode 100644 src/libunixonacid/openwritenclose_tmp.c
create mode 100644 src/libunixonacid/skaclient-internal.h
create mode 100644 src/libunixonacid/skaclient_default_cb.c
create mode 100644 src/libunixonacid/skaclient_end.c
create mode 100644 src/libunixonacid/skaclient_init.c
create mode 100644 src/libunixonacid/skaclient_put.c
create mode 100644 src/libunixonacid/skaclient_putmsg.c
create mode 100644 src/libunixonacid/skaclient_putmsgv.c
create mode 100644 src/libunixonacid/skaclient_putv.c
create mode 100644 src/libunixonacid/skaclient_send.c
create mode 100644 src/libunixonacid/skaclient_sendmsg.c
create mode 100644 src/libunixonacid/skaclient_sendmsgv.c
create mode 100644 src/libunixonacid/skaclient_sendv.c
create mode 100644 src/libunixonacid/skaclient_server_ack.c
create mode 100644 src/libunixonacid/skaclient_server_bidi_ack.c
create mode 100644 src/libunixonacid/skaclient_server_init.c
create mode 100644 src/libunixonacid/skaclient_start.c
create mode 100644 src/libunixonacid/skaclient_start_async.c
create mode 100644 src/libunixonacid/skaclient_start_cb.c
create mode 100644 src/libunixonacid/skaclient_startf.c
create mode 100644 src/libunixonacid/skaclient_startf_async.c
create mode 100644 src/libunixonacid/skaclient_zero.c
create mode 100644 src/libunixonacid/timed_flush.c
create mode 100644 src/libunixonacid/timed_get.c
create mode 100644 src/libunixonacid/timed_getln.c
create mode 100644 src/libunixonacid/timed_getlnmax.c
create mode 100644 src/libunixonacid/unixmessage_bits_closeall.c
create mode 100644 src/libunixonacid/unixmessage_bits_closenone.c
create mode 100644 src/libunixonacid/unixmessage_handle.c
create mode 100644 src/libunixonacid/unixmessage_put.c
create mode 100644 src/libunixonacid/unixmessage_read.c
create mode 100644 src/libunixonacid/unixmessage_receive.c
create mode 100644 src/libunixonacid/unixmessage_receiver_free.c
create mode 100644 src/libunixonacid/unixmessage_receiver_init.c
create mode 100644 src/libunixonacid/unixmessage_sender_flush.c
create mode 100644 src/libunixonacid/unixmessage_sender_free.c
create mode 100644 src/libunixonacid/unixmessage_sender_getfd.c
create mode 100644 src/libunixonacid/unixmessage_sender_init.c
create mode 100644 src/libunixonacid/unixmessage_sender_timed_flush.c
create mode 100644 src/libunixonacid/unixmessage_sender_zero.c
create mode 100644 src/libunixonacid/unixmessage_timed_handle.c
create mode 100644 src/libunixonacid/unixmessage_timed_receive.c
create mode 100644 src/libunixonacid/unixmessage_v_zero.c
create mode 100644 src/libunixonacid/unixmessage_zero.c
create mode 100644 src/sysdeps/tryaccept4.c
create mode 100644 src/sysdeps/tryancilautoclose.c
create mode 100644 src/sysdeps/tryclockmon.c
create mode 100644 src/sysdeps/tryclockrt.c
create mode 100644 src/sysdeps/trycmsgcloexec.c
create mode 100644 src/sysdeps/trydevrandom.c
create mode 100644 src/sysdeps/trydevurandom.c
create mode 100644 src/sysdeps/tryendianness.c
create mode 100644 src/sysdeps/tryeproto.c
create mode 100644 src/sysdeps/tryeventfd.c
create mode 100644 src/sysdeps/tryflock.c
create mode 100644 src/sysdeps/trygetpeereid.c
create mode 100644 src/sysdeps/trygetpeerucred.c
create mode 100644 src/sysdeps/tryipv6.c
create mode 100644 src/sysdeps/trylinkat.c
create mode 100644 src/sysdeps/trylsock.c
create mode 100644 src/sysdeps/trymalloc0.c
create mode 100644 src/sysdeps/tryopenat.c
create mode 100644 src/sysdeps/trypipe2.c
create mode 100644 src/sysdeps/tryposixspawn.c
create mode 100644 src/sysdeps/tryppoll.c
create mode 100644 src/sysdeps/tryrevoke.c
create mode 100644 src/sysdeps/trysendfile.c
create mode 100644 src/sysdeps/trysetgroups.c
create mode 100644 src/sysdeps/trysettimeofday.c
create mode 100644 src/sysdeps/trysignalfd.c
create mode 100644 src/sysdeps/trysizeofgid.c
create mode 100644 src/sysdeps/trysizeoftime.c
create mode 100644 src/sysdeps/trysizeofuint.c
create mode 100644 src/sysdeps/trysizeofulong.c
create mode 100644 src/sysdeps/trysizeofushort.c
create mode 100644 src/sysdeps/trysopeercred.c
create mode 100644 src/sysdeps/trysplice.c
create mode 100644 src/sysdeps/trystrcasestr.c
create mode 100644 src/sysdeps/tryuint64t.c
create mode 100755 tools/gen-deps.sh
create mode 100755 tools/install.sh
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5c6415e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+*.o
+*.a
+*.lo
+*.so
+*.so.*
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..3f51fd7
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,21 @@
+Main author:
+ Laurent Bercot
+
+Contributors:
+ Dan J. Bernstein
+ William E. Baxter
+
+Thanks to:
+ Jean Marot
+ Paul Jarc
+ Nicolas George
+ David Madore
+ Taj Khattra
+ Dan Kegel
+ Stefan Karrmann
+ Matthew R. Dempsky
+ Lasse Kliemann
+ Robert Ransom
+ Frans Haarman
+ Vincent De Ribou
+ Jorge Almeida
diff --git a/CHANGES b/CHANGES
new file mode 100644
index 0000000..e99420b
--- /dev/null
+++ b/CHANGES
@@ -0,0 +1,260 @@
+20110628
+ version: 1.0.0
+20110630
+ doc: in libstddjb/index.html, corrected strerr.h -> webipc.h
+ bug: when not HASSIGNALFD, selfpipe_trap.c and selfpipe_untrap.c did not compile
+ fix: change "i" to "sig". Silly me.
+ version: 1.0.1
+20110705
+ bug: wrong test for "after" banner in skaclient2_startf.c
+ fix: test readbanner() < afterlen
+ version: 1.0.2
+20110711
+ bug: sig_restoreto.o wasn't in deps-lib/stddjb
+ fix: add it
+ portability: some OSes have an off-by-one NSIG (65).
+ fix: don't rely on NSIG, always test whether sigismember() < 0
+ in the future: consider making SKALIBS_NSIG a sysdep
+ internal: removed sig_nostack, made sig_catcha and sig_restore macros.
+ version: 1.0.3
+20110712
+ bug: localtmn_scan didn't scan the nano part properly
+ fix: change *s to *s++
+ version: 1.0.4
+20110718
+ code: changed short_scan, int_scan and long_scan behaviour according
+ to prj's advice
+ build: changed internal targets to mode 755 instead of 555
+ ui: gensetdyn_p sets errno when returning NULL
+ bug: genset_new() didn't set the newly allocated bit
+ fix: trivial
+ bug: static initialization of gensetb and avltreeb didn't work
+ fix: impossible to make them work in all cases -> scrap the API
+ workaround: declare them statically, but init them dynamically
+ ui: changed uintcmpfunc_t to accept a callback argument
+ modified avlnode/avltree(n) in consequence
+ ui: changed gensetdyn_new() and avltree_newnode() interfaces
+ bug: avlnode_insert and avlnode_delete() didn't work in all cases
+ fix: went over the logic again, added missing logic (subspin...)
+ version: 1.1.0
+20110726
+ bug: avltree_newnode() segfaulted in some cases
+ fix: don't deref before the gensetdyn_new, duh.
+ version: 1.1.1
+20110815
+ ui: clarified avlnode, avltree and avltreen interfaces
+ version: 1.2.0
+20110820
+ ui: added lolstdio.h
+ doc: documented lolstdio.h
+20110822
+ version: 1.2.1
+20110906
+ bug: absolutepath sometimes added a stray '\0'
+ fix: adjust tmp length when exiting the loop
+ internal: exposed buffer_0/1/2 objects; buffer_0/1/2 now is a macro
+ code: added genwrite
+ doc: documented genwrite
+20110915
+ internal: separated genwrite write into put and flush, added bufalloc handles
+ doc: reflected changes
+ internal: changed EINVAL to EOVERFLOW when localtm_from_ltm64() finds a date > 32 bits
+ todo: 2038 is fast approaching, we need to push for tai64 adoption
+20110919
+ version: 1.2.2
+20110929
+ ui: changed openwritenclose_unsafe* and openwritenclose_suffix* to macros
+ ui: changed socket_accept4* to macros, same thing
+ ui: changed ipc_accept* to macros, same thing
+ ui: added more macros in tai.h to help with static init
+ version: 1.2.3
+20111108
+ bug: TAI_INFINITE was incorrectly defined
+ fix: trivial
+ bug: potential security hole in stralloc_ready_tuned
+ fix: check for uint overflows
+20111207
+ internal: reworked nbcoe to accommodate new Linux socket() options
+ ui: socket_* and ipc_* are now often macros
+20111208
+ version: 1.2.4
+20120206
+ bug: missing const in taia_clockmon() stub definition when !HASCLOCKMON
+ fix: trivial
+20120213
+ internal: changed all bools from unsigned char to int
+ ui: some APIs are affected by the unsigned char to int change
+20120220
+ version: 1.2.5
+20120310
+ code: added options to envdir(), renamed it envdir_internal()
+ ui: envdir() is now a macro, for compatibility
+ version: 1.2.6
+20120311
+ data: updated leapsecs.dat to include the 2012-06-30 leap second
+20120312
+ bug: some sysdeps tested libc behaviour instead of kernel behaviour
+ impact: some kernel/libc combinations would get the wrong sysdeps
+ fix: added more run tests instead of relying on load tests
+ version: 1.2.7
+20120518
+ ui: changed skagetlnsep to handle non-empty target strallocs
+ (used in execline-1.1.5's forbacktickx)
+20120527
+ bug: off-by-10 TAI values with some libcs
+ fix: tai_unix() is now sysclock-agnostic
+20120606
+ bug: splice() (in iobufferk) sometimes blocks
+ fix: add non-blocking handling in iobufferk and SPLICE_F_NONBLOCK
+ also fixed include files order for proper _GNU_SOURCE scope
+ portability: no HASOPENAT detection with newer glibcs
+ fix: change _ATFILE_SOURCE to _GNU_SOURCE, modify tryopenat.c
+20120612
+ version: 1.2.8
+20120712
+ code: added ipv6 sysdep
+20120818
+ code: added ipv6 fmt, scan and socket functions
+20120824
+ code: added ip6_scanlist, changed ip4_scanlist API
+20120827
+ code: added support for flag-noipv6 and flag-forcedevr
+20120905
+ ui: simplified libancillary UI by autoallocating buffers
+20121015
+ portability: some libcs still mess up basename and dirname prototypes
+ fix: forget trying to write "standard" (oh the irony) stuff,
+ just get rid of basename.o, dirname.o and realpath.o in libstddjb.
+ code: added ip46 lesser evil
+20121215
+ bug: strerr_warn functions didn't preserve errno
+ fix: obvious
+20121218
+ internal: renamed strerr_die.c to strerr.c
+20121231
+ ui: added STAMP global and _g macros to timed functions
+ ui: marked non-STAMP-compatible functions as deprecated
+ ui: marked dns_random* as deprecated
+20130103
+ portability: added support for uint64_t
+ ui: rewrote libbiguint UI for arbitrary size handling.
+ (Still no heap. Heap is for noobs.)
+20130111
+ bug: stralloc_cat and stralloc_copy were incorrectly defined
+ fix: obvious
+20130124
+ build: added non-slashpackage support
+ doc: added rants about the change
+20130206
+ ui: defined PROG global in libstddjb
+20130212
+ version: 1.3.0
+20130320
+ code: added freelist
+ code: changed genset(dyn) bits from bitarray to freelist
+ impact: more space taken, but adding a new cell is now
+ amortized O(1) instead of O(n).
+20130403
+ code: added ip46_scanlist and a bit more ip46 stuff
+ bug: ip6_fmt didn't collapse trailing 0s
+ fix: add final iszero test in find_colcol
+20130413
+ bug: alloc() was incorrectly defined as gccattr_malloc
+ impact: could leak 0-sized cells (yeah...)
+ fix: remove the attribute
+ ui: made alloc_re a macro
+20130415
+ ui: removed unused SKACLIENT_BANNER_MAXLEN macro
+ internal: increased SKACLIENTIN_BUFSIZE to 4096
+20130422
+ internal: used sin_addr.s_addr instead of s_addr in socket_*
+ ui: removed deprecated socket_deadlineconn()
+20130709
+ ui: removed socket_ipoptionskill()
+ rationale: IP_OPTIONS is not POSIX and the value isn't
+ even proto-standardized - it's not 1 anymore on Linux
+ code: more stuff in ip46.h
+20130710
+ ui: removed pflocal.h
+ ui: added nonposix.h
+ internal: cleaned up ipc_* and socket_*
+ licensing: cleaned up a lot of legacy "public domain" in sysdeps
+20130711
+ internal: gathered most portability problems into nonposix.h
+20130912
+ internal: reworked scan architecture to avoid uint64 pointers
+ ui: added ushort.h, uint.h, ulong.h
+ ui: removed deprecated stuff in fmtscan.h and librandom
+ internal: cleaned up legacy code relying on it
+ internal: /dev/(u)random is now bufferized
+ internal: rrandom_readint now only reads the necessary amount
+20130913
+ ui: removed deprecated deepsleep and deepmillisleep
+ ui: changed taia's nano and atto to uint32
+20130918
+ doc: pretended to add stralloc and genalloc pages
+20130926
+ version: 1.4.0
+20130927
+ bug: ulong-64 defined UINT_* instead of ULONG_*
+ fix: trivial
+ version: 1.4.1
+20131003
+ code: added siovec and its uses in stralloc/netstring/skaclient
+20131012
+ bug: ip46_t instead of ip46full_t in ip46_scanlist.c
+ fix: trivial
+20131019
+ version: 1.4.2
+20140214
+ doc: minor fixes
+ code: added kolbak and skaclient4
+20140301
+ code: added skaclient3 and needed infrastructure
+ internal: ancil sandwich protocol changed to pass # of fds in before
+20140322
+ bug: typos in bitarray_clearsetn
+ impact: freelist-based iterators failed
+ fix: trivial
+ internal: scrapped complex byte optimizations in freelist. unsigned ints ftw.
+ ui: removed freelist.h
+ version: 1.5.0
+20140327
+ bug: sysdeps.h missing in sysdeps/ - important for crosscompilation
+ fix: meh. It belongs in include/. Quick and dirty fix: added a copy
+ to sysdeps/ with a line in package/sysdeps.
+ version: 1.5.1
+20140409
+ portability: MacOSX echo doesn't support -n.
+ fix: replace echo -n with echo | tr -d '\n'.
+ build: moved to 4-number versioning
+20140413
+ ui: better avltree API
+20140429
+ code: added correct supplementary group management in prot
+ ui: prot_gid() and prot_uid() are now macros
+20140430
+ doc: updated
+20140503
+ internal: cleaned up sysdeps usage in exported headers
+ ui: added setgroups.h, gidstuff.h, and *_fmtlist/scanlist
+ ui: sysdeps.h removed from stddjb.h
+20140504
+ ui: timed_ancil_* now reports actual # of fds sent/received
+20140506
+ internal: netstring_get cleanup
+ ui: made buffer_getall and netstring_get interfaces more consistent
+ internal: this impacts skaclient2+
+ ui: added timed_netstring_get
+20140508
+ internal: better timeout rounding for poll()
+ ui: added ppoll sysdep
+ internal: added ppoll() iopause backend
+20140514
+ internal: made time*_from_tai_relative work with IA-32
+ version: 1.6.0.0
+20140515
+ portability: getpeereid uses unsigned types on MacOS X
+ fix: change getpeereid signature to use uid_t and gid_t
+20140612
+ build: fixed libexec installation
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..63309ba
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,13 @@
+Copyright (c) 2011-2014 Laurent Bercot
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..efa5596
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,139 @@
+Build Instructions
+------------------
+
+* Requirements
+ ------------
+
+ - A POSIX-compliant C development environment
+ - GNU make version 3.81 or later
+ - If cross-compiling: the sysdeps for your target architecture
+ (see the "Cross-compilation" section below)
+
+ This software will install on any operating system that implements
+POSIX.1-2008, available at:
+ http://pubs.opengroup.org/onlinepubs/9699919799/
+
+
+* Standard usage
+ --------------
+
+ ./configure && make && sudo make install
+
+ will work for most users.
+ It will install the static libraries in /usr/lib/skalibs, the shared
+libraries in /lib, and the sysdeps in /usr/lib/skalibs/sysdeps.
+
+ You can strip the libraries of their extra symbols via "make strip"
+before the "make install" phase. It will shave a few bytes off them.
+
+
+* Customization
+ -------------
+
+ You can customize paths via flags given to configure.
+ See ./configure --help for a list of all available configure options.
+
+
+
+* Environment variables
+ ---------------------
+
+ Controlling a build process via environment variables is a big and
+dangerous hammer. You should try and pass flags to configure instead;
+nevertheless, the standard environment variables are recognized.
+
+ The value of the CROSS_COMPILE environment variable will prefix the
+building tools' names. The --enable-cross option is preferred, see
+"Cross-compilation" below.
+
+ If the CC environment variable is set, its value will override compiler
+detection by configure.
+
+ The values of CFLAGS, CPPFLAGS and LDFLAGS will be appended to flags
+auto-detected by configure. To entirely override the flags set by
+configure, use make -e.
+
+ The Makefile supports the DESTDIR convention for staging.
+
+
+* Shared libraries
+ ----------------
+
+ Software from skarnet.org is small enough that shared libraries are
+generally not worth using. Static linking is simpler and incurs less
+runtime overhead and less points of failure: but since skalibs only
+provides libraries, both versions are built by default.
+ Nevertheless, you can:
+ * avoid building shared libraries: --disable-shared
+ * avoid building static libraries: --disable-static
+
+ If you are using a GNU/Linux system, be aware that the GNU libc
+behaves badly with static linking and produces huge executables,
+so if you plan on making static executables, you should consider
+using another libc, which you also need to use when compiling
+skalibs. musl is recommended: http://musl-libc.org/
+
+
+* Cross-compilation
+ -----------------
+
+ skarnet.org centralizes all the difficulty of cross-compilation
+in skalibs.
+ The native skalibs build process runs some tests to gather "sysdeps",
+i.e. system-dependent properties of the target, and stores those
+into a sysdeps directory; software depending on skalibs is provided
+the name of the sysdeps directory at build time, and can depend on
+its contents - that's how skarnet.org packages are easily made
+portable.
+ However, when the host differs from the target - the cross-compilation
+case - those build-time tests are invalid. So you must provide
+configure with a precomputed sysdeps directory, containing valid
+sysdeps values for your target.
+
+ Use the --with-sysdeps=DIR option to specify DIR as a sysdeps
+directory for your target. Also use the --enable-cross=PREFIX option
+to specify a cross-compiling PREFIX for your toolchain's binaries,
+or simply --enable-cross if your default toolchain is a cross-compiler.
+
+ If you know the peculiarities of your target system, you can build
+a sysdeps directory by hand. However, a much easier, and recommended,
+method of obtaining sysdeps, is to natively determine them (via
+./configure) in a virtual machine, for instance provided by qemu. If you
+are using Linux, simple root filesystems bootable with qemu for testing
+purposes are available at Aboriginal Linux: http://landley.net/aboriginal/
+ Precomputed sysdeps for various targets may also be available on
+skarnet.org or on third-party sites.
+
+
+* The slashpackage convention
+ ---------------------------
+
+ The slashpackage convention (http://cr.yp.to/slashpackage.html)
+is a package installation scheme that provides a few guarantees
+over other conventions such as the FHS, for instance fixed
+absolute pathnames. skarnet.org packages support it: use the
+--enable-slashpackage option to configure, or
+--enable-slashpackage=DIR for a prefixed DIR/package tree.
+This option will activate slashpackage support during the build
+and set slashpackage-compatible installation directories.
+Other options setting individual installation directories will be
+ignored.
+
+ When using slashpackage, two additional Makefile targets are
+available after "make install":
+ - "make -L update" changes the default version of the software to the
+freshly installed one. (This is useful when you have several installed
+versions of the same software, which slashpackage supports.)
+ - "make -L global-links" adds links from /command and /library.so to the
+default version of the binaries and shared libraries.
+ The "-L" option to make is necessary because targets are symbolic links,
+and the default make behaviour is to check the pointed file's timestamp
+and not the symlink's timestamp.
+
+
+* Out-of-tree builds
+ ------------------
+
+ skarnet.org packages do not support out-of-tree builds. They
+are small, so it does not cost much to duplicate the entire
+source tree if parallel builds are needed.
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0f56c1c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,236 @@
+#
+# This Makefile requires GNU make.
+#
+# Do not make changes here.
+# Use the included .mak files.
+#
+
+it: all
+
+CC = $(error Please use ./configure first)
+
+SHARED_LIBS := libskarnet.so
+STATIC_LIBS := libskarnet.a
+
+include package/deps.mak
+-include config.mak
+
+version_m := $(basename $(version))
+version_M := $(basename $(version_m))
+version_l := $(basename $(version_M))
+CPPFLAGS_ALL := -Isrc/include $(CPPFLAGS)
+CFLAGS_ALL := $(CFLAGS) -pipe -Wall
+CFLAGS_SHARED := -fPIC
+LDFLAGS_ALL := $(LDFLAGS)
+LDFLAGS_SHARED := -shared
+LDLIBS_ALL := $(LDLIBS)
+REALCC = $(CROSS_COMPILE)$(CC)
+AR := $(CROSS_COMPILE)ar
+RANLIB := $(CROSS_COMPILE)ranlib
+STRIP := $(CROSS_COMPILE)strip
+INSTALL := ./tools/install.sh
+
+ALL_SRCS := $(wildcard src/lib*/*.c)
+ALL_SOBJS := $(ALL_SRCS:%.c=%.o)
+ALL_DOBJS := $(ALL_SRCS:%.c=%.lo)
+ALL_LIBS := $(SHARED_LIBS) $(STATIC_LIBS)
+ALL_INCLUDES := $(wildcard src/include/$(package)/*.h)
+BUILT_INCLUDES := \
+src/include/$(package)/sysdeps.h \
+src/include/$(package)/uint16.h \
+src/include/$(package)/uint32.h \
+src/include/$(package)/uint64.h \
+src/include/$(package)/ushort.h \
+src/include/$(package)/uint.h \
+src/include/$(package)/ulong.h \
+src/include/$(package)/error.h \
+src/include/$(package)/gidstuff.h \
+src/include/$(package)/ip46.h \
+src/include/$(package)/setgroups.h
+ALL_SYSDEPS := $(wildcard $(sysdeps)/*)
+ALL_DATA := $(wildcard src/etc/*)
+
+all: $(ALL_LIBS) $(ALL_INCLUDES) $(ALL_SYSDEPS) $(ALL_DATA)
+
+clean:
+ @exec rm -f $(ALL_LIBS) $(ALL_BINS) $(ALL_SOBJS) $(ALL_DOBJS) $(BUILT_INCLUDES)
+
+distclean: clean
+ @exec rm -rf config.mak src/include/${package}/config.h sysdeps.cfg
+
+tgz: distclean
+ @. package/info && \
+ rm -rf /tmp/$$package-$$version && \
+ cp -a . /tmp/$$package-$$version && \
+ cd /tmp && \
+ tar -zpcv --owner=0 --group=0 --numeric-owner -f /tmp/$$package-$$version.tar.gz $$package-$$version && \
+ exec rm -rf /tmp/$$package-$$version
+
+strip: $(ALL_LIBS)
+ exec ${STRIP} -x -R .note -R .comment -R .note.GNU-stack $(ALL_LIBS)
+
+install: install-data install-sysdeps install-dynlib install-lib install-include
+install-data: $(ALL_DATA:src/etc/%=$(DESTDIR)$(datadir)/%)
+install-sysdeps: $(ALL_SYSDEPS:$(sysdeps)/%=$(DESTDIR)$(sysdepdir)/%)
+install-dynlib: $(SHARED_LIBS:lib%.so=$(DESTDIR)$(dynlibdir)/lib%.so)
+install-lib: $(STATIC_LIBS:lib%.a=$(DESTDIR)$(libdir)/lib%.a)
+install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h)
+
+ifneq ($(exthome),)
+
+update:
+ exec $(INSTALL) -l $(notdir $(home)) $(DESTDIR)$(exthome)
+
+global-links: $(DESTDIR)$(exthome) $(SHARED_LIBS:lib%.so=$(DESTDIR)$(sproot)/library.so/lib%.so)
+
+$(DESTDIR)$(sproot)/library.so/lib%.so: $(DESTDIR)$(home)/library.so/lib%.so
+ exec $(INSTALL) -D -l ..$(exthome)/library.so/$( $@
+
+src/include/${package}/uint16.h: src/include/${package}/uint64.h $(sysdeps)/sysdeps src/headers/uint16-header src/headers/uint16-footer src/headers/uint16-lendian src/headers/uint16-bendian
+ @{ \
+ cat src/headers/uint16-header ; \
+ if grep -qF 'endianness: little' $(sysdeps)/sysdeps ; then cat src/headers/uint16-lendian ; \
+ elif grep -qF 'endianness: big' $(sysdeps)/sysdeps ; then cat src/headers/uint16-bendian ; \
+ else echo 'Error ! Unsupported endianness' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/uint16-footer ; \
+ } > $@
+
+src/include/${package}/uint32.h: src/include/${package}/uint64.h $(sysdeps)/sysdeps src/headers/uint32-header src/headers/uint32-footer src/headers/uint32-lendian src/headers/uint32-bendian
+ @{ \
+ cat src/headers/uint32-header ; \
+ if grep -qF 'endianness: little' $(sysdeps)/sysdeps ; then cat src/headers/uint32-lendian ; \
+ elif grep -qF 'endianness: big' $(sysdeps)/sysdeps ; then cat src/headers/uint32-bendian ; \
+ else echo 'Error ! Unsupported endianness' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/uint32-footer ; \
+ } > $@
+
+src/include/${package}/uint64.h: $(sysdeps)/sysdeps src/headers/uint64-header src/headers/uint64-footer src/headers/uint64-ulong64 src/headers/uint64-noulong64 src/headers/uint64-lendian src/headers/uint64-bendian
+ @{ \
+ cat src/headers/uint64-header ; \
+ if grep -qF 'uint64t: yes' $(sysdeps)/sysdeps ; then cat src/headers/uint64-stdinth ; \
+ elif grep -qF 'sizeofulong: 8' $(sysdeps)/sysdeps ; then cat src/headers/uint64-ulong64 ; \
+ else cat uint64-noulong64 ; \
+ fi ; \
+ if grep -qF 'endianness: little' $(sysdeps)/sysdeps ; then cat src/headers/uint64-lendian ; \
+ elif grep -qF 'endianness: big' $(sysdeps)/sysdeps ; then cat src/headers/uint64-bendian ; \
+ else echo 'Error ! Unsupported endianness' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/uint64-footer ; \
+ } > $@
+
+src/include/${package}/ushort.h: src/include/${package}/uint16.h src/include/${package}/uint32.h $(sysdeps)/sysdeps src/headers/ushort-header src/headers/ushort-footer src/headers/ushort-16 src/headers/ushort-32
+ @{ \
+ cat src/headers/ushort-header ; \
+ if grep -qF 'sizeofushort: 2' $(sysdeps)/sysdeps ; then cat src/headers/ushort-16 ; \
+ elif grep -qF 'sizeofushort: 4' $(sysdeps)/sysdeps ; then cat src/headers/ushort-32 ; \
+ else echo 'Error ! Unsupported unsigned short size' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/ushort-footer ; \
+ } > $@
+
+src/include/${package}/uint.h: src/include/${package}/uint16.h src/include/${package}/uint32.h src/include/${package}/uint64.h $(sysdeps)/sysdeps src/headers/uint-header src/headers/uint-footer src/headers/uint-16 src/headers/uint-32 src/headers/uint-64
+ @{ \
+ cat src/headers/uint-header ; \
+ if grep -qF 'sizeofuint: 2' $(sysdeps)/sysdeps ; then cat src/headers/uint-16 ; \
+ elif grep -qF 'sizeofuint: 4' $(sysdeps)/sysdeps ; then cat src/headers/uint-32 ; \
+ elif grep -qF 'sizeofuint: 8' $(sysdeps)/sysdeps ; then cat src/headers/uint-64 ; \
+ else echo 'Error ! Unsupported unsigned int size' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/uint-footer ; \
+ } > $@
+
+src/include/${package}/ulong.h: src/include/${package}/uint32.h src/include/${package}/uint64.h $(sysdeps)/sysdeps src/headers/ulong-header src/headers/ulong-footer src/headers/ulong-32 src/headers/ulong-64
+ @{ \
+ cat src/headers/ulong-header ; \
+ if grep -qF 'sizeofulong: 4' $(sysdeps)/sysdeps ; then cat src/headers/ulong-32 ; \
+ elif grep -qF 'sizeofulong: 8' $(sysdeps)/sysdeps ; then cat src/headers/ulong-64 ; \
+ else echo 'Error ! Unsupported unsigned long size' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/ulong-footer ; \
+ } > $@
+
+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}/gidstuff.h: src/include/${package}/uint16.h src/include/${package}/uint32.h src/include/${package}/uint64.h $(sysdeps)/sysdeps src/headers/gidstuff-header src/headers/gidstuff-footer src/headers/gidstuff-16 src/headers/gidstuff-32 src/headers/gidstuff-64
+ @{ \
+ cat src/headers/gidstuff-header ; \
+ if grep -qF 'sizeofgid: 2' $(sysdeps)/sysdeps ; then cat src/headers/gidstuff-16 ; \
+ elif grep -qF 'sizeofgid: 4' $(sysdeps)/sysdeps ; then cat src/headers/gidstuff-32 ; \
+ elif grep -qF 'sizeofgid: 8' $(sysdeps)/sysdeps ; then cat src/headers/gidstuff-64 ; \
+ else echo 'Error ! Unsupported gid_t size' 1>&2 ; ./crash ; \
+ fi ; \
+ exec cat src/headers/gidstuff-footer ; \
+ } > $@
+
+src/include/${package}/ip46.h: src/include/${package}/uint16.h src/include/${package}/bytestr.h src/include/${package}/fmtscan.h src/include/${package}/tai.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 ; \
+ if $(ipv6) && grep -qF 'ipv6: yes' $(sysdeps)/sysdeps ; then cat src/headers/ip46-with ; \
+ else cat src/headers/ip46-without ; \
+ fi ; \
+ exec cat src/headers/ip46-footer ; \
+ } > $@
+
+src/include/${package}/setgroups.h: $(sysdeps)/sysdeps src/headers/setgroups-header src/headers/setgroups-footer src/headers/setgroups-stub
+ @{ \
+ cat src/headers/setgroups-header ; \
+ if grep -qF 'setgroups: yes' $(sysdeps)/sysdeps ; then : ; \
+ else cat src/headers/setgroups-stub ; \
+ fi ; \
+ exec cat src/headers/setgroups-footer ; \
+ } > $@
diff --git a/README b/README
new file mode 100644
index 0000000..dd98719
--- /dev/null
+++ b/README
@@ -0,0 +1,26 @@
+skalibs - a general-purpose low-level C library
+-----------------------------------------------
+
+ skalibs is a C library used by all the skarnet.org packages.
+It provides APIs more suited to secure and efficient system
+programming than the libc, especially where network programming
+and IPCs are concerned.
+
+ See the enclosed doc/ subdirectory for the documentation, or
+ http://skarnet.org/software/skalibs/
+
+
+* Installation
+ ------------
+
+ See the INSTALL file.
+
+
+* Contact information
+ -------------------
+
+ Laurent Bercot
+
+ Please use the mailing-list for
+questions about skalibs.
+
diff --git a/README.macosx b/README.macosx
new file mode 100644
index 0000000..f7ee000
--- /dev/null
+++ b/README.macosx
@@ -0,0 +1,4 @@
+
+ This package will compile on Darwin (MacOS X), but the building of
+shared libraries is not supported.
+ Make sure you use the --disable-shared option to configure.
diff --git a/README.solaris b/README.solaris
new file mode 100644
index 0000000..91a5b26
--- /dev/null
+++ b/README.solaris
@@ -0,0 +1,12 @@
+
+ This package assumes the existence of a POSIX shell in /bin/sh.
+ On Solaris, /bin/sh is not POSIX. Most versions of Solaris provide
+a POSIX shell in /usr/xpg4/bin/sh.
+
+ To compile this package on Solaris, you will need to run
+
+ ./patch-for-solaris
+
+ before you run ./configure. This script will change the #! invocation
+of the configure script and various tools so that a POSIX shell is used
+for the compilation process.
diff --git a/configure b/configure
new file mode 100755
index 0000000..7b86bb4
--- /dev/null
+++ b/configure
@@ -0,0 +1,590 @@
+#!/bin/sh
+
+usage () {
+ cat </dev/null 2>&1 && { echo "$1" ; return 0 ; }
+$1
+EOF
+ echo "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" -e "s|\*/|* /|g"
+}
+
+fail () {
+ echo "$*"
+ exit 1
+}
+
+fnmatch () {
+ eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac"
+}
+
+cmdexists () {
+ type "$1" >/dev/null 2>&1
+}
+
+trycc () {
+ test -z "$CC_AUTO" && cmdexists "$1" && CC_AUTO=$1
+}
+
+stripdir () {
+ while eval "fnmatch '*/' \"\${$1}\"" ; do
+ eval "$1=\${$1%/}"
+ done
+}
+
+tryflag () {
+ echo "Checking whether compiler accepts $2 ..."
+ echo "typedef int x;" > "$tmpc"
+ if $CC_AUTO "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
+ echo " ... yes"
+ eval "$1=\"\${$1} \$2\""
+ eval "$1=\${$1# }"
+ return 0
+ else
+ echo " ... no"
+ return 1
+ fi
+}
+
+tryldflag () {
+ echo "Checking whether linker accepts $2 ..."
+ echo "typedef int x;" > "$tmpc"
+ if $CC_AUTO -nostdlib "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
+ echo " ... yes"
+ eval "$1=\"\${$1} \$2\""
+ eval "$1=\${$1# }"
+ return 0
+ else
+ echo " ... no"
+ return 1
+ fi
+}
+
+choose () {
+ echo "Checking whether system has $4..."
+ r=true
+ case "$1" in
+ *c*) $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -o try$2.o -c src/sysdeps/try$2.c 2>/dev/null || r=false ;;
+ esac
+ if $r ; then
+ case "$1" in
+ *l*) $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o try$2 try$2.o $5 2>/dev/null || r=false ;;
+ esac
+ fi
+ if $r ; then
+ case "$1" in
+ *r*) ./try$2 >/dev/null 2>&1 || r=false ;;
+ esac
+ fi
+ rm -f try$2.o try$2
+ if $r ; then
+ echo "$2: yes" >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_HAS$3" >> $sysdeps/sysdeps.h
+ echo " ... yes"
+ else
+ echo "$2: no" >> $sysdeps/sysdeps
+ echo "#undef ${package_macro_name}_HAS$3" >> $sysdeps/sysdeps.h
+ echo " ... no"
+ fi
+}
+
+trytypesize() {
+ echo "Checking size of $3..."
+ $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o trysizeof$1 src/sysdeps/trysizeof$1.c
+ type_size=$(./trysizeof$1) || fail "$0: unable to determine size of $3"
+ type_bits=$(expr 8 \* $type_size)
+ rm -f trysizeof$1
+ echo "sizeof$1: $type_size" >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_SIZEOF$2 $type_size" >> $sysdeps/sysdeps.h
+ echo "#define ${package_macro_name}_$2_BITS $type_bits" >> $sysdeps/sysdeps.h
+ echo " ... $type_size"
+}
+
+# Actual script
+
+CC_AUTO="$CC"
+CFLAGS_AUTO="$CFLAGS"
+CPPFLAGS_AUTO="-D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=600 $CPPFLAGS"
+LDFLAGS_AUTO="$LDFLAGS"
+LDFLAGS_NOSHARED=
+prefix=
+dynlibdir='$prefix/lib'
+libdir='$prefix/usr/lib/skalibs'
+includedir='$prefix/usr/include'
+datadir='$prefix/etc'
+sysdepdir='$prefix/usr/lib/$package/sysdeps'
+sysdeps=
+shared=true
+static=true
+slashpackage=false
+replacements=false
+egd=
+ipv6=true
+select=false
+taiclock=false
+righttz=false
+clockrt=false
+clockmon=false
+forcedevr=false
+defaultpath=/usr/bin:/bin
+sproot=
+home=
+exthome=
+addincpath=''
+addlibspath=''
+addlibdpath=''
+vpaths=''
+vpathd=''
+cross="$CROSS_COMPILE"
+
+. package/info
+
+for arg ; do
+ case "$arg" in
+ --help) usage ;;
+ --prefix=*) prefix=${arg#*=} ;;
+ --dynlibdir=*) dynlibdir=${arg#*=} ;;
+ --libdir=*) libdir=${arg#*=} ;;
+ --includedir=*) includedir=${arg#*=} ;;
+ --datadir=*) datadir=${arg#*=} ;;
+ --sysdepdir=*) sysdepdir=${arg#*=} ;;
+ --with-sysdeps=*) sysdeps=${arg#*=} ;;
+ --with-include=*) var=${arg#*=} ; stripdir var ; addincpath="$addincpath -I$var" ;;
+ --with-lib=*) var=${arg#*=} ; stripdir var ; addlibspath="$addlibspath -L$var" ; vpaths="$vpaths $var" ;;
+ --with-dynlib=*) var=${arg#*=} ; stripdir var ; addlibdpath="$addlibdpath -L$var" ; vpathd="$vpathd $var" ;;
+ --enable-shared|--enable-shared=yes) shared=true ;;
+ --disable-shared|--enable-shared=no) shared=false ;;
+ --enable-static|--enable-static=yes) static=true ;;
+ --disable-static|--enable-static=no) static=false ;;
+ --enable-slashpackage=*) sproot=${arg#*=} ; slashpackage=true ; ;;
+ --enable-slashpackage) sproot= ; slashpackage=true ;;
+ --disable-slashpackage) sproot= ; slashpackage=false ;;
+ --enable-cross=*) cross=${arg#*=} ;;
+ --enable-cross) cross= ;;
+ --disable-cross) cross= ;;
+ --enable-libc-replacements|--enable-libc-replacements=yes) replacements=true ;;
+ --disable-libc-replacements|--enable-libc-replacements=no) replacements=false ;;
+ --enable-egd=*) egd=${arg#*=} ;;
+ --disable-egd) egd= ;;
+ --enable-ipv6|--enable-ipv6=yes) ipv6=true ;;
+ --disable-ipv6|--enable-ipv6=no) ipv6=false ;;
+ --enable-iopause-select|--enable-iopause-select=yes) select=true ;;
+ --disable-iopause-select|--enable-iopause-select=no) select=false ;;
+ --enable-tai-clock|--enable-tai-clock=yes) taiclock=true ;;
+ --disable-tai-clock|--enable-tai-clock=no) taiclock=false ;;
+ --enable-right-tz|--enable-right-tz=yes) righttz=true ;;
+ --disable-right-tz|--enable-right-tz=no) righttz=false ;;
+ --enable-clock|--enable-clock=yes) clockrt=true ;;
+ --disable-clock|--enable-clock=no) clockrt=false ;;
+ --enable-monotonic|--enable-monotonic=yes) clockmon=true ;;
+ --disable-monotonic|--enable-monotonic=no) clockmon=false ;;
+ --enable-force-devr|--enable-force-devr=yes) forcedevr=true ;;
+ --disable-force-devr|--enable-force-devr=no) forcedevr=false ;;
+ --with-default-path=*) defaultpath=${arg#*=} ;;
+ --without-default-path) defaultpath=/usr/bin:/bin ;;
+ --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;;
+ --host=*|--target=*) target=${arg#*=} ;;
+ -* ) echo "$0: unknown option $arg" ;;
+ *=*) ;;
+ *) target=$arg ;;
+ esac
+done
+
+for i in prefix exec_prefix dynlibdir libdir includedir datadir sysdepdir sysdeps sproot ; do
+ eval tmp=\${$i}
+ eval $i=$tmp
+ stripdir $i
+done
+
+# Get usable temp filenames
+i=0
+set -C
+while : ; do
+ i=$(($i+1))
+ tmpc="./tmp-configure-$$-$PPID-$i.c"
+ tmpe="./tmp-configure-$$-$PPID-$i.tmp"
+ 2>|/dev/null > "$tmpc" && break
+ 2>|/dev/null > "$tmpe" && break
+ test "$i" -gt 50 && fail "$0: cannot create temporary files"
+done
+set +C
+trap 'rm -f "$tmpc" "$tmpe"' EXIT ABRT INT QUIT TERM HUP
+
+# Set slashpackage values
+if $slashpackage ; then
+ home=${sproot}/package/${category}/${package}-${version}
+ exthome=${sproot}/package/${category}/${package}
+ sysdepdir=${home}/sysdeps
+ binprefix=${home}/command
+ extbinprefix=${exthome}/command
+ dynlibdir=${home}/library.so
+ libdir=${home}/library
+ includedir=${home}/include
+fi
+
+# Find a C compiler to use
+echo "Checking for C compiler..."
+trycc ${cross}gcc
+trycc ${cross}c99
+trycc ${cross}cc
+test -n "$CC_AUTO" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
+echo " ... $CC_AUTO"
+echo "Checking whether C compiler works... "
+echo "typedef int x;" > "$tmpc"
+if $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -c -o /dev/null "$tmpc" 2>"$tmpe" ; then
+ echo " ... yes"
+else
+ echo " ... no. Compiler output follows:"
+ cat < "$tmpe"
+ exit 1
+fi
+
+echo "Checking target system type..."
+test -n "$target" || target=$($CC_AUTO -dumpmachine 2>/dev/null) || target=unknown
+echo " ... $target"
+
+tryflag CFLAGS_AUTO -std=c99
+tryflag CFLAGS_AUTO -fomit-frame-pointer
+tryflag CFLAGS_AUTO -fno-exceptions
+tryflag CFLAGS_AUTO -fno-unwind-tables
+tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
+tryflag CFLAGS_AUTO -Wa,--noexecstack
+tryflag CFLAGS_AUTO -fno-stack-protector
+tryflag CPPFLAGS_AUTO -Werror=implicit-function-declaration
+tryflag CPPFLAGS_AUTO -Werror=implicit-int
+tryflag CPPFLAGS_AUTO -Werror=pointer-sign
+tryflag CPPFLAGS_AUTO -Werror=pointer-arith
+tryflag CPPFLAGS_AUTO -Wno-parentheses
+tryflag CPPFLAGS_AUTO -Wno-uninitialized
+tryflag CPPFLAGS_AUTO -Wno-missing-braces
+tryflag CPPFLAGS_AUTO -Wno-unused-value
+tryflag CPPFLAGS_AUTO -Wno-unused-but-set-variable
+tryflag CPPFLAGS_AUTO -Wno-unknown-pragmas
+tryflag CPPFLAGS_AUTO -Wno-pointer-to-int-cast
+
+if $shared ; then
+ tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
+fi
+
+if test -n "$sysdeps" ; then
+ if test ! -d $sysdeps || test ! -f $sysdeps/target ; then
+ echo "$0: error: $sysdeps is not a valid sysdeps directory"
+ exit 1
+ fi
+ if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then
+ echo "$0: error: target $target does not match the contents of $sysdepdir/target"
+ exit 1
+ fi
+ echo "Using pre-computed sysdeps in $sysdeps."
+ rt_lib=$(cat $sysdeps/rt.lib)
+ socket_lib=$(cat $sysdeps/socket.lib)
+ sysclock_lib=$(cat $sysdeps/sysclock.lib)
+ tainnow_lib=$(cat $sysdeps/tainnow.lib)
+ util_lib=$(cat $sysdeps/util.lib)
+ if test -n "$egd" ; then
+ egd=$(grep -F egd: $sysdeps/sysdeps | cut -d' ' -f2-)
+ echo "warning: --enable-egd option ignored, using sysdeps-provided value instead: $egd"
+ fi
+else
+ sysdeps=sysdeps.cfg
+ mkdir -p $sysdeps
+ echo "$target" > $sysdeps/target
+ echo "target: $target" > $sysdeps/sysdeps
+ cat < $sysdeps/sysdeps.h
+/* ISC license. */
+
+#ifndef SYSDEPS_H
+#define SYSDEPS_H
+
+#define SKALIBS_TARGET "$target"
+EOF
+
+ util_lib=
+ echo > $sysdeps/util.lib
+
+ echo "Checking whether socket functions need an additional library..."
+ $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -c -o trylsock.o src/sysdeps/trylsock.c || fail "$0: compiler cannot compile src/sysdeps/trylsock.c"
+ if $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null trylsock.o 2>/dev/null ; then
+ socket_lib=
+ echo " ... no"
+ elif $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null trylsock.o -lsocket 2>/dev/null ; then
+ socket_lib=-lsocket
+ echo " ... -lsocket"
+ elif $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null trylsock.o -lsocket -lnsl 2>/dev/null ; then
+ socket_lib="-lsocket -lnsl"
+ echo " ... -lsocket -lnsl"
+ else
+ fail "$0: unable to determine socket.lib sysdep"
+ fi
+ rm -f trylsock.o
+ echo "$socket_lib" > $sysdeps/socket.lib
+
+ echo "Checking whether clock functions are available..."
+ rt_lib=
+ if $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -c -o tryclockrt.o src/sysdeps/tryclockrt.c 2>/dev/null ; then
+ if $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null tryclockrt.o 2>/dev/null ; then
+ hasclock=true
+ echo " ... yes"
+ elif $CC_AUTO $CFLAGS_AUTO $LDFLAGS_AUTO -o /dev/null tryclockrt.o -lrt 2>/dev/null ; then
+ hasclock=true
+ echo " ... yes, with -lrt"
+ rt_lib=-lrt
+ else
+ hasclock=false
+ fi
+ rm -f tryclockrt.o
+ else
+ hasclock=false
+ fi
+ echo "$rt_lib" > $sysdeps/rt.lib
+ if $clockrt ; then
+ echo "$rt_lib" > $sysdeps/sysclock.lib
+ echo "$rt_lib" > $sysdeps/tainnow.lib
+ else
+ echo > $sysdeps/sysclock.lib
+ if $clockmon ; then
+ echo "$rt_lib" > $sysdeps/tainnow.lib
+ else
+ echo > $sysdeps/tainnow.lib
+ fi
+ fi
+ if $hasclock ; then
+ rm -f tryclockrt
+ echo 'clockrt: yes' >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_HASCLOCKRT" >> $sysdeps/sysdeps.h
+ choose cl clockmon CLOCKMON CLOCK_MONOTONIC $rt_lib
+ else
+ echo 'clockrt: no' >> $sysdeps/sysdeps
+ echo "#undef ${package_macro_name}_HASCLOCKRT" >> $sysdeps/sysdeps.h
+ echo ' ... no'
+ fi
+
+ echo "Checking system endianness..."
+ $CC_AUTO $CPPFLAGS_AUTO $CFLAGS_AUTO -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 " ... $endianness"
+ rm -f tryendianness
+
+ trytypesize ushort USHORT "unsigned short"
+ trytypesize uint UINT "unsigned int"
+ trytypesize ulong ULONG "unsigned long"
+ trytypesize gid GID "gid_t"
+ trytypesize time TIME "time_t"
+ choose clr accept4 ACCEPT4 'accept4()'
+ choose clr ancilautoclose ANCILAUTOCLOSE 'auto-close after fd-passing'
+ choose c cmsgcloexec CMSGCLOEXEC 'MSG_CMSG_CLOEXEC'
+ choose clr devurandom DEVURANDOM '/dev/urandom'
+ choose c eproto EPROTO EPROTO
+ choose cl eventfd EVENTFD 'eventfd()'
+ choose cl flock FLOCK 'flock()'
+ choose cl getpeereid GETPEEREID 'getpeereid()'
+ choose cl sopeercred SOPEERCRED 'SO_PEERCRED'
+ choose cl getpeerucred GETPEERUCRED 'getpeerucred()'
+ choose cl ipv6 IPV6 'IPv6 support' $socket_lib
+ choose clr malloc0 MALLOC0 'non-NULL malloc(0)'
+ choose cl openat OPENAT 'openat()'
+ choose cl linkat LINKAT 'linkat()'
+ choose clr pipe2 PIPE2 'pipe2()'
+ choose cl posixspawn POSIXSPAWN 'posix_spawn()'
+ choose clr ppoll PPOLL 'ppoll()'
+ choose cl revoke REVOKE 'revoke()'
+ choose cl sendfile SENDFILE 'sendfile()'
+ choose cl setgroups SETGROUPS 'setgroups()'
+ choose cl settimeofday SETTIMEOFDAY 'settimeofday()'
+ choose clr signalfd SIGNALFD 'signalfd()'
+ choose clr splice SPLICE 'splice()'
+ choose cl strcasestr STRCASESTR 'strcasestr()'
+ choose c uint64t UINT64T 'uint64_t'
+
+ if $forcedevr ; then
+ echo "/dev/random detection override required, assuming it exists and is working."
+ echo "devrandom: yes" >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_HASDEVRANDOM" >> $sysdeps/sysdeps.h
+ else
+ choose clr devrandom DEVRANDOM /dev/random
+ fi
+ if test -n "$egd" ; then
+ if echo "$egd" | grep -q '[^[:alnum:]/_-]' ; then
+ fail "$0: invalid EGD path: $egd"
+ fi
+ echo "egd: $egd" >> $sysdeps/sysdeps
+ echo "#define ${package_macro_name}_HASEGD \"$egd\"" >> $sysdeps/sysdeps.h
+ fi
+ echo '#endif' >> $sysdeps/sysdeps.h
+fi
+
+echo "Copying $sysdeps/sysdeps.h to src/include/${package}/sysdeps.h ..."
+cat < $sysdeps/sysdeps.h > src/include/${package}/sysdeps.h
+echo " ... done"
+
+echo "Creating config.mak..."
+cmdline=$(quote "$0")
+for i ; do cmdline="$cmdline $(quote "$i")" ; done
+exec 3>&1 1>config.mak
+cat << EOF
+# This file was generated by:
+# $cmdline
+# Any changes made here will be lost if configure is re-run.
+
+target := $target
+package := $package
+prefix := $prefix
+datadir := $datadir
+sysdepdir := $sysdepdir
+dynlibdir := $dynlibdir
+libdir := $libdir
+includedir := $includedir
+sysdeps := $sysdeps
+version := $version
+sproot := $sproot
+home := $home
+exthome := $exthome
+ipv6 := $ipv6
+RT_LIB := ${rt_lib}
+SOCKET_LIB := ${socket_lib}
+SYSCLOCK_LIB := ${sysclock_lib}
+TAINNOW_LIB := ${tainnow_lib}
+UTIL_LIB := ${util_lib}
+CC := $CC_AUTO
+CFLAGS := $CFLAGS_AUTO
+CPPFLAGS := $CPPFLAGS_AUTO
+LDFLAGS := $LDFLAGS_AUTO
+LDFLAGS_NOSHARED := $LDFLAGS_NOSHARED
+CROSS_COMPILE := $cross
+EOF
+if test -n "$vpaths" ; then
+ echo "vpath lib%a$vpaths"
+fi
+if test -n "$vpathd" ; then
+ echo "vpath lib%.so$vpathd"
+fi
+
+$static || echo "STATIC_LIBS :="
+$shared || echo "SHARED_LIBS :="
+exec 1>&3 3>&-
+echo " ... done."
+
+echo "Creating src/include/${package}/config.h..."
+mkdir -p -m 0755 src/include/${package}
+exec 3>&1 1> src/include/${package}/config.h
+cat <&3 3>&-
+echo " ... done."
diff --git a/doc/crosscompile.html b/doc/crosscompile.html
new file mode 100644
index 0000000..ba22b31
--- /dev/null
+++ b/doc/crosscompile.html
@@ -0,0 +1,93 @@
+
+
+
+
+ How to cross-compile skalibs
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ How to cross-compile skalibs
+
+
+ There are three issues in the world of cross-compilation:
+
+
+
+ - support for parallel builds: the source directory must be read-only
+and each build process must have its own build tree.
+ - support for compiler options: to specify the target architecture,
+the header and library files that should be used, etc.
+
- build-time tests performed on the build architecture are invalid
+if the target architecture is different.
+
+
+ Support for parallel builds
+
+
+ skalibs does not support out-of-tree builds at the moment,
+but since the source code tree is small, it's not costly to duplicate it
+to perform parallel builds. If the source code trees grows significantly
+larger, out-of-tree build support will be considered.
+
+
+ Support for build-time options
+
+
+ skalibs now uses a standard ./configure && make && make install
+process, and cross-compiling build-time options can be given on the
+./configure command line.
+
+
+ Bypassing the build-time tests
+
+
+ This is the hardest part of cross-compilation, and very few build systems
+get it right. (GNU autotools does not, which is one of the reasons why
+skarnet.org packages do not use autotools.)
+
+
+
+ Native build procedures usually perform build-time tests: they compile
+executables and run them (on the build platform, which is the same as
+the target platform) to check for features and system quirks. skalibs
+does exactly that: the ./configure step performs tests on the
+build platform and stores the system-dependent results in a directory
+that it calls the sysdeps for this platform.
+
+
+
+But in a
+cross-compilation environment, build-time tests are invalid, since the build
+platform and the target platform differ.
+ There is only one way to cross-compile portable code without resorting
+to build-time autodetection:
+you must provide by hand the sysdeps for your target
+architecture, via the --with-sysdeps option to configure.
+
+
+
+ The easiest way to get the correct sysdeps for a target achitecture is
+to natively compile skalibs on that target, and steal the produced sysdeps
+files. It can be easily done with a virtual machine, qemu for instance.
+You could also (politely) ask for precompiled sysdeps on the
+skaware mailing-list, if you cannot find them anywhere on the Internet.
+
+
+ Credits
+
+
+Dan Kegel brought up the need for a
+clean cross-compilation system.
+
+
+
+
diff --git a/doc/djblegacy.html b/doc/djblegacy.html
new file mode 100644
index 0000000..0cdd891
--- /dev/null
+++ b/doc/djblegacy.html
@@ -0,0 +1,151 @@
+
+
+
+
+ skalibs: the djb legacy
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ The DJB legacy
+
+ Who is this DJB guy, and why is he so special anyway ?
+
+
+Dan J. Bernstein is a cryptologist and
+a mathematician; he's also the author of a widely known and used MTA,
+qmail, as well as a few
+lesser known pieces of software.
+
+
+
+ For some time he was quite active in some Unix software-related
+Internet newsgroups and mailing-lists; he quickly became a
+controversial figure of the Unix programming community, mostly
+by being extremely vocal against well-known authors of
+"mainstream" Unix software and by suggesting designs so removed
+from traditional software design that a normal human reaction is
+to first view him as a complete nut.
+
+
+
+ I do not care for controversy. I am interested in the code. I was
+a sysadmin at the time, and still learning to program in C beyond
+what they teach you in school (i.e. not much). I had heard enough
+horror stories with sendmail; so I gave a shot at qmail, trying to
+understand its design principles and the way it was made. And then
+I fell down the rabbit hole.
+
+
+
+ Look, I don't care what you think of the guy, I don't know him
+anyway, and this is totally beside the point. The only thing that
+matters is that DJB's software is right in so
+many ways. This software works. DJB's design
+principles are sound and elegant; they are
+sound foundations to build reliable, secure, and
+low resource-consuming software. And the design,
+when you get used to it, feels so unix-ish: it's Unix the way it
+should have been from the start.
+
+
+
+ Studying DJB's software was the best course in C/Unix programming
+I ever had. Now I teach C/Unix; and I am really glad I
+learned from the best.
+
+
+ Building beyond DJB's works.
+
+
+ There's already
+a lot you can do with
+pristine DJB software and some brains.
+
+
+
+ However, I mostly see DJB as a pioneer. He showed it was possible
+to think Unix differently and build secure, reliable and efficient
+software without investing millions of dollars into it; now it is
+up to software architects and programmers to use the breakthrough
+and build upon it. There's a real demand for quality Unix software
+out there; it's time to supply. And
+I am not the only
+one thinking this way.
+
+
+
+ So, skalibs.
+
+
+
+ One of the "DJB philosophy" key points is to question the
+interfaces. You have a task to do; you have existing interfaces.
+What do you do?
+
+
+
+ - Most people don't even think about it and use the existing
+interfaces, even if it amounts to cramming a square peg into a
+round hole. This is why buffer overflows exist. This is why
+people use abominations such as
+gets(),
+which is still in the Single Unix Specification as of version 4,
+in freaking June 2011. This is why the System V
+initialization scheme is still prevalent in Linux distributions,
+despite being one of the slowest and most unreliable of all
+initialization schemes. This is why people still use the
+atrocious "libresolv" DNS client library.
+ - An alternative way of thinking is to ask yourself:
+"Is the interface I have adequate for the task at hand?"
+
+ - If yes: perfect, use that interface.
+ - If no: then do not use that interface, duh. Design a
+better one and use it: so the complexity will be split and the code
+will be easier to maintain.
+
+
+
+
+ Interfaces should be questioned right down to the libc. You
+cannot build strong software on flakey foundations. And from a system
+and network programmer's point of view, one thing is clear: most
+standard libc interfaces suck. There is no buffered asynchronous
+I/O. There is no timed I/O. There is no heap management helper. Even
+simple system calls are not
+guaranteed to succeed!
+
+
+
+ That is where skalibs comes from. skalibs results from questioning
+the libc interfaces, and providing replacements or additions where
+the existing interfaces do not make it easy to write reliable, secure
+and efficient software. It is inspired by DJB's work. It is
+not a shrine or anything of the kind.
+
+
+ Conclusion
+
+
+ So, in short, DJB is not a guru, I'm not a mindless brainwashed fan,
+and the "DJB advocates" are not a cult. We just think DJB brought
+something to Unix and more generally to the software programming world;
+we learned from him, we write software following
+sound principles that he was one of the first to really apply, and we give
+credit where credit is due.
+
+
+
+ Use our software. You will never want to go back.
+
+
+
+
diff --git a/doc/flags.html b/doc/flags.html
new file mode 100644
index 0000000..2579d5a
--- /dev/null
+++ b/doc/flags.html
@@ -0,0 +1,313 @@
+
+
+
+
+ skalibs: configuration flags
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ skalibs configuration flags
+
+
+ The skalibs ./configure script comes with a few
+uncommon options; this page explains what they are for.
+
+
+ --enable-slashpackage[=sproot]
+
+
+ This flag tells configure that you want to install skalibs according to
+the slashpackage convention.
+If you enable it, and $v is the version of skalibs you're compiling,
+make install will install the skalibs header files in
+/package/prog/skalibs-$v/include, the static libraries in
+/package/prog/skalibs-$v/library, the dynamic libraries in
+/package/prog/skalibs-$v/library.so and the data files in
+/package/prog/skalibs-$v/etc, all prefixed by sproot
+it present. It will also add two more "make" targets:
+
+
+
+ - make update will update the /package/prog/skalibs
+symbolic link to point to skalibs-$v
+ - make -L global-links will make links from /library.so
+to the installed skalibs shared libraries.
+
+
+ --enable-libc-replacements
+
+
+ If this option is given, then the low-level components
+of libstddjb, such as byte_copy(),
+will be built using independent, failsafe implementations; skalibs will
+avoid relying on the libc when possible.
+
+
+
+ If this option is not given, then native libc primitives such as
+memmove()
+will be used for the low-levels components of libstddjb. This is the default.
+
+
+
+ This flag should be set if your libc has known bugs or you are uncertain
+of it for some reason. Standard libcs on modern systems have been thoroughly
+tested, so it's usually safe, and faster, to stick to the default.
+
+
+ --enable-tai-clock
+
+
+ To understand what this flag is about - and the next three flags too - you
+should start by reading
+this
+page about Unix time,
+which David Madore wrote after
+a long and fairly complete discussion we had on the subject. You can also
+read what DJB says about Unix time.
+Unfortunately, when he says "the POSIX rules are so outrageously dumb (...)
+that no self-respecting engineer would obey them", DJB is wrong: a lot of
+people follow the POSIX rules. Or maybe he's right... and there are very,
+very few self-respecting engineers.
+
+
+
+ Basically, when you configure a Unix system, there are essentially two
+ways to deal with your system clock.
+
+
+
+ - You can set your system clock to TAI-10, which is the "right", but
+uncommon, thing to do:
+
+ - ↑ The main advantage of this setup is that it makes your system clock
+linear. In other words,
+gettimeofday()
+becomes suitable for both timestamping (which needs absolute time) and timeout
+computations (which need reliable interval measurements); if your clock is
+accurate enough, it can function as both a wall clock and a stopwatch.
+This simplifies keeping track of the current time considerably,
+and makes event loop handling (with functions such as
+iopause()) trivial.
+ - ↑ skalibs uses TAI internally; setting your system clock to TAI-10
+saves a lot of conversions and makes time computations with skalibs more
+efficient.
+ - → In order to display GMT or local time properly, you have to
+use the right/ timezones from Arthur David Olson's timezone
+library. If your libc does not support them, see the
+next flag.
+ - ↓ This setup is arguably not SUSv4 conformant (a strict
+interpretation of Single Unix requires the system clock to be set to UTC).
+ - ↓ This setup is not compatible with
+ntpd. ntpd's design
+is flawed: it makes the mistake of setting the system clock itself - instead
+of simply making the computed time available to other programs, one of which
+could set the system clock - and it always sets it to UTC. (The
+s6-networking
+package provides alternate ways to synchronize your clock, though.)
+
+
+ - You can set your system clock to UTC, which is the common, strictly
+POSIX setup:
+
+ - ↑ This is strictly SUSv4-compliant. Most Unix machines all over
+the world are set up like this.
+ - ↑ This is compatible with ntpd.
+ - → You should not use Olson's time library in that case.
+ - ↓ skalibs time computations will take a bit more processing power.
+ - ↓ Most importantly, you forsake all linearity - and even monotonicity
+- on your system clock, which can now only be used as a wall clock,
+not as a stopwatch. skalibs will try its best to do accurate time
+computations, but there's no way gettimeofday() can be relied on
+when a leap second is nearby; you have to use CLOCK_MONOTONIC as a stopwatch
+for accurate interval measurement.
+
+
+
+
+
+ USe --enable-tai-clock if your system clock is set to TAI-10.
+I generally recommend this setup
+for computers you have full control on, on which you install and tweak
+the software your way, like manually administered servers or embedded
+boxes. If you do not run ntpd and do not mind breaking POSIX, it is the
+sensible choice.
+
+
+
+ Do not use this option if your system clock is set to UTC, i.e. if
+you're in none of the above cases: you are a
+POSIX freak, or your Unix distribution is running ntpd for you, or
+other software is assuming you're on UTC. This is the default.
+
+
+
+ --enable-right-tz
+
+
+ This option instructs skalibs that you're using Olson's time
+library, i.e. "right/" timezones.
+
+
+
+ Normally, if you set --enable-tai-clock, you
+should also set up your timezone to a "right/" one, and
+set flag-tzisright. And if you don't use
+--enable-tai-clock, you should also use a POSIX
+timezone, and NOT use --enable-right-tz. Those two options
+should always be used together.
+
+
+
+ But some C libraries do not support the Olson time library's
+timezone format, and just do not provide the "right/" timezones! For
+instance, musl,
+an alternative libc for Linux, only supports POSIX timezones. And you
+might want to use such a libc, and still set up your clock to
+TAI-10, for instance in embedded environments where accurate timekeeping
+is important. In such cases, you'll set up a POSIX timezone, and use the
+--enable-tai-clock option without the --enable-right-tz one.
+
+
+
+ Be aware that setting your system clock to TAI-10 without having a
+"right/" timezone will cause non-skalibs-using software to display
+local time incorrectly; in such a setup, only skalibs-using software
+will understand what is going on and do the proper computations to
+display the correct local time. Keep your settings as consistent as
+possible.
+
+
+
+ By default, skalibs will consider you are using POSIX timezones (as well
+as a UTC system clock).
+
+
+ --enable-clock
+
+
+ The Open Group Base Specifications, issue 7, describes gettimeofday()
+as obsolescent, and recommends the use of
+clock_gettime()
+with the CLOCK_REALTIME option instead. However:
+
+
+
+ - clock_gettime() is not as portable; for instance, Darwin does not have it.
+ - On most systems, using the clock_ functions requires linking with librt,
+which is slightly inconvenient - and silly if all you want is timestamping.
+
+
+
+ If --enable-clock is set, the tain_now()
+and tain_setnow() functions for getting and setting time will be based on
+the clock_gettime() and clock_settime() functions.
+
+
+
+ Otherwise, the old-school gettimeofday()
+and settimeofday() interfaces will be used. This is the default,
+and it's usually safe.
+
+
+ --enable-monotonic
+
+
+ Unless you have an accurate hardware system clock and you set it
+on a linear time scale such as TAI-10 instead of UTC (see above), it is
+generally a bad idea to trust the system clock for precise time interval
+measurements. Single Unix recommends the use of clock_gettime()
+with the CLOCK_MONOTONIC option to do such measurements: a stopwatch, not
+a wall clock. However:
+
+
+
+ - CLOCK_MONOTONIC is even less portable than CLOCK_REALTIME.
+ - It's a bit tricky to emulate absolute time calculations based on
+CLOCK_MONOTONIC.
+
+
+
+ If --enable-monotonic is set, then the absolute time given by the
+tain_now() call will be computed with CLOCK_MONOTONIC. This
+will ensure precise time arithmetic but may drift away from the system
+clock.
+
+
+
+ Otherwise, tain_now() will
+return a time based on the system clock, and not use CLOCK_MONOTONIC.
+This is the default.
+
+
+ --disable-ipv6
+
+
+ If you set this option, then skalibs will be compiled without IPv6 support,
+even if your target architecture supports it. This can significantly
+reduce the size of your networking applications if they don't need IPv6
+support.
+
+
+
+ If you don't set this option, then skalibs will include IPv6 support in the
+relevant networking functions, if the target architecture supports it.
+The safe option is to let this flag clear.
+
+
+ --enable-force-devr
+
+
+ If this option is set, then the automatic sysdeps tests will assume the
+target architecture has a working /dev/random and will skip
+its autodetection.
+
+
+
+ Otherwise, /dev/random will be autodetected
+and tested; if entropy generation is low on the host, the compilation
+process might hang for several minutes. It is safe to let this flag
+clear; it should only be set to speed up the compilation process in a
+known environment and for testing purposes.
+
+
+
+ If skalibs is being cross-compiled, this flag obviously has no effect:
+the presence of a working /dev/random is read from the user-provided
+sysdeps.
+
+
+ --enable-egd=path
+
+
+ If you set this option, then the librandom functions
+will assume the presence of an EGD daemon listening on path,
+and use it to get random data.
+
+
+
+ By default, skalibs will not include EGD support.
+
+
+ --with-default-path=path
+
+
+ The execvep() function uses
+the value of the PATH environment variable as its executable search path.
+Specifying this option to configure tells execvep() what executable
+search path to use when PATH is undefined (which should not happen
+often anyway).
+ The default is /usr/bin:/bin, which is usually safe.
+
+
+
+
diff --git a/doc/index.html b/doc/index.html
new file mode 100644
index 0000000..344ffff
--- /dev/null
+++ b/doc/index.html
@@ -0,0 +1,131 @@
+
+
+
+
+ skalibs: a C library for system programming
+
+
+
+
+
+
+
+Software
+skarnet.org
+
+
+ skalibs
+
+ What is it ?
+
+
+ skalibs is a package centralizing the free software / open source C development
+files used for building all software at skarnet.org: it contains essentially
+general-purpose libraries.
+You will need to install skalibs if you plan to build skarnet.org software.
+ The point is that you won't have to download and compile big libraries, and care
+about portability issues,
+everytime you need to build a package: do it only once.
+
+
+
+ skalibs can also be used as a sound basic start for C development. There
+are a lot of general-purpose libraries out there; but if your main goal is
+to produce small and secure C code with a focus on system
+programming, skalibs might be for you.
+
+
+
+
+ Installation
+
+ Requirements
+
+
+
+ Licensing
+
+
+ skalibs is free software. It is available under the
+ISC license.
+
+
+ Download
+
+
+ - The current skalibs version is 2.0.0.0.
+
+
+ Compilation
+
+
+ - See the enclosed INSTALL file for installation details.
+ - skalibs sports a few uncommon options to its ./configure script.
+This page documents them in detail.
+
+
+ Upgrade notes
+
+
+ - This page lists the differences to be aware of between
+the previous versions of skalibs and the current one.
+
+
+ Cross-compilation
+
+
+ Cross-compilation is tricky. skalibs provides system-agnostic interfaces, so all the
+other skarnet.org packages cross-compile easily; but some effort needs to be made to
+cross-compile skalibs, see this page.
+
+
+
+ Reference
+
+ Libraries
+
+
+
+
+
+ Similar work
+
+
+ Here are a few other libraries originating from the same place as
+skalibs, i.e. people start to reuse and package, or rewrite,
+code from Dan J. Bernstein, and then patch
+after patch, addition after addition, the code evolves into a project
+of its own:
+
+
+
+
+ Related resources
+
+
+ - skalibs is discussed on the
+skaware mailing-list.
+
+
+
+
+
diff --git a/doc/libbiguint/index.html b/doc/libbiguint/index.html
new file mode 100644
index 0000000..30de27e
--- /dev/null
+++ b/doc/libbiguint/index.html
@@ -0,0 +1,391 @@
+
+
+
+
+ skalibs: the biguint library interface
+
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+www.skarnet.org
+
+
+ The biguint library interface
+
+
+biguint is set of simple primitives performing arithmetical
+operations on (unsigned) integers of arbitrary length. It is nowhere
+near as powerful or efficient as specialized,
+assembly language-optimized libraries such as
+GMP, but it has the advantages
+of smallness and simplicity.
+
+
+ Compiling
+
+
+ - Use #include <skalibs/biguint.h>
+
+
+ Programming
+
+
+ You should refer to the skalibs/biguint.h header for the exact function
+prototypes.
+
+
+
+Definitions
+
+
+ - A biguint x is a pointer to an array u
+of uint32, together with an unsigned integer n called its length.
+
x = (2^32)^0 * u[0] + (2^32)^1 * u[1] + ... + (2^32)^(n-1) * u[n-1].
+ - Every u[i] is called a limb.
+ - The greatest integer i lesser than n for which
+u[i] is non-zero is called the order of x. The
+order of zero is 0.
+
+
+
+Basic operations
+
+ Creating a biguint
+
+
+ Just declare uint32 x[n] ; - n being the length of the
+biguint. You could also allocate x in the heap, possibly using a
+uint32 genalloc. In the following,
+a biguint is always referred to as a uint32 * with its
+unsigned int length ; it must always be pre-allocated.
+
+
+
+ If an operation fails because a biguint's length n is too small to
+accommodate the result, the function will write the first (i.e. least significant)
+n limbs of the result, truncating it, then return 0 with errno set to
+EOVERFLOW.
+
+
+ Setting it to zero
+
+
+uint32 *x ;
+unsigned int n ;
+
+ bu_zero(x, n) ;
+
+
+
+bu_zero() sets the first n limbs of x to zero.
+
+
+ Copying a biguint
+
+
+uint32 const *x ;
+unsigned int xn ;
+uint32 *y ;
+unsigned int yn ;
+
+ bu_copy(y, yn, x, xn) ;
+
+
+
+bu_copy() copies x to y, setting higher limbs of y
+to zero if needed. It then returns 1. If y is too small to contain x,
+the function returns 0 EOVERFLOW.
+
+
+ Calculating the order
+
+
+uint32 const *x ;
+unsigned int n ;
+unsigned int r ;
+
+ r = bu_len(x, n) ;
+
+
+
+bu_len() outputs the order of x of length n.
+0 <= r <= n.
+
+
+ Comparing two biguints
+
+
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+int r ;
+
+ r = bu_cmp(a, an, b, bn) ;
+
+
+
+bu_cmp() returns -1 if a < b, 1 if
+a > b, and 0 if a = b.
+
+
+
+I/O operations
+
+ Writing a biguint as an array of bytes
+
+
+char *s ;
+uint32 const *x ;
+unsigned int n ;
+
+ bu_pack(s, x, n) ;
+ bu_pack_big(s, x, n) ;
+
+
+
+bu_pack() writes 4*n bytes to s. The bytes
+are a little-endian representation of x.
+bu_pack_big() is the same, with a big-endian representation.
+
+
+ Reading a biguint from an array of bytes
+
+
+char const *s ;
+uint32 *x ;
+unsigned int n ;
+
+ bu_unpack(s, x, n) ;
+ bu_unpack_big(s, x, n) ;
+
+
+
+bu_unpack() reads 4*n little-endian bytes from s
+and writes them into the corresponding biguint x.
+bu_unpack_big() is the same, but the bytes are interpreted as
+big-endian.
+
+
+ Formatting a biguint for readable output
+
+
+char *s ;
+uint32 const *x ;
+unsigned int n ;
+
+ bu_fmt(s, x, n) ;
+
+
+
+bu_fmt() writes x in s as a standard big-endian
+hexadecimal number. x is considered of length n, so
+8*n bytes will be written to s, even if it x
+starts with zeros. bu_fmt returns the number of bytes written.
+
+
+ Reading a biguint from readable format
+
+
+char const *s ;
+uint32 *x ;
+unsigned int xn ;
+unsigned int z ;
+unsigned int len ;
+
+ len = bu_scanlen(s, &z) ;
+ bu_scan(s, len, x, xn, z) ;
+
+
+
+ bu_scanlen() scans s for a biguint written as a hexadecimal
+number and returns the number of
+bytes read. The reading stops at the first byte encountered that is not
+in the 0-9, A-F or a-f range. The z integer then contains the
+number of bytes excluding leading zeros.
+
+
+
+ If x has not been allocated yet, you can use xn = bitarray_div8(z)
+(if you have included the bitarray.h header)
+and allocate x with length xn.
+
+
+
+bu_scan() then reads len bytes from s, assuming
+there are z significant bytes (i.e. not leading zeros); it writes
+the resulting biguint into x of length xn. It returns 1,
+except if xn is too small, in which case it returns 0 EOVERFLOW.
+
+
+
+Arithmetic operations
+
+ Addition
+
+
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+uint32 *c ;
+unsigned int cn ;
+unsigned char carrybefore ;
+unsigned char carryafter ;
+
+ bu_add(c, cn, a, an, b, bn) ;
+ bu_sub(c, cn, a, an, b, bn) ;
+
+
+
+bu_add() adds a and b, and puts the result
+into c. It returns 1 unless it has to truncate it.
+
+
+
+bu_sub() substracts b from a, and puts the
+result into c. If the result should be negative, then it is
+written as (2^32)^cn - c and the function returns 0 EOVERFLOW.
+
+
+ Multiplication
+
+
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+uint32 *c ;
+unsigned int cn ;
+
+ bu_mul(c, cn, a, an, b, bn) ;
+
+
+
+bu_mul() computes c=a*b.
+Make sure that cn ≥ bu_len(a, an) + bu_len(b, bn).
+If it is not the case, the result will be truncated and bu_mul will return
+0 EOVERFLOW.
+
+
+ Division
+
+
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+uint32 *q ;
+unsigned int qn ;
+uint32 *r ;
+unsigned int rn ;
+
+ bu_div(a, an, b, bn, q, qn, r, rn) ;
+ bu_mod(r, rn, b, bn) ;
+
+
+
+bu_div() computes q, the quotient, and r, the
+remainder, of a divided by b. If b is zero, it
+returns 0 EDOM. If qn or rn is to small to store the
+quotient or the remainder, it returns 0 EOVERFLOW.
+bu_mod() computes only the remainder, and stores it in-place.
+
+
+ GCD
+
+
+uint32 *r ;
+unsigned int rn ;
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+
+ bu_gcd(r, rn, a, an, b, bn) ;
+
+
+
+
+bu_gcd() computes the greatest common divisor between a
+and b, and stores it into r. It returns 1 if all went well.
+
+
+
+ Note that this function iterates on divisions, so it might use a non totally
+negligible amount of CPU time.
+
+
+
+ Left-shifts and right-shifts
+
+
+uint32 *x ;
+unsigned int xn ;
+unsigned char carryafter ;
+unsigned char carrybefore ;
+
+ carryafter = bu_slbc(x, xn, carrybefore) ;
+ carryafter = bu_srbc(x, xn, carrybefore) ;
+
+
+
+bu_slbc() computes x <<= 1.
+The least significant bit of x is then set to
+carrybefore. bu_slbc() returns the
+previous value of x's most significant bit.
+bu_srbc() computes x >>= 1.
+The most significant bit of x is then set to
+carrybefore. bu_slbc() returns the
+previous value of x's least significant bit.
+bu_slb(x, n) and bu_srb(x, n) are macros for
+respectively bu_slbc(x, n, 0) and bu_srbc(x, n, 0).
+
+
+ Modular operations
+
+
+uint32 const *a ;
+unsigned int an ;
+uint32 const *b ;
+unsigned int bn ;
+uint32 *c ;
+unsigned int cn ;
+uint32 const *m ;
+unsigned int mn ;
+
+ bu_addmod(c, cn, a, an, b, bn, m, mn) ;
+ bu_submod(c, cn, a, an, b, bn, m, mn) ;
+ bu_mulmod(c, cn, a, an, b, bn, m, mn) ;
+ bu_divmod(c, cn, a, an, b, bn, m, mn) ;
+ bu_invmod(c, cn, m, mn) ;
+
+
+
+bu_addmod() computes c = (a+b) mod m.
+bu_submod() computes c = (a-b) mod m.
+bu_mulmod() computes c = (a*b) mod m.
+a and b must already be numbers modulo m.
+The functions return 1 if all went well.
+
+
+
+bu_divmod() computes a divided by b modulo
+m and stores it into c.
+bu_invmod() computes the inverse of c modulo m
+and stores it into c.
+The divisor and m must be relatively prime, else
+those functions return 0 EDOM.
+ The algorithm for modular division and inversion is due to
+Sheueling
+Chang Shantz.
+
+
+
+
diff --git a/doc/libdatastruct/index.html b/doc/libdatastruct/index.html
new file mode 100644
index 0000000..b32c7ce
--- /dev/null
+++ b/doc/libdatastruct/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+ skalibs: the datastruct library interface
+
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The datastruct library interface
+
+
+libdatastruct implements generic data structures like chained
+lists and AVL trees, in a memory-efficient and CPU-efficient way.
+
+
+ Compiling
+
+
+ - Use #include <skalibs/datastruct.h>
+ - You can also use the lower-level headers included by skalibs/datastruct.h instead.
+
+
+ Programming
+
+
+FIXME: to be completed.
+
+
+
+
diff --git a/doc/librandom/index.html b/doc/librandom/index.html
new file mode 100644
index 0000000..b721594
--- /dev/null
+++ b/doc/librandom/index.html
@@ -0,0 +1,113 @@
+
+
+
+
+ skalibs: the random library interface
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The random library interface
+
+
+librandom is a small library designed to provide an
+interface to some reasonable-quality pseudorandom number
+generation. Some libcs have a bad
+random() implementation; librandom is designed
+to use system pseudorandom number generation when it's provided
+via /dev/random and /dev/urandom, and to use
+a good default PRNG otherwise.
+
+
+
+ librandom also supports
+EGD. If you have built
+skalibs with --enable-egd, then the librandom
+primitives will try and connect to an EGD service to get random bytes
+if there is no kernel-based entropy generator such as /dev/random.
+If the EGD connection fails, a SURF PRNG is used.
+
+
+ Compiling
+
+
+ - Use #include <skalibs/random.h>
+
+
+ Programming
+
+
+ You should refer to the skalibs/random.h header for the exact
+function prototypes.
+
+
+ High quality, cryptographically strong random data
+
+
+ unsigned char c ;
+ unsigned int max ;
+ unsigned int n ;
+ unsigned int b ;
+ char data[at least b] ;
+ int r ;
+
+ goodrandom_init() ;
+ c = goodrandom_char() ;
+ n = goodrandom_int(max) ;
+ r = goodrandom_string(data, b) ;
+ goodrandom_finish() ;
+
+
+
+ goodrandom_init() becomes optional with skalibs-0.43.
+ It is recommended that you let the library perform cleanups after you
+have used it, by calling goodrandom_finish().
+
+
+
+ - goodrandom_char() returns a random character
+ - goodrandom_int(max) returns a random integer
+between 0 and max-1
+ - goodrandom_string(data, b) puts
+b random bytes in data, which must be preallocated.
+It returns b if it succeeds, or a non-negative integer lesser
+than b if it fails for any reason.
+
+
+
+ If you have neither /dev/random nor EGD, a software PRNG is
+used. This PRNG is based on the
+SURF function, which
+is unpredictable enough for most uses.
+
+
+ Lower quality random data
+
+
+ It works basically the same, by replacing goodrandom_* with
+badrandom_*. It uses /dev/urandom on systems that
+support it; on systems that do not, but support EGD, non-blocking calls
+to EGD are made ; if that is not enough, or EGD is not supported,
+the SURF generator is used.
+
+
+
+ The point of badrandom is to get random bytes instantly,
+even at the expense of quality; whereas goodrandom always returns
+high-quality random bytes, but may block if entropy is insufficient. In
+practice, in spite of its name, badrandom will return quite
+unpredictable pseudo-random data, so goodrandom should be used
+only when paranoia is the rule and blocking is an option.
+
+
+
+
diff --git a/doc/libskarnet.html b/doc/libskarnet.html
new file mode 100644
index 0000000..9c29514
--- /dev/null
+++ b/doc/libskarnet.html
@@ -0,0 +1,100 @@
+
+
+
+
+ skalibs: the skarnet library interface
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ The skarnet library interface
+
+
+ libskarnet is the library exported by skalibs; both a static
+library and a shared library (if they are supported on your system) are
+available. Every skarnet.org binary needs this library.
+
+
+ Compiling
+
+
+ - Make sure the place you installed the skalibs header files in is in
+your header directory list; the default is /usr/include,
+which is normally browsed by default by your C preprocessor.
+ - Use #include <skalibs/foobar.h> where
+foobar.h is the header you need.
+
+ - The skalibs/skalibs.h header is the general entry
+point that will declare the near-entirety of the functions, variables
+and constants in skalibs. Including this header
+in your source files whenever you need a skalibs function will work;
+however, it is rather heavy, and you might want to include lower-level
+headers instead to reduce compilation time.
+
+
+
+
+ Linking
+
+
+ - For static linking:
+ add /usr/lib/skalibs, or wherever you installed
+your .a files, to your library directory list.
+ - For dynamic linking:
+ make sure the place you installed the libskarnet.so shared library in
+is in your shared library directory list; the default is /lib,
+which is normally browsed by default by your build-time and run-time linker.
+If you are using another place than the default (for instance, if you are
+using the slashpackage convention), make sure to
+edit your ld.so.conf file so your linker can find this place, and
+to run ldconfig if needed.
+ - Take note of the place where your sysdeps directory has been
+installed: by default, it's /usr/lib/skalibs/sysdeps. Let's call
+it $sysdeps.
+ - Link with -lskarnet. If you are using socket functions, you
+will also need to link with -l$sysdeps/socket.lib. If you are using
+time functions such as tain_now(), you will also need to link with
+-l$sysdeps/tainnow.lib.
+
+
+
+ The skarnet library as a whole is big (833k for libskarnet.a and
+257k for libskarnet.so.2.0.0.0 on x86_64), but the utmost care has been
+given to separate functions so that linkers never pull in any more than they
+need. Linking against the static version of libskarnet actually produces
+very small executables, and if your libc is suited for that, since skalibs
+only uses very basic libc interfaces, it is very possible to produce small
+static binaries - in many cases, a static program written with skalibs APIs
+will be an order of magnitude smaller than the equivalent program written
+using libc's or other utility libraries' APIs.
+
+
+ Programming
+
+
+ The skalibs source code is divided into several subdirectories, each
+containing a logical unit of code implementing independent functions.
+
+
+
+- libstddjb: basic C API for system programming
+- libdatastruct: efficient C implementation of
+basic data structures like sets or trees
+- libstdcrypto: a few crypto primitives
+- librandom: cryptographically secure random or
+pseudorandom number generation
+- libunixonacid: more advanced C/Unix APIs,
+mainly for safe asynchronous interprocess communication
+- libbiguint: large integer arithmetic
+
+
+
+
diff --git a/doc/libstdcrypto/index.html b/doc/libstdcrypto/index.html
new file mode 100644
index 0000000..bbc5f08
--- /dev/null
+++ b/doc/libstdcrypto/index.html
@@ -0,0 +1,110 @@
+
+
+
+
+ skalibs: the stdcrypto library interface
+
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The stdcrypto library interface
+
+
+stdcrypto is a small collection of standard,
+public-domain cryptographic primitives. Currently, the following
+operations are provided:
+
+
+
+
+ Compiling
+
+
+ - Use #include <skalibs/stdcrypto.h>
+
+
+ Programming
+
+
+ You should refer to the skalibs/stdcrypto.h header and included headers
+for the exact function prototypes.
+
+
+
+RC4
+
+
+ RC4Schedule ctx ;
+ unsigned char const *key ;
+ unsigned int keylen ;
+ unsigned char const *in ;
+ unsigned char *out ;
+ unsigned int len ;
+
+ rc4_init(&ctx, key, keylen) ;
+ rc4(&ctx, in, out, len) ;
+
+
+
+ - rc4_init() initializes a RC4Schedule structure with a key key,
+of length keylen. It then computes and throws away the first RC4_THROWAWAY
+bytes, usually 100
+ - rc4() encrypts len bytes of in with the RC4 flow, and
+stores the results into out
+
+
+
+MD5
+
+
+ MD5Schedule ctx ;
+ char const *message ;
+ unsigned int messagelen ;
+ char digest[16] ;
+
+ md5_init(&ctx) ;
+ md5_update(&ctx, message, messagelen) ;
+ md5_final(&ctx, digest) ;
+
+
+
+ - md5_init() prepares a MD5Schedule structure for computation
+ - md5_update() adds message to the message to be digested
+ - md5_final() computes the digest
+
+
+
+SHA1
+
+
+ SHA1Schedule ctx ;
+ char const *message ;
+ unsigned int messagelen ;
+ unsigned char digest[20] ;
+
+ sha1_init(&ctx) ;
+ sha1_update(&ctx, message, messagelen) ;
+ sha1_final(&ctx, digest) ;
+
+
+
+ - sha1_init() prepares a SHA1Schedule structure for computation
+ - sha1_update() adds message to the message to be digested
+ - sha1_final() computes the digest
+
+
+
+
diff --git a/doc/libstddjb/alloc.html b/doc/libstddjb/alloc.html
new file mode 100644
index 0000000..e17fcc7
--- /dev/null
+++ b/doc/libstddjb/alloc.html
@@ -0,0 +1,98 @@
+
+
+
+
+ skalibs: the alloc library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The alloc library interface
+
+
+ The following functions are declared in the skalibs/alloc.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ alloc is the skalibs heap memory manager. It's actually a
+wrapper for the
+malloc()
+series of functions; it unifies a few system-dependent malloc
+behaviours. It's also the API to implement and preload if for some
+reason you need to plug in your own allocator: replacing alloc()
+is much easier than replacing malloc() safely.
+
+
+
+ As a general rule, you should not be using the alloc
+interface directly. Allocating and freeing individual cells
+in the heap is a recipe for heap fragmentation, as well as cell
+tracking nightmares leading to memory leaks. You should use
+the higher-level stralloc and
+genalloc interfaces to handle dynamic
+arrays of objects.
+
+
+
+ C's lack of automatic management of heap memory is not a drawback: it's
+a feature of the language. It allows for code that is one or two orders
+of magnitude faster than the equivalent in a higher-level language,
+and very low on resources consumption. However, it requires more attention
+from the programmer. Good APIs can significantly reduce the difficulty of
+keeping track of every heap-allocated cell, and every smart programmer
+should favor them over basic interfaces like malloc().
+
+
+
+ alloc is used internally by skalibs to implement
+stralloc, and nowhere else.
+
+
+ Functions
+
+
+ char *alloc (unsigned int len)
+Allocates a block of len bytes in the heap and returns a pointer
+to the start of the block (or NULL if it failed). Though the pointer type
+is char *, the block of memory is correctly aligned for any type
+of object. If len is 0, the function returns a pointer that
+cannot be written to, but that is not null. Note that this is
+different from the required C99 behaviour for malloc().
+
+
+
+ void alloc_free (void *p)
+Frees the block of heap memory pointed to by p.
+
+
+
+ int alloc_realloc (char **p, unsigned int newlen)
+Redimension the block of heap memory pointed to by *p to
+newlen bytes. The block may have to be moved, in which case
+*p will be modified. Normally returns 1; if an error occurred,
+returns 0 and sets errno, and neither *p nor its contents are
+modified.
+
+
+
+ int alloc_re (char **p, unsigned int oldlen, unsigned int newlen)
+Legacy interface for reallocation. It works like alloc_realloc,
+except that the original block length must be provided as the oldlen
+argument.
+
+
+
+
diff --git a/doc/libstddjb/allreadwrite.html b/doc/libstddjb/allreadwrite.html
new file mode 100644
index 0000000..847c4e3
--- /dev/null
+++ b/doc/libstddjb/allreadwrite.html
@@ -0,0 +1,145 @@
+
+
+
+
+ skalibs: the allreadwrite library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The allreadwrite library interface
+
+
+ The following functions are declared in the skalibs/allreadwrite.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ allreadwrite is a set of IO function helpers. It's the
+basis for safe reading and writing, either in blocking or in
+non-blocking mode. The buffer interface
+relies heavily on allreadwrite.
+
+
+
+ Unless the IO you need is very simple, you generally should not
+be using the allreadwrite functions directly; you should
+use higher-level APIs such as bufalloc.
+
+
+ Function types
+
+
+ typedef int iofunc_t (int fd, char *buf, unsigned int len)
+This is the simplified type of IO functions such as
+read()
+and
+write().
+Unless your system's int is 64-bit, skalibs - which has been
+optimized for small systems - does not support IO operations of more than
+2 GB of data, for the sake of simplicity. In any case, it's always
+possible to send data in several smaller chunks.
+
+
+
+ typedef unsigned int alliofunc_t (int fd, char *buf, unsigned int len)
+This is the type of an IO operation that expects all of its
+len bytes to be sent or received, and that will loop around a
+lower-level IO function until either len bytes have been
+transmitted or an error has occurred. The return value is the actual
+number of transmitted bytes; if this value is lesser than len,
+it means that an error has occurred and errno is set.
+
+
+ Functions
+
+
+ int sanitize_read (int r)
+Reading functions such as read() and fd_read return
+a positive number when they succeed, -1 when they fail, and 0 when they
+read an EOF. No data available on the descriptor when reading in
+non-blocking mode is treated as a failure: -1 EWOULDBLOCK. But sometimes
+(namely, in asynchronous IO loops) it's preferrable to handle EOF as an
+exception condition and EWOULDBLOCK as a normal condition.
+sanitize_read(), when applied to the result of a basic reading
+function, returns 0 if r is -1 and errno is EWOULDBLOCK (or
+EAGAIN). If r is zero, it returns -1 EPIPE. Else it returns r.
+
+
+
+ (No system reading function can ever set errno to EPIPE, and the
+semantics are appropriate, so EPIPE is a good candidate to signal EOF
+on reading.)
+
+
+
+ unsigned int allreadwrite (iofunc_t *f, int fd, char *s, unsigned int len)
+*f must be a basic reading or writing function such as
+fd_read or fd_write. allreadwrite() performs
+*f on fd, s and len until len
+bytes have been read or written, or until an error occurs. It returns the
+total number of handled bytes, and sets errno if this number is not
+len. allreadwrite may block if fd is in
+blocking mode; if fd is in non-blocking mode, it might
+set errno to EWOULDBLOCK or EAGAIN.
+
+
+
+ int fd_read (int fd, char *s, unsigned int len)
+Safe wrapper around the
+read()
+function.
+
+
+
+ int fd_write (int fd, char const *s, unsigned int len)
+Safe wrapper around the
+write()
+function.
+
+
+
+ int fd_recv (int fd, char *s, unsigned int len, unsigned int flags)
+Safe wrapper around the
+recv()
+function.
+
+
+
+ int fd_send (int fd, char const *s, unsigned int len, unsigned int flags)
+Safe wrapper around the
+send()
+function.
+
+
+
+ unsigned int allread (int fd, char *s, unsigned int len)
+Equivalent to allreadwrite(&fd_read, fd, s, len)
: attempts
+to read len bytes from fd into s, looping around
+fd_read() if necessary, until either len bytes are read or
+an error occurs. EOF is reported as EPIPE.
+
+
+
+ unsigned int allwrite (int fd, char const *s, unsigned int len)
+Equivalent to allreadwrite((iofunc_t *)&fd_write, fd, s, len)
:
+attempts to write len bytes from s to fd, looping
+around fd_write() if necessary, until either len bytes are
+written or an error occurs.
+
+
+
+
diff --git a/doc/libstddjb/bitarray.html b/doc/libstddjb/bitarray.html
new file mode 100644
index 0000000..1f88c3d
--- /dev/null
+++ b/doc/libstddjb/bitarray.html
@@ -0,0 +1,131 @@
+
+
+
+
+ skalibs: the bitarray library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The bitarray library interface
+
+
+ The following functions are declared in the skalibs/bitarray.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ bitarray is a set of primitives to operate efficiently on
+large bitfields.
+
+
+
+ A bitfield is represented by a pre-allocated block of
+unsigned char; bitarray does not care if that
+block has been BSS-, stack- or heap-allocated. Bitfields that
+can grow in size should be stored in a
+stralloc.
+
+
+
+ Bits in a bitfield of length n are numbered from 0 to n-1.
+
+
+ Functions
+
+
+ unsigned int bitarray_div8 (unsigned int n)
+Returns the minimum number of bytes needed to store a field of n bits.
+
+
+
+
+ void bitarray_clearsetn (unsigned char *s, unsigned int start, unsigned int len, int h)
+Sets (if h is nonzero) or clears (if h is zero)
+len bits in field s, starting at bit start.
+
+
+
+ void bitarray_clearn (unsigned char *s, unsigned int start, unsigned int len)
+Clears len bits in field s, starting at bit start.
+
+
+
+ void bitarray_setn (unsigned char *s, unsigned int start, unsigned int len)
+Sets len bits in field s, starting at bit start.
+
+
+
+ int bitarray_peek (unsigned char const *s, unsigned int n)
+Returns the value of the nth bit in field s.
+
+
+
+ void bitarray_poke (unsigned char *s, unsigned int n, int h)
+Sets (if h is nonzero) or clears (if h is zero)
+the nth bit in field s.
+
+
+
+ void bitarray_clear (unsigned char *s, unsigned int n)
+Clears the nth bit in field s.
+
+
+
+ void bitarray_set (unsigned char *s, unsigned int n)
+Sets the nth bit in field s.
+
+
+
+ int bitarray_testandpoke (unsigned char *s, unsigned int n, int h)
+Sets (if h is nonzero) or clears (if h is zero)
+the nth bit in field s,
+and returns the previous value of that bit.
+
+
+
+ int bitarray_testandclear (unsigned char *s, unsigned int n)
+Clear the nth bit in field s,
+and returns the previous value of that bit.
+
+
+
+ int bitarray_testandset (unsigned char *s, unsigned int n)
+Sets the nth bit in field s,
+and returns the previous value of that bit.
+
+
+
+ unsigned int bitarray_first (unsigned char const *s, unsigned int len, int h)
+Returns the number of the first set (if h is nonzero) or clear
+(if h is zero) bit in s, len being
+the total number of bits. If all bits in s are the negation of
+h, then len is returned.
+
+
+
+ unsigned int bitarray_firstclear (unsigned char const *s, unsigned int len)
+Returns the number of the first clear bit in s, len being
+the total number of bits. If all bits in s are set, len is returned.
+
+
+
+ unsigned int bitarray_firstset (unsigned char const *s, unsigned int len)
+Returns the number of the first set bit in s, len being
+the total number of bits. If all bits in s are clear, len is returned.
+
+
+
+
diff --git a/doc/libstddjb/djbtime.html b/doc/libstddjb/djbtime.html
new file mode 100644
index 0000000..45876c8
--- /dev/null
+++ b/doc/libstddjb/djbtime.html
@@ -0,0 +1,201 @@
+
+
+
+
+ skalibs: the djbtime library interface
+
+
+
+
+
+
+
+libstddjb
+skalibs
+skalibs
+Software
+skarnet.org
+
+
+ The djbtime library interface
+
+
+ The following functions are declared in the skalibs/djbtime.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ djbtime is a set of functions to convert
+tai_t and tain_t structures, and
+TAI time, from and to
+other time formats and user-friendly representations.
+
+
+ The /etc/leapsecs.dat file
+
+
+ User-friendly time is calculated from UTC. Internal time computations
+should be performed on TAI time - because TAI flows linearly whereas
+UTC does not. To convert between UTC and TAI time, you need a
+leap second table. skalibs provides such a file in its
+src/etc/leapsecs.dat subdirectory, which is copied
+to /etc/leapsecs.dat at installation time (unless you specify
+a --prefix or --datadir option to configure).
+The /etc/leapsecs.dat file must remain accessible
+on your system, else time conversions will not be computed
+properly.
+
+
+ Data structures
+
+
+ - TAI time with 1-second precision is represented as a tai_t.
+ - TAI time with more precision is represented as a tain_t.
+ - UTC time is represented as an unsigned 64-bit integer
+equal to 2^62 added to the number of seconds since the Epoch. It's a trivial extension of
+the standard 32-bit Unix time that will expire in 2038.
+ - Broken-down GMT or local time with more than a 1-second precision is stored in a
+localtmn_t structure, containing a struct tm tm
+field and an unsigned long nano field.
+
+
+ Functions
+
+ UTC
+
+
+ int utc_from_tai (uint64 *u, tai_t const *t)
+Converts the absolute TAI64 time in *t to an UTC time, stored in
+*u as an unsigned 64-bit integer. *u is actually 2^62
+plus the number of seconds since the Epoch.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: the leap second table cannot be found).
+
+
+
+ int tai_from_utc (tai_t *t, uint64 u)
+Converts the UTC time in u, stored
+as an unsigned 64-bit integer (2^62 plus the number of seconds since
+the Epoch), to a TAI64 time in *t.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: the leap second table cannot be found).
+
+
+ NTP
+
+
+ int ntp_from_tain (uint64 *ntp, tain_t const *a)
+Converts the absolute TAI64N time in *a to a 64-bit NTP timestamp,
+stored in *ntp. The higher 32 bits of *ntp represent a number
+of seconds ; the lower 32 bits are the fractional part of the timestamp.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: the leap second table cannot be found, or
+*a cannot be represented in the valid NTP range).
+
+
+
+ int tain_from_ntp (tain_t *a, uint64 ntp)
+Converts the NTP timestamp in ntp to a TAI64N time in
+*a.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: the leap second table cannot be found).
+
+
+ Local time
+
+
+ The following functions convert time between an internal representation
+and a broken-down struct tm. The
+--enable-right-tz configure option is used in
+determining how the conversion should proceed. If the --enable-tai-clock
+and --enable-right-tz configure options have been both enabled
+or both disabled, everything is naturally
+converted as it should be. If only one of them has been enabled,
+unholy magic happens here
+to get the correct broken-down time despite the timezone definition being
+wrong.
+
+
+
+ int localtm_from_tai (struct tm *tm, tai_t const *t, int lo)
+Converts the TAI time in *t to broken-down GMT (if
+lo is zero) or local (if lo is nonzero) time in
+*tm.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: *t cannot be validly represented
+in a struct tm).
+
+
+
+ int localtm_from_utc (struct tm *tm, uint64 u, int lo)
+Converts the UTC time in u to broken-down GMT (if
+lo is zero) or local (if lo is nonzero) time in
+*tm.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: u cannot be validly represented
+in a struct tm).
+
+
+
+ int localtm_from_sysclock (struct tm *tm, uint64 u, int lo)
+Converts the time in u to broken-down GMT (if
+lo is zero) or local (if lo is nonzero) time in
+*tm. u will be interpreted as a TAI-10 value (with
+--enable-tai-clock) or as a UTC value (without --enable-tai-clock).
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs (for instance: u cannot be validly represented
+in a struct tm).
+
+
+
+ int utc_from_localtm (uint64 *u, struct tm const *tm)
+Converts the broken-down local time in *tm to an UTC value
+in *u.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs.
+
+
+
+ int tai_from_localtm (tai_t *t, struct tm const *tm)
+Converts the broken-down local time in *tm to a TAI value
+in *t.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs.
+
+
+
+ int sysclock_from_localtm (uint64 *u, struct tm const *tm)
+Converts the broken-down local time in *tm to a value
+in *u - either TAI-10 or UTC depending on your system clock.
+The function returns 1 if it succeeds, or 0 (and sets errno) if an
+error occurs.
+
+
+
+ The following functions use the localtmn_t type to hold both
+a broken-down time and a nanosecond count:
+
+
+typedef struct localtmn_s localtmn_t, *localtmn_t_ref ;
+struct localtmn_s
+{
+ struct tm tm ;
+ uint32 nano ;
+} ;
+
+
+
+ The prototypes are self-explaining:
+
+
+
+ int localtmn_from_tain (localtmn_t_ref tmn, tain_t const *a, int lo) ;
+int tain_from_localtmn (tain_t *a, localtmn_t const *tmn) ;
+int localtmn_from_sysclock (localtmn_t_ref tmn, tain_t const *a, int lo) ;
+int sysclock_from_localtmn (tain_t *a, localtmn_t const *tmn) ;
+
+
+
+
diff --git a/doc/libstddjb/djbunix.html b/doc/libstddjb/djbunix.html
new file mode 100644
index 0000000..0d6c89f
--- /dev/null
+++ b/doc/libstddjb/djbunix.html
@@ -0,0 +1,760 @@
+
+
+
+
+ skalibs: the djbunix library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The djbunix library interface
+
+
+ The following functions are declared in the skalibs/djbunix.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ djbunix is an alternative API to management of basic Unix
+concepts: file descriptors, files, environment, and so on. It is a
+rather chaotic mix of safe wrappers
+around Unix system calls, better reimplementations of standard libc
+functionalities, and higher-level manipulations of Unix concepts.
+
+
+
+ Understanding djbunix is essential to understanding any piece
+of code depending on skalibs.
+
+
+ Functions
+
+ Basic fd operations
+
+
+ int coe (int fd)
+Sets the close-on-exec flag on fd.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int uncoe (int fd)
+Clears the close-on-exec flag on fd.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int ndelay_on (int fd)
+Sets the O_NONBLOCK flag on fd: sets it to non-blocking mode.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int ndelay_off (int fd)
+Clears the O_NONBLOCK flag on fd: sets it to blocking mode.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int pipenb (int *p)
+Like
+pipe(),
+but both ends of the created pipe are in non-blocking mode.
+
+
+
+ int pipecoe (int *p)
+Like
+pipe(),
+but both ends of the created pipe are close-on-exec.
+
+
+
+ int pipenbcoe (int *p)
+Like
+pipe(),
+but both ends of the created pipe are in non-blocking mode and close-on-exec.
+
+
+
+ int fd_copy (int to, int from)
+Copies the open fd from to number to. to
+must not refer to an already open fd.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int fd_copy2 (int to1, int from1, int to2, int from2)
+Copies the open fd from1 to number to2. Also copies
+from2 to to2 at the same time.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int fd_move (int to, int from)
+Moves the open fd from to number to. to
+must not refer to an already open fd, unless it's equal to from.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int fd_move2 (int to1, int from1, int to2, int from2)
+Moves the open fd from to number to. Also moves
+from2 to to2 at the same time. This is useful for instance
+when you want to swap two fds: fd_move2 will handle the situation
+correctly.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int fd_close (int fd)
+Closes fd.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+This is a safe wrapper around
+close(),
+or rather as safe a wrapper as is possible to write: the close()
+specification does not allow a 100% safe behaviour. So, in rare cases
+it is possible for fd_close() to return 0 (instead of -1 EBADF)
+when it is provided an argument that is not an open fd. This should not
+be a problem, because giving wrong arguments to fd_close() is
+always a static programming error.
+
+
+
+ int fd_chmod (int fd, unsigned int mode)
+Safe wrapper around
+fchmod().
+
+
+
+ int fd_chown (int fd, unsigned int uid, unsigned int gid)
+Safe wrapper around
+fchown().
+This function requires root privileges.
+
+
+
+ int fd_sync (int fd)
+Safe wrapper around
+fsync().
+
+
+
+ int fd_chdir (int fd)
+Safe wrapper around
+fchdir().
+
+
+
+ int fd_cat (int from, int to)
+Synchronously copies data from fd from to fd to,
+until it encounters EOF or an error. Returns -1 (and sets errno) if
+it fails; returns the number of transmitted bytes if it gets an EOF.
+
+
+
+When the underlying OS allows it, zero-copy transmission is
+performed. Currently, the following zero-copy implementations are
+supported:
+
+
+
+ - splice(),
+in Linux 2.6.17 and later
+
+
+
+ unsigned int fd_catn (int from, int to, unsigned int n)
+Synchronously copies at most n bytes from fd from to fd to.
+Returns the total number of transmitted bytes; sets errno if this number
+is lesser than n. EOF is reported as EPIPE. See above for zero-copy
+transmission; zero-copy transmission is not attempted for less than 64k of data.
+
+
+
+ int fd_ensure_open (int fd, int w)
+If fd is not open, opens it to /dev/null,
+for reading if w is zero, and for writing otherwise.
+Returns 1 if it succeeds and 0 if it fails.
+
+
+
+ int fd_sanitize (void)
+Ensures stdin and stdout are open. If one of those
+file descriptors was closed, it now points to /dev/null.
+Returns 1 if it succeeds and 0 if it fails.
+
+
+
+ int lock_ex (int fd)
+Gets an exclusive advisory lock on fd. fd must point to
+a regular file, open for writing. Blocks until the lock can be obtained.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int lock_exnb (int fd)
+Gets an exclusive advisory lock on fd. fd must point to
+a regular file, open for writing.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails. If the lock
+is held and the function would block, it immediately returns with -1 EWOULDBLOCK.
+
+
+
+ int lock_sh (int fd)
+Gets a shared advisory lock on fd. fd must point to
+a regular file, open for reading. Blocks until the lock can be obtained.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int lock_shnb (int fd)
+Gets a shared advisory lock on fd. fd must point to
+a regular file, open for reading.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails. If the lock
+is held and the function would block, it immediately returns with -1 EWOULDBLOCK.
+
+
+
+ int lock_un (int fd)
+Releases a previously held lock on fd.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open2 (char const *file, unsigned int flags)
+Safe wrapper around
+open()
+when it takes 2 arguments.
+
+
+
+ int open3 (char const *file, unsigned int flags)
+Safe wrapper around
+open()
+when it takes 3 arguments.
+
+
+
+ int open_read (char const *file)
+Opens file in read-only, non-blocking mode.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open_readb (char const *file)
+Opens file in read-only, blocking mode.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+This call does not block. The
+open()
+system call is actually performed with the O_NONBLOCK option, and blocking mode
+is set afterwards; this behaviour allows for more transparent interactions
+with FIFOs.
+
+
+
+ int open_excl (char const *file)
+Opens file in write-only, non-blocking mode, with the
+additional O_EXCL and O_CREAT flags.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open_append (char const *file)
+Opens file in write-only, non-blocking mode, with the
+additional O_APPEND and O_CREAT flags.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open_trunc (char const *file)
+Opens file in write-only, non-blocking mode, with the
+additional O_TRUNC and O_CREAT flags.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open_create (char const *file)
+Opens file in write-only, non-blocking mode, with the
+additional O_CREAT flag.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+
+ int open_write (char const *file)
+Opens file in write-only, non-blocking mode.
+Returns a valid fd number if it succeeds, or -1 (and sets errno) if it fails.
+
+
+ Seek operations
+
+
+ long seek_cur (int fd)
+Returns the current file offset for descriptor fd.
+
+
+
+ int seek_set (int fd, long pos)
+Sets the current file offset for fd to pos.
+Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
+
+
+ Privilege management
+
+
+ int prot_readgroups (char const *name, gid_t *tab, unsigned int max)
+Reads the group database (normally /etc/group, but it can be
+altered via NSS) to get the list of supplementary groups for user name.
+Stores that list into the array pointed to by tab, which must be
+preallocated. Stores at most max elements into tab.
+Returns -1 and sets errno if it fails; else, returns the number of elements actually
+stored into tab.
+
+
+
+ int prot_grps (char const *name)
+Sets the kernel-maintained list of supplementary groups for the current process
+to the list of supplementary groups for user name according to the
+group database. This is a privileged operation.
+Returns -1 and sets errno if it fails; returns 0 if it succeeds.
+
+
+
+ int prot_gid (int gid)
+Alias to setgid.
+
+
+
+ int prot_uid (int uid)
+Alias to setuid.
+
+
+ Executable search and execution, and environment
+
+
+ void execvep (char const *file, char const *const *argv, char const *const *envp, char const *path)
+Executes into the executable file at file, with the command line
+set to argv and the environment set to envp.
+If file is not an absolute path, it is searched in the
+path string, which must contain a colon-separated list of
+search directories such as the contents of the PATH environment variable.
+The function returns if it fails, and sets errno to the most relevant
+error that happened.
+
+
+
+ void pathexec_run (char const *file, char const *const *argv, char const *const *envp)
+Performs execvep(file, argv, envp, path), path being the
+contents of the PATH environment variable. If PATH is not set, path
+is set to the contents of the conf-compile/conf-defaultpath file in
+the skalibs distribution.
+The function returns if it fails, and sets errno appropriately.
+
+
+
+ pathexec_run() is the standard skalibs API to perform an
+exec call with a path search. It is recommended that you use
+it instead of the Single Unix
+execvp() or
+execlp()
+functions, because execvp and execlp default to execution of
+the /bin/sh interpreter with file as an argument if they
+cannot find a suitable executable file, and this is:
+
+
+
+ - a security risk,
+ - probably not what you want.
+
+
+
+ execvep() and pathexec_run() just fail with ENOENT
+when they cannot find a file to exec into, which is the
+sensible behaviour.
+
+
+
+ void pathexec0_run (char const *const *argv, char const *const *envp)
+Performs pathexec_run(argv[0], argv, envp). If argv is empty, i.e.
+argv[0] is null, the process exits 0 instead. Rationale: executing
+the empty command line should amount to executing true, i.e.
+simply exiting 0.
+
+
+
+ void pathexec_r_name (char const *file, char const *const *argv, char const *const *envp, unsigned int envlen, char const *modifs, unsigned int modiflen)
+Alters envp (which does not have to be NULL-terminated, but the
+number envlen of elements must be provided) with the modifier
+string modifs of length modiflen, then performs
+pathexec_run(file, argv, altered-envp).
+
+
+
+ void pathexec_r (char const *const *argv, char const *const *envp, unsigned int envlen, char const *modifs, unsigned int modiflen)
+Same as pathexec_r_name, except that the file argument is read from argv[0].
+
+
+
+ int pathexec_env (char const *var, char const *value)
+Adds the "add variable var with value value" instruction
+(if value is not null) or the "unset var" instruction
+(if value is null) to a static hidden modifier string, used by the
+following three functions.
+Returns 1 if it succeeds and 0 (and sets errno) if it fails.
+
+
+
+ void pathexec_fromenv (char const *const *argv, char const *const *envp, unsigned int envlen)
+Performs pathexec_r() with the given arguments and the hidden modifier
+string.
+
+
+
+ void pathexec (char const *const *argv)
+Executes into the argv command line, with the current environment
+modified by the hidden modifier string.
+
+
+
+ void pathexec0 (char const *const *argv)
+Executes into the argv command line, with the current environment
+modified by the hidden modifier string. If this command line is empty,
+exit 0 instead.
+
+
+
+ The env library interface provides additional functions
+to manipulate modifier strings and environments.
+
+
+ Forking children
+
+
+ int doublefork ()
+Performs a double fork. Returns -1 if it fails (and
+sets errno, EINTR meaning that the intermediate process
+was killed by a signal), 0 if the current process is the grandchild,
+and the grandchild's PID if the current process is the parent.
+
+
+
+ pid_t child_spawn0 (char const *file, char const *const *argv, char const *const *envp)
+Forks and executes a child as with pathexec_run(file, argv, envp).
+Returns 0 if it fails, and the pid of the child if it succeeds.
+Implemented via posix_spawn()
+on systems that support it.
+
+
+
+ pid_t child_spawn1 (char const *file, char const *const *argv, char const *const *envp, int *fd, int w)
+Like child_spawn0(), except that a pipe is created between the child's
+stdin (if w is 0) or stdout (if w is nonzero) and the parent.
+The parent's end of the pipe will be stored in *fd.
+
+
+
+ pid_t child_spawn (char const *file, char const *const *argv, char const *const *envp, int *fds, unsigned int nfds)
+More generic spawning function. fds must point to an array of at least nfds ints;
+file descriptors reading from or writing to the child will be stored there. The function returns
+0 on failure or the pid of the child on success.
+
+
+ - If nfds is 0, then the function behaves like child_spawn0, except
+all signals will be reset to the default behaviour in the child
+ - If nfds is 1, then fds[0] will contain a Unix domain socket
+connected to the child's stdin and stdout.
+ - If nfds is 2 or more, then fds will contain pipes between the
+child and the parent. The parent will read on even-numbered ones (starting on fds[0])
+and write on odd-numbered ones.
+
+
+ Waiting for children
+
+
+ unsigned int wait_reap ()
+Instantly reaps all the pending zombies, without blocking, without a look at
+the exit codes.
+Returns the number of reaped zombies.
+
+
+
+ int waitn (pid_t *pids, unsigned int n)
+Waits until all processes whose PIDs are stored in the
+pids array, of size n, have died.
+Returns 1 if it succeeds, and 0 (and sets errno) if it fails. The
+pid array is not guaranteed to be unchanged.
+
+
+
+ int waitn_reap (pid_t *pids, unsigned int n)
+Instantly reaps all zombies whose PIDs are stored in the
+pids array, of size n.
+Returns -1 (and sets errno) if it fails, and the number of reaped
+zombies if it succeeds. The pid array is not guaranteed to
+be unchanged.
+
+
+
+ int wait_nohang (int *wstat)
+Instantly reaps one zombie, and stores the status information into
+*wstat.
+Returns the PID of the reaped zombie if it succeeds, 0 if there was
+nothing to reap (and the current process still has children), -1 ECHILD
+if there was nothing to reap (and the current process has no children),
+or -1 (and sets errno) if it fails.
+
+
+
+ int waitpid_nointr (pid_t pid, int *wstat, int flags)
+Safe wrapper around
+waitpid().
+
+
+
+ int wait_pid_nohang (pid_t pid, int *wstat)
+Instantly reaps an undetermined number of zombies until it finds pid.
+Stores the status information for dead pid into *wstat.
+Returns pid if it succeeds, 0 if there was
+nothing to reap (and the current process still has children), -1 ECHILD
+if there was nothing to reap (and the current process has no children),
+or -1 (and sets errno) if it fails.
+
+
+
+ int wait_pids_nohang (pid_t const *pids, unsigned int len, int *wstat)
+Instantly reaps an undetermined number of zombies until it finds one whose
+PID is in the pids array, of size len.
+Stores the status information for that dead process into *wstat.
+Returns the index of the found PID in pids, starting at 1.
+Returns 0 if there was
+nothing to reap (and the current process still has children), -1 ECHILD
+if there was nothing to reap (and the current process has no children),
+or -1 (and sets errno) if it fails.
+
+
+
+ When asynchronously dealing with a child (resp. several children) and
+getting a SIGCHLD - which should be handled via a
+selfpipe - it is generally a good idea to
+use the wait_pid_nohang() (resp. wait_pids_nohang())
+function over the basic Unix APIs. This allows a program to:
+
+
+
+ - Automatically and silently take care of children it does not know
+it has. This situation can happen when a process forks and the parent
+execs. When the child dies, the new parent process has to drag the
+"zombie bastard" along, which is ugly; wait_pids_nohang()
+prevents this.
+ - Still take appropriate care of its legitimate children, in
+any order.
+
+
+ Reading and writing whole files
+
+
+ int slurp (stralloc *sa, int fd)
+Slurps the contents of open descriptor fd into
+the *sa stralloc. If you are
+doing this, you should either have full control over the slurped
+file, or run your process with suitable
+limits
+to the amount of heap memory it can get.
+The function returns 1 if it succeeds, or 0 (and sets errno) if it fails.
+
+
+
+ int openslurpclose (stralloc *sa, char const *file)
+Slurps the contents of file file into *sa.
+Returns 1 if it succeeds, and 0 (and sets errno) if it fails.
+
+
+
+ int openreadclose (char const *file, stralloc *sa, unsigned int dummy)
+Legacy interface for openslurpclose(sa, file)
. The dummy
+argument is unused. Returns 0 if it succeeds, and -1 (and sets errno) if it fails.
+
+
+
+ int openreadnclose (char const *file, char *s, unsigned int n)
+Reads at most n bytes from file file into preallocated
+buffer s. Returns -1 (and sets errno) if it fails; else returns the
+number of read bytes. If that number is not n, errno is set to EPIPE.
+
+
+
+ int openreadfileclose (char const *file, stralloc *sa, unsigned int n)
+Reads at most n bytes from file file into the *sa
+stralloc, which is grown (if needed) to just accommodate the file
+size. Returns 1 if it succeeds and 0 (and sets errno) if it fails.
+
+
+
+ int openwritenclose_unsafe_internal (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, unsigned char dosync)
+Writes the n bytes stored at s into file file.
+The previous contents of file are destroyed even if the function
+fails. If dosync is nonzero, the new contents of file
+are synced to disk before the function returns. If dev and ino
+are not null, they're used to store the device and inode number of file.
+The function returns 1 if it succeeds, or 0 (and sets errno) if it fails.
+
+
+
+ int openwritenclose_unsafe (char const *file, char const *s, unsigned int len)
+int openwritenclose_unsafe_sync (char const *file, char const *s, unsigned int len)
+int openwritenclose_unsafe_devino (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino)
+int openwritenclose_unsafe_devino_sync (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino)
+Trivial shortcuts around openwritenclose_unsafe_internal(). The
+reader can easily figure out what they do.
+
+
+
+ int openwritenclose_suffix_internal (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, unsigned char dosync, char const *suffix)
+Writes the n bytes stored at s into file file,
+by first writing into filesuffix and atomically renaming
+filesuffix to file. IOW, the old contents of file
+are preserved if the operation fails, and are atomically replaced with the
+new contents if the operation succeeds.
+If dosync is nonzero, the new contents of filesuffix
+are synced to disk before the atomic replace. If dev and ino
+are not null, they're used to store the device and inode number of file.
+The function returns 1 if it succeeds, or 0 (and sets errno) if it fails.
+
+
+
+ int openwritenclose_suffix (char const *file, char const *s, unsigned int len, char const *suffix)
+int openwritenclose_suffix_sync (char const *file, char const *s, unsigned int len, char const *suffix)
+int openwritenclose_suffix_devino (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)
+int openwritenclose_suffix_devino_sync (char const *file, char const *s, unsigned int len, uint64 *dev, uint64 *ino, char const *suffix)
+Trivial shortcuts around openwritenclose_suffix_internal(). The
+reader can easily figure out what they do.
+
+
+ Filesystem deletion
+
+
+The following operations are not atomic, so if they fail, the
+relevant subtree might end up partially deleted.
+
+
+
+ int rm_rf (char const *path)
+Deletes the filesystem subtree at path.
+Returns 0 if it succeeds or -1 (and sets errno) if it fails.
+
+
+
+ int rm_rf_tmp (char const *path, stralloc *tmp)
+Deletes the filesystem subtree at path, using *tmp
+as heap-allocated temporary space.
+Returns 0 if it succeeds or -1 (and sets errno) if it fails.
+
+
+
+ int rm_rf_in_tmp (stralloc *tmp, unsigned int n)
+Deletes a filesystem subtree, using *tmp
+as heap-allocated temporary space.
+Returns 0 if it succeeds or -1 (and sets errno) if it fails.
+When the function is called, *tmp must contain the
+null-terminated name of the subtree to delete at offset n.
+
+
+
+ int rmstar (char const *dir)
+Deletes all the filesystem subtrees in directory dir.
+Returns 0 if it succeeds or -1 (and sets errno) if it fails.
+
+
+
+ int rmstar_tmp (char const *dir, stralloc *tmp)
+Deletes all the filesystem subtrees in directory dir,
+using *tmp as heap-allocated temporary space.
+Returns 0 if it succeeds or -1 (and sets errno) if it fails.
+
+
+ Variable length wrappers around Single Unix calls
+
+
+ int sarealpath (stralloc *sa, char const *path)
+Resolves path into a symlink-free absolute path, appending
+the result to the *sa
+stralloc.
+Returns 0 if it succeeds and -1 (and sets errno) if it fails.
+
+
+
+ int sarealpath_tmp (stralloc *sa, char const *path, stralloc *tmp)
+Resolves path into a symlink-free absolute path, appending
+the result to *sa. Uses *tmp as heap-allocated
+temporary space.
+Returns 0 if it succeeds and -1 (and sets errno) if it fails.
+
+
+
+ int sabasename (stralloc *sa, char const *s, unsigned int len)
+Appends the basename of filename s (of length len)
+to *sa.
+Returns 1 if it succeeds and 0 (and sets errno) if it fails.
+
+
+
+ int sadirname (stralloc *sa, char const *s, unsigned int len)
+Appends the dirname of filename s (of length len)
+to *sa.
+Returns 1 if it succeeds and 0 (and sets errno) if it fails.
+
+
+
+ int sagetcwd (stralloc *sa)
+Appends the current working directory to *sa.
+Returns 0 if it succeeds and -1 (and sets errno) if it fails.
+
+
+
+ int sareadlink (stralloc *sa, char const *link)
+Appends the contents of symbolic link link to *sa.
+Returns 0 if it succeeds and -1 (and sets errno) if it fails.
+
+
+
+ int sagethostname (stralloc *sa)
+Appends the machine's hostname to *sa.
+Returns 0 if it succeeds and -1 (and sets errno) if it fails.
+
+
+ Temporization
+
+
+ void deepsleepuntil (tain_t const *deadline, tain_t *stamp)
+Sleeps until the absolute time represented by the
+tain_t *deadline. *stamp
+must contain the current time. When the function returns, *stamp
+has been updated to reflect the new current time.
+
+
+
+ void deepsleep (unsigned int n)
+Sleeps n seconds. Signals received during that time are handled,
+but do not interrupt the sleep.
+
+
+
+ void deepmillisleep (unsigned long n)
+Sleeps n milliseconds. Signals received during that time are handled,
+but do not interrupt the sleep.
+
+
+
+
diff --git a/doc/libstddjb/gccattributes.html b/doc/libstddjb/gccattributes.html
new file mode 100644
index 0000000..6ee71ef
--- /dev/null
+++ b/doc/libstddjb/gccattributes.html
@@ -0,0 +1,48 @@
+
+
+
+
+ skalibs: the gccattributes header
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The skalibs/gccattributes.h header
+
+
+ skalibs/gccattributes.h is a set of wrappers around
+gcc
+attributes (duh). It defines macros that are always valid, and
+that have no effect if the compiler is not gcc or the used version
+of gcc does not support the wanted attribute.
+
+
+
+ For instance:
+
+
+
+ extern unsigned int str_len (char const *) gccattr_pure ;
+
+
+
+ defines the str_len function as pure if it is
+supported.
+
+
+
+ The source code is self-explanatory.
+
+
+
+
diff --git a/doc/libstddjb/genalloc.html b/doc/libstddjb/genalloc.html
new file mode 100644
index 0000000..b9ab934
--- /dev/null
+++ b/doc/libstddjb/genalloc.html
@@ -0,0 +1,46 @@
+
+
+
+
+ skalibs: the genalloc library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The genalloc library interface
+
+
+ The following functions are declared in the skalibs/genalloc.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ genalloc is the skalibs way of handling dynamic arrays, i.e.
+dynamically growing arrays of fixed-size objects. Any array that needs
+to be stored in heap memory can be implemented via genalloc.
+
+
+
+ Most genalloc functions are just macro calls around
+stralloc functions.
+
+
+
+ The genalloc.h header is actually very simple and the
+prototypes there are self-explaining.
+
+
+
+
diff --git a/doc/libstddjb/genwrite.html b/doc/libstddjb/genwrite.html
new file mode 100644
index 0000000..33ff4d3
--- /dev/null
+++ b/doc/libstddjb/genwrite.html
@@ -0,0 +1,98 @@
+
+
+
+
+ skalibs: the genwrite library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The genwrite library interface
+
+
+ The following functions are declared in the skalibs/genwrite.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ genwrite is syntactic sugar to help write functions that might
+want to write either to memory or to a file descriptor.
+
+
+
+ Writing to memory is achieved via appending to a
+stralloc; writing to a file descriptor is achieved
+via appending to a buffer or a
+bufalloc.
+
+
+ Usage
+
+
+ A genwrite_t structure contains a pointer to a function that writes
+stuff to the target without flushing it
+(which can be genwrite_put_stralloc, genwrite_put_buffer,
+genwrite_put_bufalloc or any
+compatible user-defined function) in .put, a pointer to a function
+that flushes the target (which can be genwrite_flush_stralloc,
+genwrite_flush_buffer, genwrite_flush_bufalloc or any
+compatible user-defined function) in .flush, and a pointer to
+the target writing structure in .target.
+
+
+
+ Users should define a genwrite_t first, using the provided functions,
+and give applications a pointer gp to this structure. To write len
+characters at position s to the target, the application should then call
+(*gp->put)(gp->target, s, len)
. When it is done writing, the
+application should call (*gp->flush)(gp->target)
to flush the
+output.
+
+
+
+ genwrite_stdout and genwrite_stderr are predefined; they
+write to buffer_1 and buffer_2 respectively.
+
+
+ Macros
+
+
+ GENWRITE_STRALLOC_INIT(sa)
+Declares a genwrite_t writing to the stralloc *sa.
+
+
+
+ GENWRITE_BUFFER_INIT(b)
+Declares a genwrite_t writing to the buffer *b. Use
+of such a buffer might interact badly with nonblocking I/O.
+
+
+
+ GENWRITE_BUFALLOC_INIT(ba)
+Declares a genwrite_t writing to the bufalloc *ba.
+
+
+ Note
+
+
+Object-oriented programming in C is inefficient and cumbersome. It is
+usually possible to avoid it in Unix system programming, because Unix
+primitives are often generic enough. Unfortunately, it is not the case
+here: Unix does not provide an abstraction representing either a file
+or a memory buffer. So an object-oriented approach is unavoidable.
+
+
+
+
diff --git a/doc/libstddjb/index.html b/doc/libstddjb/index.html
new file mode 100644
index 0000000..e0853cc
--- /dev/null
+++ b/doc/libstddjb/index.html
@@ -0,0 +1,125 @@
+
+
+
+
+ skalibs: the stddjb library interface
+
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+www.skarnet.org
+
+
+ The stddjb library interface
+
+
+ libstddjb is the base, and the most important part, of skalibs.
+It is a set of general-purpose C functions wrapping some
+system calls, hiding some Unix portability problems, providing some
+basic low-level buffering functions and string handling, and generally
+offering a nice API to Unix programming - in many ways nicer and safer
+than the "standard" Unix APIs like stdio.h.
+
+
+
+ It is mostly based on some excellent code written and placed into the
+public domain by D. J. Bernstein.
+
+
+ Compiling
+
+
+ - The libstddjb functions are available under the skalibs/stddjb.h
+header, which includes a lot of lower-level headers. If you know what
+lower-level headers to use, you might speed up your compilation process by
+including them directly.
+
+
+ Programming
+
+
+
+
+ The following headers are automatically generated at compile-time, when the
+headers subsystem is made. The skalibs/stddjb.h file also
+includes them.
+
+
+
+ - skalibs/uint16.h: operations with 16-bit unsigned integers
+ - skalibs/uint32.h: operations with 32-bit unsigned integers
+ - skalibs/uint64.h: operations with 64-bit unsigned integers
+ - skalibs/ushort.h: portable helpers for the "unsigned short" basic type
+ - skalibs/uint.h: portable helpers for the "unsigned int" basic type
+ - skalibs/ulong.h: portable helpers for the "unsigned long" basic type
+ - skalibs/error.h: portable macros for errno management
+ - skalibs/gidstuff.h: helpers for the "gid_t" type
+ - skalibs/setgroups.h: stub for the setgroups() function, for systems that do not define it
+ - skalibs/ip46.h: IPv4/IPv6 abstraction layer
+
+
+
+ Additionally, stddjb.h also includes the following headers, which
+are not associated with any code and are mostly self-explanatory:
+
+
+
+ - skalibs/gccattributes.h: wrappers around a few GCC-specific optimizations
+ - skalibs/diuint.h: for associative arrays of unsigned integers
+ - skalibs/diuint32.h: for associative arrays of 32-bit unsigned integers
+ - skalibs/environ.h: declaration of the environ variable
+ - skalibs/nsig.h: the number of system signals, for systems that do not define it
+ - skalibs/nonposix.h: feature test macros for non-POSIX-compliant systems
+ - skalibs/siovec.h:
+iovec-like
+structure for scatter/gather IO operations
+
+
+
+
diff --git a/doc/libstddjb/iopause.html b/doc/libstddjb/iopause.html
new file mode 100644
index 0000000..72eedde
--- /dev/null
+++ b/doc/libstddjb/iopause.html
@@ -0,0 +1,196 @@
+
+
+
+
+ skalibs: the iopause library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The iopause library interface
+
+
+ The following functions are declared in the skalibs/iopause.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ iopause is the skalibs API for event loop selection. It's a
+wrapper around the system's
+poll()
+(if available) or
+select()
+(if poll() is unavailable) function. It
+works around some system-dependent quirks; also it works with
+absolute dates instead of timeouts. This is a good thing:
+see below.
+
+
+
+ iopause is a derived work from Dan J. Bernstein's
+iopause library, but the
+skalibs implementation is subtly different.
+
+
+ Data structures
+
+
+ An iopause_fd structure is similar to a
+struct pollfd
+structure, and must be filled the same way. Usually, the user declares
+an array of iopause_fd and fills it, one element per descriptor
+to select on. If x is an iopause_fd:
+
+
+
+ - x.fd must be set to the fd number to select on.
+ - x.events must be a disjunction of the following flags:
+
+ - IOPAUSE_READ if the fd is to be selected for reading.
+ - IOPAUSE_WRITE if the fd is to be selected for writing.
+
+ - When the selection function returns, x.revents contains
+a disjunction of the following flags:
+
+ - IOPAUSE_READ if the fd is readable (this include reception of an EOF).
+ - IOPAUSE_WRITE if the fd is writable.
+ - IOPAUSE_EXCEPT if an exception (such as EOF or an error) occurred on the fd.
+
+
+
+
+ Unlike poll() or select(), which use a timeout
+argument, the iopause() function uses a deadline argument,
+i.e. an absolute time at which it must return 0 if no event has happened
+so far, as well as a stamp argument, i.e. an absolute time meaning
+now. Those arguments are stored in
+tain_ts. Here is why:
+
+
+
+ The event loop pattern is mostly used to multiplex several asynchronous
+events that can happen independently, at the same time or not. Let's
+say you have 3 events, x, y and z. Each of
+those has a separate timeout: if x happens before x-timeout
+milliseconds, you call the x-event-handler function, but
+if x-timeout milliseconds elapse without x happening,
+you call x-timeout-handler function. And similarly with y
+and z.
+
+
+
+ But the selection function returning does not mean x has happened
+or that x has timed out. It might also mean that y has
+happened, that y has timed out, that z has happened, that
+z has timed out, or something else entirely. In the post-selection
+part of the loop, the proper handler is called for the event or timeout
+that has happened; then the loop is executed again, and in the
+pre-selection part of the loop, the array describing the events is filled,
+and the selection timeout is computed.
+
+
+
+ How are you going to compute that global selection timeout? Easy: it's the
+shortest of the three. But we just spent some amount of time waiting, so the
+individual timeouts must be recomputed! This means:
+
+ - You need a way to know the time spent in a selection primitive, which
+basically means getting a timestamp before the selection and once again
+after the timestamp.
+ - You need to recompute every individual timeout everytime you enter
+the loop.
+
+
+
+ That is really cumbersome. A much simpler way of doing things is:
+
+
+
+ - Always keep a reasonably accurate estimation of the current
+time in a stamp variable. That means getting the current time
+at the start of the process, and updating it right after any
+action that takes a significant amount of time. When to update stamp
+can be difficult to estimate in CPU-bound processes; fortunately, most
+processes using an event loop are IO-bound, and the only actions that take
+a non-negligible amount of time in an IO-bound process are the blocking
+primitives. So, stamp must be updated right after a selection
+function returns, and if the program has been correctly written and
+cannot block anywhere else, it's the only place where it needs to be.
+ - For every event, compute the deadline of that event:
+x-deadline is x-timeout added to the current stamp
+value when x enters the loop. This is done only once per event:
+you never have to recompute event deadlines - unlike timeouts, which diminish
+over time, deadlines do not change.
+ - At every iteration, the selection deadline is the earliest of all the
+available event deadlines.
+ - As an added bonus: after the selection function returns and
+ stamp has been updated, it is easy to check which events have
+timed out and which have not: x has timed out iff x-deadline
+is earlier than stamp.
+
+
+
+ Maintaining a global timestamp and using absolute times instead of relative
+times really is the right way to work with event loops, and the iopause
+interface reflects that. Of course, you need a reliable, bug-free time library
+and a monotonic, constant system clock to handle absolute times correctly;
+that is why iopause relies on the tai library.
+
+
+ Functions
+
+
+ int iopause (iopause_fd *x, unsigned int len, tain_t const *deadline, tain_t const *stamp)
+Blocks until one of the events described in the x array, of length
+len, happens, or until the absolute date *deadline is
+reached. deadline may be null, in which case the function blocks
+indefinitely until an event happens. If deadline is not null, then
+stamp must not be null, and must contain an accurate estimation
+of the current time. The function returns the number of events that have
+happened, 0 for a timeout, or -1 (and sets errno) for an error.
+
+
+
+ int iopause_stamp (iopause_fd *x, unsigned int len, tain_t const *deadline, tain_t *stamp)
+Like iopause(), but if stamp is not null, it is updated
+right before the function returns. This helps the user always keep a
+reasonably accurate estimation of the current time in stamp;
+it is recommended to use this function instead of the lower-level
+iopause().
+
+
+ Underlying implementations
+
+
+ iopause is an alias to either iopause_poll or
+or iopause_select. By default, it is aliased to iopause_poll; to
+alias it to iopause_select instead, configure skalibs with the
+--enable-iopause-select option.
+
+
+
+Both iopause_poll and iopause_select are implemented on top of the
+ppoll() system call
+if it is available; but if it is not, then iopause_poll defaults to
+poll(),
+which has a more comfortable API than
+select(),
+but a maximum precision of 1 millisecond which might not be enough for some applications; whereas
+iopause_select defaults to select(), which incurs some CPU overhead for the
+API conversion, but has a 1 microsecond precision.
+
+
+
+
diff --git a/doc/libstddjb/ip46.html b/doc/libstddjb/ip46.html
new file mode 100644
index 0000000..ee2f31c
--- /dev/null
+++ b/doc/libstddjb/ip46.html
@@ -0,0 +1,172 @@
+
+
+
+
+ skalibs: the ip46 library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The ip46 library interface
+
+
+ The following functions and structures are declared in the skalibs/ip46.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ ip46 is a set of macros and functions to support both IPv4
+and IPv6 network operations in an abstracted way.
+
+
+
+ If skalibs has been built with the --disable-ipv6
+configure option, or it detects at build time than the target does not support IPv6, then
+ip46 structures and functions will be directly aliased to their
+IPv4 implementations with no overhead at all.
+
+
+ Data structures
+
+
+ An ip46full_t is a structure that contains either an IPv4 or an IPv6
+address.
+ If a is an ip46full_t, then:
+
+
+
+ - ip46_is6(&a) is 1 if a is
+IPv6 and 0 otherwise.
+ - a.ip points to 16 (if IPv6) or 4 (if IPv4) bytes containing
+the address, in network byte order.
+
+
+
+ If skalibs has been build with IPv6 support, an ip46_t is
+the same type as an ip46full_t. Otherwise, an ip46_t
+is a structure that just contains an IPv4 address.
+
+
+ Functions
+
+
+ int ip46_from_ip4 (ip46_t *a, char const *ip)
+Stores the IPv4 pointed to by ip into *a. Returns 1.
+
+
+
+ int ip46_from_ip6 (ip46_t *a, char const *ip)
+Stores the IPv6 pointed to by ip into *a. Returns 1,
+except if IPv6 is unavailable, in which case it returns 0 ENOSYS.
+
+
+
+ unsigned int ip46_fmt (char *s, ip46_t const *a)
+Formats the address in *a into the string s, which
+must be preallocated. Returns the number of bytes written. The address
+will be accordingly formatted as IPv4 or IPv6.
+
+
+
+ unsigned int ip46_scan (char const *s, ip46_t *a)
+Scans the string s for an IPv4 or IPv6 address. If it finds
+one, writes it into *a and returns the number of bytes read.
+If it cannot, returns 0.
+
+
+
+ unsigned int ip46_scanlist (ip46_t *list, unsigned int max, char const *s, unsigned int *n)
+Scans the string s for a list of comma-, semicolon-, space-, tab- or
+newline-separated IPv4 or IPv6 addresses, up to a maximum of max. It
+stores them into the (preallocated) ip46_t array pointed to by list.
+It returns the number of bytes read (0 if s does not contain a valid
+IP list at all), and stores the number of found and scanned addresses into *n.
+
+
+
+ int socket_connect46 (int fd, ip46_t *a, uint16 port)
+Connects the socket fd to address *a and port port.
+Returns 0 in case of success, and -1 (and sets errno) in case of failure.
+
+
+
+ int socket_bind46 (int fd, ip46_t *a, uint16 port)
+Binds the socket fd to address *a and port port.
+Returns 0 in case of success, and -1 (and sets errno) in case of failure.
+
+
+
+ int socket_bind46_reuse (int fd, ip46_t *a, uint16 port)
+Same as the previous function, with the SO_REUSEADDR option.
+
+
+
+ int socket_deadlineconnstamp46 (int fd, ip46_t const *a, uint16 port, tain_t const *deadline, tain_t *stamp)
+Attempts to synchronously connect the socket fd to address aa
+and port port. Returns 1 if it succeeds and 0 (and sets errno)
+if it fails. stamp must contain an accurate enough
+timestamp, and is updated when the function returns. If the connection is
+still pending by deadline, then the attempt stops and the function
+returns 0 ETIMEDOUT.
+
+
+
+ int socket_recv46 (int fd, char *s, unsigned int len, ip46_t *a, uint16 *port)
+Reads a datagram from socket fd. The message is stored into buffer s
+of max length len, and stores the sender information into address *a
+and port *port. Returns the length of the read datagram, or -1 if it fails.
+
+
+
+ int socket_send46 (int fd, char const *s, unsigned int len, ip46_t const *a, uint16 port)
+Writes a datagram to socket fd. The message is read from buffer s
+of length len, and the recipient information is address *a
+and port port. Returns the number of written bytes, or -1 if it fails.
+
+
+
+ int socket_local46 (int fd, ip46_t *a, uint16 *port)
+Gets the local information about bound socket fd: the local IP
+address is stored into *a and the local port into *port.
+Returns 0 in case of success, and -1 (and sets errno) in case of failure.
+
+
+
+ int socket_remote46 (int fd, ip46_t *a, uint16 *port)
+Gets the peer information about connected socket fd: the remote IP
+address is stored into *a and the remote port into *port.
+Returns 0 in case of success, and -1 (and sets errno) in case of failure.
+
+
+
+ int socket_recvnb46 (int fd, char *s, unsigned int len, ip46_t *a, uint16 *port,
+tain_t const *deadline, tain_t *stamp)
+Like socket_recv46, except that the function blocks until a datagram
+is received. *stamp must be an accurate enough approximation of the
+current time, and is updated when the function returns. If no datagram has
+arrived by absolute date *deadline, the function returns -1 ETIMEOUT.
+
+
+
+ int socket_sendnb46 (int fd, char const *s, unsigned int len, ip46_t const *a, uint16 port,
+tain_t const *deadline, tain_t *stamp)
+Like socket_send46, except that the function blocks until a datagram
+has been effectively sent. *stamp must be an accurate enough approximation of the
+current time, and is updated when the function returns. If the message still has
+not been sent by absolute date *deadline, the function returns -1 ETIMEOUT.
+
+
+
+
diff --git a/doc/libstddjb/lolstdio.html b/doc/libstddjb/lolstdio.html
new file mode 100644
index 0000000..e059f24
--- /dev/null
+++ b/doc/libstddjb/lolstdio.html
@@ -0,0 +1,91 @@
+
+
+
+
+ skalibs: the lolstdio library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The lolstdio library interface
+
+
+ The following functions are declared in the skalibs/lolstdio.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ lolstdio is a set of convenience functions providing
+printf-style
+formatting but interacting with buffers or
+bufallocs instead of stdio FILEs.
+
+
+
+ Like any printf-style functions, the lolstdio functions are rather
+complex and inefficient, and not recommended for general use; they are
+provided as a quick and dirty way to debug or test things. Programmers
+are advised to use the type-specific formatting
+functions instead in production-quality code.
+
+
+
+ Be aware that functions writing into buffers interact badly with
+non-blocking fds (and asynchronism in general) - just as you cannot
+use FILEs with non-blocking output. Functions writing into bufallocs,
+however, are fine, because bufallocs are much more suited to asynchronous
+writing than fixed-size buffers or FILEs are.
+
+
+
+ The current lolstdio implementation relies on the libc's
+vsnprintf
+function.
+
+
+ Functions
+
+
+ int vbprintf (buffer *b, char const *format, va_list args)
+Like vfprintf
+except that the result is written to the buffer b.
+
+
+
+ int bprintf (buffer *b, char const *format, ...)
+Like fprintf
+except that the result is written to the buffer b.
+
+
+
+ int lolprintf (char const *format, ...)
+Like printf
+except that the result is written to the buffer buffer_1.
+
+
+
+ int vbaprintf (bufalloc *ba, char const *format, va_list args)
+Like vfprintf
+except that the result is written to the bufalloc ba.
+
+
+
+ int baprintf (bufalloc *ba, char const *format, ...)
+Like fprintf
+except that the result is written to the bufalloc ba.
+
+
+
+
diff --git a/doc/libstddjb/safewrappers.html b/doc/libstddjb/safewrappers.html
new file mode 100644
index 0000000..6d889d6
--- /dev/null
+++ b/doc/libstddjb/safewrappers.html
@@ -0,0 +1,91 @@
+
+
+
+
+ skalibs: safe wrappers
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ Safe wrappers
+
+
+ Lots of functions in libstddjb, declared for instance in
+allreadwrite.h or
+djbunix.h, are just "safe wrappers"
+around corresponding system functions. For instance,
+fd_read() is a safe wrapper around the system read()
+function.
+
+
+ The problem
+
+
+ Quite a lot of system calls are defined by
+The
+Open Group Base Specifications as interruptible: when the process is in
+the middle of such a system call and receives a signal that it does not
+ignore, the system call immediately returns -1 EINTR (after the signal
+handler, if any, has been executed).
+
+
+
+ This means that the intended execution of the process is at the mercy
+of a stray signal. If a signal happens at the wrong time, a system call
+fails when it could have succeeded. This is not acceptable.
+
+
+ The solution
+
+
+ So, in order to be perfectly reliable, when a program makes an interruptible
+system call, it must check whether the return value is -1 EINTR,
+and restart the system call if it is the case. This is annoying to write;
+so, libstddjb provides small wrappers around interruptible system
+calls, so that programmers can just call those safe wrappers and
+never bother with this again.
+
+
+
+ The performance loss from having a wrapper layer is totally negligible
+compared to the cost of using a system call in the first place.
+
+
+ But isn't it what the SA_RESTART flag is meant to address?
+
+
+ Yes, it is. Unfortunately, SA_RESTART only protects interruptible
+system calls from signals you actually have control over, and set a
+handler for with
+sigaction().
+This is not enough. You cannot decide that every signal sent
+to your process should have SA_RESTART behaviour; and the Single Unix
+specification says nothing about signals you do not control. For instance,
+you cannot trap SIGSTOP; SIGSTOP does not kill your process, which
+should resume flawlessly at the next SIGCONT; and according to the
+specification, it is valid for SIGSTOP and SIGCONT to not
+have SA_RESTART behaviour. So if you get a SIGSTOP while performing
+an interruptible system call, that system call may return -1 EINTR,
+this is not an OS bug, and there's nothing you can do about it with
+sigaction().
+
+
+
+ SA_RESTART is only a partial solution: in other words, it doesn't work.
+Until the Single Unix specification explicitly states that untrapped
+non-lethal signals MUST have SA_RESTART behaviour by default, you
+need safe wrappers to protect interruptible system calls.
+
+
+
+
diff --git a/doc/libstddjb/selfpipe.html b/doc/libstddjb/selfpipe.html
new file mode 100644
index 0000000..7eff430
--- /dev/null
+++ b/doc/libstddjb/selfpipe.html
@@ -0,0 +1,242 @@
+
+
+
+
+ skalibs: the selfpipe library interface
+
+
+
+
+
+
+
+libstddjb
+skalibs
+skalibs
+Software
+skarnet.org
+
+
+ The selfpipe library interface
+
+
+ The selfpipe functions are declared in the
+skalibs/selfpipe.h header and implemented in the libskarnet.a
+or libskarnet.so library.
+
+
+ What does it do ?
+
+
+Signal handlers suck.
+
+
+
+They do. I don't care how experienced you are with C/Unix programming,
+they do. You can be Ken Thompson, if you use signal handlers as a
+regular part of your C programming model, you are going to
+screw up, and write buggy code.
+
+
+
+ Unix is tricky enough with interruptions. Most of libstddjb's wrappers
+are there to protect system calls from EINTR. (And no, the SA_RESTART
+option in sigaction() isn't protection
+enough.) But signal handlers are
+more than just pesky interruptions: they can totally change the
+execution flow. They mess up the logic of linear and structured code,
+they introduce non-determinism; you always have to think "and what
+if I get interrupted here and the flow goes into a handler...". This
+is annoying.
+
+
+
+ Moreover, signal handler code is very limited in what it can
+do. It can't use any non-reentrant function! If you call a non-reentrant
+function, and by chance you were precisely in that non-reentrant function
+code when you got interrupted by a signal... you lose. That means, no
+malloc(). No bufferized IO. No globals. The list goes on and on.
+ If you're going to catch signals, you'll want to handle them outside
+the signal handler. You actually want to spend the least possible
+time inside a signal handler - just enough to notify your main
+execution flow that there's a signal to take care of.
+
+
+
+ And, of course, signal handlers don't mix with event loops, which is
+a classic source of headaches for programmers and led to the birth of
+abominations such as
+
+pselect. So much for the "everything is a file" concept that Unix was
+built on.
+
+
+
+ A signal should be an event like any other.
+There should be a unified interface - receiving a signal should make some
+fd readable or something.
+
+
+
+ And that's exactly what the
+self-pipe trick, invented
+by DJB, does.
+
+
+
+ As long as you're in some kind of event loop, the self-pipe trick allows
+you to forget about signal handlers... forever. It works this way:
+
+
+
+ - Create a pipe p. Make both ends close-on-exec and nonblocking.
+ - Write a tiny signal handler ("top half") for all the signals you want to
+catch. This
+signal handler should just write one byte into p[1], and do nothing
+more; ideally, the written byte identifies the signal.
+ - In your event loop, add p[0] to the list of fds you're watching
+for readability.
+
+
+
+ When you get a signal, a byte will be written to the self-pipe, and your
+execution flow will resume. When you next go through the event loop,
+p[0] will be readable; you'll then be able to read a byte from
+it, identify the signal, and handle it - in your unrestricted main
+environment (the "bottom half" of the handler).
+
+
+
+ The selfpipe library does it all for you - you don't even have to write
+the top half yourself. You can forget their existence and recover
+some peace of mind. Of course, you still need to protect your
+system calls against EINTR: the self-pipe trick doesn't prevent signals
+from happening.
+
+
+ How do I use it ?
+
+ Starting
+
+
+int fd = selfpipe_init() ;
+
+
+
+selfpipe_init() sets up a selfpipe. You must use that
+function first.
+If fd is -1, then an error occurred. Else fd is a
+non-blocking descriptor that can be used in your event loop. It will
+be selected for readability when you've caught a signal.
+
+
+ Trapping/untrapping signals
+
+
+int r = selfpipe_trap(SIGTERM) ;
+
+
+
+selfpipe_trap() catches a signal and sends it to the selfpipe.
+Uncaught signals won't trigger the selfpipe. r is 0 if
+the operation succeeded, and -1 if it failed. If it succeeded, you
+can forget about the trapped signal entirely.
+In our example, if r is 0, then a SIGTERM will instantly
+trigger readability on fd.
+
+
+
+int r = selfpipe_untrap(SIGTERM) ;
+
+
+
+Conversely, selfpipe_untrap() uncatches a signal; the selfpipe
+will not manage it anymore. r is 0 if the operation succeeded
+and -1 if it failed.
+
+
+
+int r ;
+sigset_t set ;
+sigemptyset(&set) ;
+sigaddset(&set, SIGTERM) ;
+sigaddset(&set, SIGHUP) ;
+r = selfpipe_trapset(&set) ;
+
+
+
+selfpipe_trap() and selfpipe_untrap() handle signals one
+by one. Alternatively (and often preferrably), you can use
+selfpipe_trapset() to directly handle signal sets. When you call
+selfpipe_trapset(), signals that are present in set will
+be caught by the selfpipe, and signals that are absent from set
+will be uncaught. r is 0 if the operation succeeded and -1 if it
+failed.
+
+
+ Handling events
+
+
+int c = selfpipe_read() ;
+
+
+
+ Call selfpipe_read() when your fd is readable.
+That's where you write your real signal handler: in the
+body of your event loop, in a "normal" context.
+c is -1 if an error occurred - in which case chances are
+it's a serious one and your system has become very unstable.
+c is 0 if there are no more pending signals. If c
+is positive, it is the number of the signal that was caught.
+
+
+ Finishing
+
+
+selfpipe_finish() ;
+
+
+
+ Call selfpipe_finish() when you're done using the selfpipe.
+Signal handlers will be restored to their previous value.
+
+
+ Any limitations ?
+
+
+ Some, as always.
+
+
+
+ - The selfpipe library uses a global pipe;
+so, it's not safe for multithreading. I'm not sure how multithreaded
+programs handle signals; I personally don't like multithreading and
+never use it, so I'm not knowledgeable about it. Anyway, if your
+program is multithreaded, chances are you don't have an asynchronous
+event loop, so the self-pipe trick has less benefits for you.
+ - In rare cases, the self-pipe can theoretically be filled, if some
+application sends more than PIPE_BUF signals before you have time to
+selfpipe_read(). On most Unix systems, PIPE_BUF is 4096,
+so it's a very acceptable margin. Unless your code is waiting where
+it should not be, only malicious applications will fill the self-pipe
+- and malicious applications could just send you a SIGKILL and be done
+with you, so this is not a concern. Protect yourself from malicious
+applications with clever use of uids.
+
+
+ Hey, Linux has signalfd() for this !
+
+
+ Yes, the Linux team loves to gratuitously add new system calls to do
+things that could already be done before without much effort. This
+adds API complexity, which is not a sign of good engineering.
+
+
+
+ However, now that signalfd() exists, it is indeed marginally more
+efficient than a pipe, and it saves one fd: so the selfpipe library
+is implemented via signalfd() when this call is available.
+
+
+
+
diff --git a/doc/libstddjb/stralloc.html b/doc/libstddjb/stralloc.html
new file mode 100644
index 0000000..a5a1c7e
--- /dev/null
+++ b/doc/libstddjb/stralloc.html
@@ -0,0 +1,118 @@
+
+
+
+
+ skalibs: the stralloc library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The stralloc library interface
+
+
+ The following functions are declared in the skalibs/stralloc.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ stralloc is the preferred skalibs way of storing objects into
+heap memory. It focuses on strings of char, which is the generic
+way to handle any object. For easy structure manipulation, the
+genalloc
+series of functions can be used; those functions are mostly macros wrapping
+calls to their stralloc counterparts.
+
+
+
+ A stralloc is a structure containing the following fields:
+
+
+
+ - s: a pointer to a zone of heap memory. The stralloc
+functions internally manipulate those via the
+alloc series of functions. It is recommended
+to never modify that field manually.
+ - len: the used length of the
+allocated zone. It is the only field that the user can modify
+directly.
+ - a: the number of allocated bytes. The user should never
+have to access that field, because the memory allocation management
+should be entirely transparent. len cannot exceed a:
+if an operation needs a bigger len, it will automatically
+reallocate as needed.
+
+
+
+ The benefits of using stralloc are as follows:
+
+
+
+ - Memory allocation is performed on-demand and automatically, with
+a suitable size. Heuristics are used to accommodate constantly growing
+strings while minimizing the amount of needed reallocations.
+ - If every heap-allocated object is represented by a stralloc, then
+it is very easy to identify what pointer is in the heap. When you stop
+using a pointer p, should you free it ? Sometimes it's not
+easy to find out. When you stop using a stralloc sa, you
+know you must call stralloc_free(&sa). Store
+your strong references as strallocs and weak references as simple
+pointers, and never free simple pointers. This policy allows me to
+boast that no skarnet.org software has ever leaked memory.
+ - Repeated for emphasis:
+ the golden rule for programming with strallocs is
+every pointer to the heap must be owned by a stralloc.
+Every pointer you handle yourself either does not point to the heap,
+or is weak. That sometimes implies unusual programming practices, such
+as having storage separated from structure, but it's hands down the
+easiest way to keep control of your heap in complex situations.
+- The indirection layer makes weak references immune to
+reallocation troubles. The s field may change when a
+reallocation happens, but the stralloc structure's address never
+changes.
+
+
+
+ A stralloc can be declared anywhere: static/global data, stack or heap. (Of course,
+as a general rule, you should favor the stack whenever possible.)
+A stralloc should be initialized to STRALLOC_ZERO before its first use.
+
+
+ Functions
+
+
+ int stralloc_catb (stralloc *sa, char const *s, unsigned int len)
+Appends the len bytes pointed to by s to the end of the
+memory zone handled by *sa, automatically allocating more memory
+if needed. Returns 1 if it succeeds, and 0 if it fails.
+
+
+
+ void stralloc_free (stralloc *sa)
+Frees *sa, i.e. calls alloc_free
+on sa→s then zeroes the structure. *sa is
+then reusable. However, it is not good practice to call this function
+if you're going to reuse *sa soon: it takes time and causes
+memory fragmentation. Just setting sa→len to 0 allows
+you to instantly reuse the allocated block of memory.
+
+
+
+ The above are the most important and fundamental functions of
+skalibs/stralloc.h. Other functions can be found in this header and
+their prototypes are self-explaining.
+
+
+
+
diff --git a/doc/libstddjb/tai.html b/doc/libstddjb/tai.html
new file mode 100644
index 0000000..3524c05
--- /dev/null
+++ b/doc/libstddjb/tai.html
@@ -0,0 +1,462 @@
+
+
+
+
+ skalibs: the tai library interface
+
+
+
+
+
+
+
+libstddjb
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The tai library interface
+
+
+ The following functions are declared in the skalibs/tai.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ tai is a set of data structures and primitives to represent
+and perform operations on time.
+
+
+
+ The point of tai is to handle time without ever having to
+deal with annoyances such as Y2K, Y2038, NTP limits, non-linear
+clocks, and the like. By using the tai interface, you ensure
+your program will behave properly no matter what.
+
+
+ What is the problem ?
+
+
+ The standard APIs for time management under Unix are broken in more
+or less subtle ways. The most obvious thing is that they do not pass
+year 2038. A less obvious problem is that they do not handle leap
+seconds correctly. Here are a few references you should read to
+understand what is going on:
+
+
+
+
+
+ The meat and potatoes of all this is that programmers cannot simply rely on
+standard Unix APIs such as
+gettimeofday()
+(which, by the way, is marked as obsolescent, but it's not going to disappear tomorrow)
+to measure time intervals or even to give precise absolute time, and in
+any case those APIs will become obsolete in 2038.
+
+
+ So what does tai do ?
+
+
+ tai implements - among other things - the
+TAI64 and TAI64N
+formats, which are used in all of skalibs. This gives a programmer access
+to precise linear absolute time, which is suitable for both
+timestamping (wallclock usage) and time interval measurements
+(stopwatch usage). Additionally, TAI64 passes Y2038 (it can
+represent dates exceeding the estimated lifespan of the universe).
+
+
+
+ tai has been inspired by Dan J. Bernstein's
+libtai library, but does not
+borrow any code from it.
+
+
+ Data structures
+
+
+ A tai_t structure holds an absolute date with a one-second
+precision. A tain_t structure holds an absolute date with a
+maximum of one-nanosecond precision, as permitted by the underlying system
+call. If flag-usert is clear, the system
+clock will be read via
+gettimeofday()
+system call, which has a one-microsecond precision; if it is set, the
+system clock will be read via the
+clock_gettime()
+system call, which has a one-nanosecond precision. In either case, a current
+tain_t will be unable to be more precise than the underlying
+implementation.
+
+
+
+ A tai_t, as well as a tain_t, can also
+hold a (possibly negative) relative time, i.e. a difference of absolute
+dates. It is up to the programmer to make sure that a relative time is
+never interpreted as an absolute TAI64 date, and vice-versa.
+
+
+ The leap second table
+
+
+ skalibs provides a src/etc/leapsecs.dat file,
+which is copied to /etc/leapsecs.dat at installation time
+(or wherever you specified with the --prefix or --datadir
+options to configure).
+Make sure this file is always present and readable.
+This file contains the leap second table, which is needed for
+conversions between TAI and UTC. If you call a function that needs such
+a conversion (for instance, you call tain_sysclock() and your
+system clock is set to UTC) and the file cannot be read, the function
+call will fail.
+
+
+
+ The leap second table is read once in every process that needs it
+(the first time a TAI ↔ UTC conversion is made) and then is
+stored in memory. If the leapsecs.dat file changes, long-lived
+processes will need to be restarted to take the change into account.
+
+
+ Functions
+
+ Wallclock operations
+
+
+ int tai_now (tai_t *t)
+Writes the current time as a TAI value to *t, with a
+1-second precision. The current time is based on the system clock.
+Make sure skalibs has been compiled with or without the
+--enable-tai-clock configure option according
+to your system clock synchronization method: skalibs supports a
+system clock set to TAI-10 or to UTC.
+The function returns 1 if it succeeds, or 0 (and sets errno) if
+it fails.
+
+
+
+ int sysclock_get (tain_t *a)
+Reads the current value of the system clock into *a, with
+a 1-nanosecond (resp. 1-microsecond ) precision if skalibs has been
+configured with (resp. without) the
+--enable-clock option.
+Returns 1 if it succeeds or 0 (and sets errno) if it
+fails. Note that despite being a tain_t, *a
+does not contain a TAI value - it only contains
+an internal, Y2038-safe representation of the value of the system
+clock, which should be either TAI-10 or UTC. You should not use
+this function directly unless you know exactly what you are doing.
+
+
+
+ int sysclock_set (tain_t const *a)
+Sets the system clock to *a, provided *a has
+the correct internal representation. You should not use this
+function directly unless you know exactly what you are doing.
+
+
+
+ int tain_sysclock (tain_t *a)
+Reads the current time into *a, as a TAI64N value,
+with a 1-nanosecond (resp. 1-microsecond) precision if skalibs
+has been configured with (resp. without) the
+--enable-clock
+option. Returns 1 if it succeeds or 0 (and sets errno) if it
+fails.
+ Here a contains a valid TAI stamp, no matter what the
+system clock is set to: arithmetic operations can be performed
+on it.
+
+
+
+ int tain_setnow (tain_t const *a)
+Sets the current time to *a, with a 1-nanosecond
+(resp. 1-microsecond) precision if skalibs has been configured
+with (resp. without) the
+--enable-clock
+option. Returns 1 if it succeeds or 0 (and sets errno) if it
+fails. a must contain a valid TAI stamp; proper
+operations will be automatically run to convert that stamp into
+the right format for the system clock.
+
+
+ Stopwatch operations
+
+
+ The following 3 operations are only defined if your system
+provides the
+clock_gettime()
+primitive with the CLOCK_MONOTONIC option.
+
+
+
+ int tain_clockmon_init (tain_t *offset)
+Initializes a stopwatch in *offset. The actual value of
+*offset is meaningless to the user; offset's only
+use is to be given as a second parameter to tain_clockmon().
+The function returns 1 if it succeeds or 0 (and sets errno) if it fails.
+
+
+
+ What tain_clockmon_init() does is synchronize the "stopwatch
+clock" (CLOCK_MONOTONIC) to the system clock. Right after
+tain_clockmon_init() has been called, the absolute times given
+by tain_clockmon() and tain_sysclock() are similar. Then,
+depending on the accuracy of the system clock, a drift may appear; calling
+tain_clockmon_init() again resets that drift to zero.
+
+
+
+ int tain_clockmon (tain_t *a, tain_t const *offset)
+ Gives the absolute time, as a TAI64N value, in *a. This
+absolute time is computed as a linear increase (as measured with
+CLOCK_MONOTONIC) since the last time tain_clockmon_init()
+was called with parameter offset. tain_clockmon()
+guarantees precise time interval measurements; however, the time it
+gives can slightly differ from the result of tain_sysclock().
+The function returns 1 if it succeeds or 0 (and sets errno) if it fails.
+
+
+ All-purpose time reading
+
+
+ int tain_init (void)
+If skalibs has been configured with the
+--enable-monotonic option: this
+function initializes a process-global stopwatch, that future
+tain_now invocations will depend on.
+Without the --enable-monotonic option: this
+function does nothing.
+The function returns 1 if it succeeds or 0 (and sets errno) if it fails.
+
+
+
+ int tain_now (tain_t *a)
+Writes the current time, as a TAI value, to *a. This is the
+function you should use to read time by default. It returns 1 if it succeeds or
+0 (and sets errno) if it fails.
+
+
+
+ If skalibs has been configured with the
+--enable-monotonic option:
+tain_now() is computed as a linear increase from the last time
+tain_init() was called. (If tain_init() has never
+been called before, the first invocation of tain_now()
+automatically calls tain_init().)
+ Without the --enable-monotonic option:
+tain_now() is the same as tain_sysclock().
+
+
+
+ If the above is unclear to you: just use tain_now()
+everytime you need to read time, and you will always get a reasonable
+approximation of the current time, in a format suited for arithmetic
+computations.
+
+
+ Converting to/from libc representations
+
+
+ int tai_from_timeval (tai_t *t, struct timeval const *tv)
+int tai_from_timespec (tai_t *t, struct timespec const *ts)
+int tai_relative_from_timeval (tai_t *t, struct timeval const *tv)
+int tai_relative_from_timespec (tai_t *t, struct timespec const *ts)
+Those functions convert an absolute (resp. relative) time in a
+struct timeval (resp. struct timespec) to an absolute (resp. relative)
+time in a tai_t, with a 1-second precision. They return 1.
+
+
+
+ int timeval_from_tai (struct timeval *tv, tai_t const *t)
+int timespec_from_tai (struct timespec *ts, tai_t const *t)
+int timeval_from_tai_relative (struct timeval *tv, tai_t const *t)
+int timespec_from_tai_relative (struct timespec *ts, tai_t const *t)
+Those functions do the opposite conversion. They normally return 1;
+however, struct timeval and struct timespec cannot
+represent an absolute date before the Epoch, or a negative relative time;
+if *t cannot be converted, 0 EINVAL is returned.
+
+
+
+ int tain_from_timeval (tain_t *a, struct timeval const *tv)
+int tain_from_timespec (tain_t *a, struct timespec const *ts)
+int tain_relative_from_timeval (tain_t *a, struct timeval const *tv)
+int tain_relative_from_timespec (tain_t *a, struct timespec const *ts)
+int timeval_from_tain (struct timeval *tv, tain_t const *a)
+int timespec_from_tain (struct timespec *ts, tain_t const *a)
+int timeval_from_tain_relative (struct timeval *tv, tain_t const *a)
+int timespec_from_tain_relative (struct timespec *ts, tain_t const *a)
+Same conversion operations, but with a tain_t. The 1-microsecond
+(for struct timeval) or 1-nanosecond (for struct timespec)
+precision is preserved.
+
+
+
+ void tain_uint (tain_t *a, unsigned int c)
+Stores a relative time of c seconds into a.
+
+
+
+ int tain_from_millisecs (tain_t *a, int ms)
+This function makes a tain_t representing a relative
+time of ms milliseconds. ms must be non-negative.
+The function returns 1, unless ms is negative, in which case
+it returns 0 EINVAL.
+
+
+
+ int tain_to_millisecs (tain_t const *a)
+If *a contains a non-negative relative time that fits into
+a 31-bit integer number of milliseconds, the function returns that
+number. Else it returns -1 EINVAL.
+
+
+ Time computations
+
+
+ void tai_add (tai_t *t, tai_t const *t1, tai_t const *t2)
+Stores *t1 + *t2 into t. Of course, *t1
+and *t2 must not both represent absolute times.
+
+
+
+ void tai_sub (tai_t *t, tai_t const *t1, tai_t const *t2)
+Stores *t1 - *t2 into t. Of course, *t1
+and *t2 must be of the same type (relative or absolute), and
+*t will always be relative.
+
+
+
+ void tain_add (tain_t *a, tain_t const *a1, tain_t const *a2)
+void tain_sub (tain_t *a, tain_t const *a1, tain_t const *a2)
+Same thing with tain_t.
+
+
+
+ void tain_addsec (tain_t *a, tain_t const *a1, int c)
+Adds c seconds to *a1 and stores the result into a.
+c may be negative.
+
+
+
+ void tain_half (tain_t *a, tain_t const *b)
+Stores *b/2 into a. *b must be relative.
+
+
+ Comparing dates or durations
+
+
+ int tai_less (tai_t const *t1, tai_t const *t2)
+int tain_less (tain_t const *t1, tain_t const *t2)
+Those functions return nonzero iff *t1 is lesser than *t2.
+*t1 and *t2 must be both relative, or both absolute.
+
+
+ Packing and unpacking
+
+
+ void tai_pack (char *s, tai_t const *t)
+Marshals *t into the buffer s points to, which
+must be preallocated with at least TAI_PACK (8) characters. Afterwards,
+the buffer contains the
+external TAI64 format
+representation of *t.
+
+
+
+ void tai_unpack (char const *s, tai_t *t)
+Unmarshals the
+external TAI64 format
+label pointed to by s (at least TAI_PACK characters) and stores
+the result into t.
+
+
+
+ void tain_pack (char *s, tain_t const *a)
+void tain_unpack (char const *s, tain_t *a)
+void tain_pack (char *s, tain_t const *a)
+void tain_unpack (char const *s, tain_t *a)
+Same thing with
+external TAI64N format,
+using TAIN_PACK (12) characters.
+
+
+ Formatting and scanning
+
+
+ unsigned int tain_fmt (char *s, tain_t const *a)
+Writes into s an ASCII representation of *a in external
+TAI64N format. s must point to a preallocated buffer of at least
+TAIN_PACK*2 (24) characters. The function returns the number of bytes that
+have been written to s (24).
+
+
+
+ unsigned int tain_scan (char const *s, tain_t *a)
+Reads 24 characters from s; if those characters are a valid ASCII
+representation of the external TAI64N format of some time value, this value
+is stored into a, and 24 is returned. Else 0 is returned.
+
+
+ Timestamping
+
+
+ A TAI64N timestamp is a string of 25 characters: a single '@'
+character followed by the ASCII representation of the TAI64N external
+format of an absolute date.
+
+
+
+ unsigned int timestamp_fmt (char *s, tain_t const *a)
+Writes a TAI64N timestamp representing the absolute date *a
+into the 25 characters pointed to by s. Returns 25.
+
+
+
+ unsigned int timestamp_scan (char const *s, tain_t *a)
+Reads 25 characters at s. If those characters are a valid TAI64N
+timestamp, stores the absolute date in a and returns 25. Else,
+returns 0.
+
+
+
+ int timestamp (char *s)
+Writes the current time (read from the system clock) as a TAI64N timestamp
+into s. Returns 1 if it succeeds or 0 (and sets errno) if it fails.
+
+
+
+ TAI64N timestamps are an efficient, robust, and easy-to-use way of
+timestampping log lines. They're easy to recognize in automatic data
+parsers. Log files where every line starts with a TAI64N timestamp can
+be merged and alphanumerically sorted: the resulting file will be
+chronologically sorted.
+
+
+
+ The s6 package
+provides tools to convert TAI64N timestamps into human-readable
+dates. Please do not embed human-readable dates in your log files,
+thus making parsing tools unnecessarily hard to write;
+use TAI64N timestamps instead, design tools that can parse them,
+and translate them to human-readable form at human analysis time.
+
+
+
+
diff --git a/doc/libunixonacid/index.html b/doc/libunixonacid/index.html
new file mode 100644
index 0000000..81b024f
--- /dev/null
+++ b/doc/libunixonacid/index.html
@@ -0,0 +1,58 @@
+
+
+
+
+ skalibs: the unixonacid library interface
+
+
+
+
+
+
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The unixonacid library interface
+
+
+libunixonacid provides higher-level interfaces to Unix
+concepts such as the filesystem - for instance, it provides a way to
+access several files atomically, be it for reading or for writing - or
+interprocess communication.
+
+
+
+ Compiling
+
+
+ - Use #include <skalibs/unixonacid.h>
+
+
+ Programming
+
+
+ The skalibs/unixonacid.h header is actually a concatenation of other
+headers, every one of each declaring related structures, macros and
+functions.
+
+
+
+
+
+
diff --git a/doc/libunixonacid/kolbak.html b/doc/libunixonacid/kolbak.html
new file mode 100644
index 0000000..a7480e8
--- /dev/null
+++ b/doc/libunixonacid/kolbak.html
@@ -0,0 +1,40 @@
+
+
+
+
+ skalibs: the kolbak library interface
+
+
+
+
+
+
+
+libunixonacid
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The kolbak library interface
+
+
+ The following functions are declared in the skalibs/kolbak.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ kolbak implements simple queuing of callback functions to use when
+sending a message to a peer and expecting an answer, which will be handled
+by the callback function. The queue is a circular buffer.
+
+
+
+ FIXME: To be completed.
+
+
+
+
diff --git a/doc/libunixonacid/skaclient.html b/doc/libunixonacid/skaclient.html
new file mode 100644
index 0000000..7deb38b
--- /dev/null
+++ b/doc/libunixonacid/skaclient.html
@@ -0,0 +1,34 @@
+
+
+
+
+ skalibs: the skaclient library interface
+
+
+
+
+
+
+
+libunixonacid
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The skaclient library interface
+
+
+ The following functions are declared in the skalibs/skaclient.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+FIXME: to be completed.
+
+
+
+
diff --git a/doc/libunixonacid/unix-timed.html b/doc/libunixonacid/unix-timed.html
new file mode 100644
index 0000000..5261475
--- /dev/null
+++ b/doc/libunixonacid/unix-timed.html
@@ -0,0 +1,34 @@
+
+
+
+
+ skalibs: the unix-timed library interface
+
+
+
+
+
+
+
+libunixonacid
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The unix-timed library interface
+
+
+ The following functions are declared in the skalibs/unix-timed.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+FIXME: to be completed.
+
+
+
+
diff --git a/doc/libunixonacid/unix-transactional.html b/doc/libunixonacid/unix-transactional.html
new file mode 100644
index 0000000..036d8cd
--- /dev/null
+++ b/doc/libunixonacid/unix-transactional.html
@@ -0,0 +1,34 @@
+
+
+
+
+ skalibs: the unix-transactional library interface
+
+
+
+
+
+
+
+libunixonacid
+libskarnet
+skalibs
+Software
+www.skarnet.org
+
+
+ The unix-transactional library interface
+
+
+ The following functions are declared in the skalibs/unix-transactional.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+FIXME: to be completed.
+
+
+
+
diff --git a/doc/libunixonacid/unixmessage.html b/doc/libunixonacid/unixmessage.html
new file mode 100644
index 0000000..2a6c46d
--- /dev/null
+++ b/doc/libunixonacid/unixmessage.html
@@ -0,0 +1,40 @@
+
+
+
+
+ skalibs: the unixmessage library interface
+
+
+
+
+
+
+
+libunixonacid
+libskarnet
+skalibs
+Software
+skarnet.org
+
+
+ The unixmessage library interface
+
+
+ The following functions are declared in the skalibs/unixmessage.h header,
+and implemented in the libskarnet.a or libskarnet.so library.
+
+
+ General information
+
+
+ unixmessage implements message transmission over Unix domain sockets.
+Messages are made of standard untyped data (strings), but can also include file
+descriptors using fd-passing.
+
+
+
+ FIXME: To be completed.
+
+
+
+
diff --git a/doc/license.html b/doc/license.html
new file mode 100644
index 0000000..21865c0
--- /dev/null
+++ b/doc/license.html
@@ -0,0 +1,82 @@
+
+
+
+
+ skalibs: license
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ skalibs license
+
+ Source code
+
+
+The skalibs source code from skalibs is released under the
+ISC license,
+the text of which can be found in the COPYING file enclosed in the
+package.
+
+
+
+ The license has been chosen for its simplicity - it's short
+and to the point - and above all its permissivity. There is nothing
+legitimate you should not be able to do with the skalibs code. If
+the license somehow stands in the way, please let me know.
+
+
+ Documentation
+
+
+ However, the skalibs documentation, which you are currently
+reading, and which is available in the doc/ subdirectory of
+the official skalibs tarball, is not provided under
+the same license.
+
+
+
+ The license for the skalibs documentation is more restrictive than
+the license for the source code. Namely:
+
+
+
+ - The exact same disclaimer applies.
+ - You have the right to download, use and modify the documentation.
+ - You have the right to distribute unmodified copies of the documentation.
+ - You have the right to distribute modified copies of the documentation,
+provided that:
+
+ - The contents and links (not necessarily the appearance) of this file,
+license.html, are left unmodified;
+ - On your documentation's main page,
+you explicitly state that the documentation has been modified, and you
+set up a
+link to the original
+skalibs site, explicitly stating that the original software and
+documentation can be found there;
+ - The parts of the documentation that you have modified are
+unarguably and undeniably distinguishable from the unmodified parts.
+You can, for instance, use a different text color, different background
+color, or different text font.
+
+
+
+
+
+ I am aware that the previous restrictions sound completely
+ridiculous while the official skalibs documentation is incomplete.
+As of 2.0.0.0, I'm not going to enforce those restrictions, but if you're
+going to provide documentation for skalibs, don't keep it to yourself,
+please send it to me instead. :-)
+
+
+
+
diff --git a/doc/upgrade.html b/doc/upgrade.html
new file mode 100644
index 0000000..70c14b9
--- /dev/null
+++ b/doc/upgrade.html
@@ -0,0 +1,34 @@
+
+
+
+
+ skalibs: how to upgrade
+
+
+
+
+
+
+
+skalibs
+Software
+skarnet.org
+
+
+ Upgrade incompatibilities: notes for developers
+
+ From previous versions to 2.0.0.0
+
+
+ - No compatibility is ensured. Most APIs haven't changed, but no guarantee
+is offered.
+ - The most important change is probably the disparition of struct tai
+and struct taia, replaced with the tai_t and tain_t
+types. Attosecond precision has been removed - processor speed is almost capped now,
+and it looks like nanosecond precision will be enough for the foreseeable future.
+ - Programs should now link with -lskarnet followed by the appropriate
+sysdeps links.
+
+
+
+
diff --git a/package/deps.mak b/package/deps.mak
new file mode 100644
index 0000000..7e177b5
--- /dev/null
+++ b/package/deps.mak
@@ -0,0 +1,756 @@
+#
+# This file has been generated by tools/gen-deps.sh
+#
+
+src/include/skalibs/alloc.h: src/include/skalibs/gccattributes.h
+src/include/skalibs/allreadwrite.h: src/include/skalibs/functypes.h
+src/include/skalibs/avlnode.h: src/include/skalibs/functypes.h src/include/skalibs/gccattributes.h
+src/include/skalibs/avltree.h: src/include/skalibs/avlnode.h src/include/skalibs/functypes.h src/include/skalibs/gensetdyn.h
+src/include/skalibs/avltreen.h: src/include/skalibs/avlnode.h src/include/skalibs/functypes.h src/include/skalibs/genset.h
+src/include/skalibs/biguint.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint32.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/bytestr.h src/include/skalibs/cbuffer.h src/include/skalibs/diuint.h src/include/skalibs/gccattributes.h src/include/skalibs/siovec.h
+src/include/skalibs/bytestr.h: src/include/skalibs/config.h src/include/skalibs/gccattributes.h
+src/include/skalibs/cbuffer.h: src/include/skalibs/bytestr.h src/include/skalibs/diuint.h src/include/skalibs/gccattributes.h src/include/skalibs/siovec.h
+src/include/skalibs/cdb.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint32.h
+src/include/skalibs/cdb_make.h: src/include/skalibs/buffer.h src/include/skalibs/diuint32.h src/include/skalibs/genalloc.h src/include/skalibs/uint32.h
+src/include/skalibs/datastruct.h: src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/avltreen.h src/include/skalibs/genset.h src/include/skalibs/gensetdyn.h
+src/include/skalibs/diuint32.h: src/include/skalibs/uint32.h
+src/include/skalibs/djbtime.h: src/include/skalibs/config.h src/include/skalibs/tai.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h
+src/include/skalibs/djbunix.h: src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.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/fmtscan.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint32.h
+src/include/skalibs/genalloc.h: src/include/skalibs/functypes.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/iobuffer.h: src/include/skalibs/buffer.h src/include/skalibs/djbunix.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/strerr2.h
+src/include/skalibs/md5.h: src/include/skalibs/uint32.h
+src/include/skalibs/mininetstring.h: src/include/skalibs/stralloc.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h
+src/include/skalibs/netstring.h: src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h
+src/include/skalibs/random.h: src/include/skalibs/gccattributes.h src/include/skalibs/stralloc.h
+src/include/skalibs/rrandom.h: src/include/skalibs/unirandom.h
+src/include/skalibs/sha1.h: src/include/skalibs/uint32.h
+src/include/skalibs/sha256.h: src/include/skalibs/uint32.h
+src/include/skalibs/sig.h: src/include/skalibs/gccattributes.h
+src/include/skalibs/siovec.h: src/include/skalibs/gccattributes.h
+src/include/skalibs/skaclient.h: src/include/skalibs/kolbak.h src/include/skalibs/siovec.h src/include/skalibs/tai.h src/include/skalibs/uint32.h src/include/skalibs/unixmessage.h
+src/include/skalibs/skalibs.h: src/include/skalibs/biguint.h src/include/skalibs/datastruct.h src/include/skalibs/random.h src/include/skalibs/stdcrypto.h src/include/skalibs/stddjb.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/djbunix.h src/include/skalibs/gccattributes.h src/include/skalibs/tai.h src/include/skalibs/uint16.h src/include/skalibs/uint32.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/stddjb.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/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/environ.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/getpeereid.h src/include/skalibs/gidstuff.h src/include/skalibs/iobuffer.h src/include/skalibs/iopause.h src/include/skalibs/ip46.h src/include/skalibs/lolstdio.h src/include/skalibs/mininetstring.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/uint.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h src/include/skalibs/ulong.h src/include/skalibs/ushort.h src/include/skalibs/webipc.h
+src/include/skalibs/stralloc.h: src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/include/skalibs/strerr.h: src/include/skalibs/gccattributes.h
+src/include/skalibs/strerr2.h: src/include/skalibs/strerr.h
+src/include/skalibs/surf.h: src/include/skalibs/uint32.h
+src/include/skalibs/tai.h: src/include/skalibs/gccattributes.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h
+src/include/skalibs/unirandom.h: src/include/skalibs/buffer.h src/include/skalibs/surf.h
+src/include/skalibs/unirandomdev.h: src/include/skalibs/unirandom.h
+src/include/skalibs/unirandomegd.h: src/include/skalibs/unirandom.h
+src/include/skalibs/unisurf.h: src/include/skalibs/unirandom.h
+src/include/skalibs/unix-timed.h: src/include/skalibs/bufalloc.h src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h
+src/include/skalibs/unix-transactional.h: src/include/skalibs/stralloc.h src/include/skalibs/uint64.h
+src/include/skalibs/unixmessage.h: src/include/skalibs/buffer.h src/include/skalibs/cbuffer.h src/include/skalibs/gccattributes.h src/include/skalibs/genalloc.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h
+src/include/skalibs/unixonacid.h: src/include/skalibs/kolbak.h src/include/skalibs/skaclient.h src/include/skalibs/unix-timed.h src/include/skalibs/unix-transactional.h src/include/skalibs/unixmessage.h
+src/include/skalibs/webipc.h: src/include/skalibs/djbunix.h src/include/skalibs/tai.h
+src/libdatastruct/avlnode-internal.h: src/include/skalibs/avlnode.h
+src/librandom/random-internal.h: src/include/skalibs/gccattributes.h src/include/skalibs/rrandom.h src/include/skalibs/surf.h src/include/skalibs/unirandom.h
+src/libstdcrypto/md5-internal.h: src/include/skalibs/md5.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha1-internal.h: src/include/skalibs/sha1.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha256-internal.h: src/include/skalibs/sha256.h src/include/skalibs/uint32.h
+src/libstddjb/alloc-internal.h: src/include/skalibs/alloc.h src/include/skalibs/sysdeps.h
+src/libstddjb/djbtime-internal.h: src/include/skalibs/uint64.h
+src/libstddjb/fmtscan-internal.h: src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h
+src/libstddjb/selfpipe-internal.h: src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libunixonacid/skaclient-internal.h: src/include/skalibs/kolbak.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h
+src/libbiguint/bu_addc.o src/libbiguint/bu_addc.lo: src/libbiguint/bu_addc.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_addmod.o src/libbiguint/bu_addmod.lo: src/libbiguint/bu_addmod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_cmp.o src/libbiguint/bu_cmp.lo: src/libbiguint/bu_cmp.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_copy.o src/libbiguint/bu_copy.lo: src/libbiguint/bu_copy.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_copy_internal.o src/libbiguint/bu_copy_internal.lo: src/libbiguint/bu_copy_internal.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_div.o src/libbiguint/bu_div.lo: src/libbiguint/bu_div.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_div_internal.o src/libbiguint/bu_div_internal.lo: src/libbiguint/bu_div_internal.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_divmod.o src/libbiguint/bu_divmod.lo: src/libbiguint/bu_divmod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_divmod_internal.o src/libbiguint/bu_divmod_internal.lo: src/libbiguint/bu_divmod_internal.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_fmt.o src/libbiguint/bu_fmt.lo: src/libbiguint/bu_fmt.c src/include/skalibs/biguint.h src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libbiguint/bu_gcd.o src/libbiguint/bu_gcd.lo: src/libbiguint/bu_gcd.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_invmod.o src/libbiguint/bu_invmod.lo: src/libbiguint/bu_invmod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_len.o src/libbiguint/bu_len.lo: src/libbiguint/bu_len.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_mod.o src/libbiguint/bu_mod.lo: src/libbiguint/bu_mod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_mul.o src/libbiguint/bu_mul.lo: src/libbiguint/bu_mul.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h src/include/skalibs/uint64.h
+src/libbiguint/bu_mulmod.o src/libbiguint/bu_mulmod.lo: src/libbiguint/bu_mulmod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_pack.o src/libbiguint/bu_pack.lo: src/libbiguint/bu_pack.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_pack_big.o src/libbiguint/bu_pack_big.lo: src/libbiguint/bu_pack_big.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_scan.o src/libbiguint/bu_scan.lo: src/libbiguint/bu_scan.c src/include/skalibs/biguint.h src/include/skalibs/bitarray.h src/include/skalibs/uint32.h
+src/libbiguint/bu_scan_internal.o src/libbiguint/bu_scan_internal.lo: src/libbiguint/bu_scan_internal.c src/include/skalibs/biguint.h src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libbiguint/bu_scanlen.o src/libbiguint/bu_scanlen.lo: src/libbiguint/bu_scanlen.c src/include/skalibs/biguint.h src/include/skalibs/fmtscan.h
+src/libbiguint/bu_slbc.o src/libbiguint/bu_slbc.lo: src/libbiguint/bu_slbc.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_srbc.o src/libbiguint/bu_srbc.lo: src/libbiguint/bu_srbc.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_subc.o src/libbiguint/bu_subc.lo: src/libbiguint/bu_subc.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_submod.o src/libbiguint/bu_submod.lo: src/libbiguint/bu_submod.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_unpack.o src/libbiguint/bu_unpack.lo: src/libbiguint/bu_unpack.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_unpack_big.o src/libbiguint/bu_unpack_big.lo: src/libbiguint/bu_unpack_big.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libbiguint/bu_zero.o src/libbiguint/bu_zero.lo: src/libbiguint/bu_zero.c src/include/skalibs/biguint.h src/include/skalibs/uint32.h
+src/libdatastruct/avlnode_delete.o src/libdatastruct/avlnode_delete.lo: src/libdatastruct/avlnode_delete.c src/libdatastruct/avlnode-internal.h src/include/skalibs/avlnode.h src/include/skalibs/functypes.h
+src/libdatastruct/avlnode_doublerotate.o src/libdatastruct/avlnode_doublerotate.lo: src/libdatastruct/avlnode_doublerotate.c src/libdatastruct/avlnode-internal.h src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_extreme.o src/libdatastruct/avlnode_extreme.lo: src/libdatastruct/avlnode_extreme.c src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_extremenode.o src/libdatastruct/avlnode_extremenode.lo: src/libdatastruct/avlnode_extremenode.c src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_height.o src/libdatastruct/avlnode_height.lo: src/libdatastruct/avlnode_height.c src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_insertnode.o src/libdatastruct/avlnode_insertnode.lo: src/libdatastruct/avlnode_insertnode.c src/libdatastruct/avlnode-internal.h src/include/skalibs/avlnode.h src/include/skalibs/functypes.h
+src/libdatastruct/avlnode_iter.o src/libdatastruct/avlnode_iter.lo: src/libdatastruct/avlnode_iter.c src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_rotate.o src/libdatastruct/avlnode_rotate.lo: src/libdatastruct/avlnode_rotate.c src/libdatastruct/avlnode-internal.h src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_search.o src/libdatastruct/avlnode_search.lo: src/libdatastruct/avlnode_search.c src/include/skalibs/avlnode.h
+src/libdatastruct/avlnode_searchnode.o src/libdatastruct/avlnode_searchnode.lo: src/libdatastruct/avlnode_searchnode.c src/libdatastruct/avlnode-internal.h src/include/skalibs/avlnode.h src/include/skalibs/functypes.h
+src/libdatastruct/avlnode_zero.o src/libdatastruct/avlnode_zero.lo: src/libdatastruct/avlnode_zero.c src/include/skalibs/avlnode.h
+src/libdatastruct/avltree_delete.o src/libdatastruct/avltree_delete.lo: src/libdatastruct/avltree_delete.c src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/avltree_free.o src/libdatastruct/avltree_free.lo: src/libdatastruct/avltree_free.c src/include/skalibs/avltree.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/avltree_init.o src/libdatastruct/avltree_init.lo: src/libdatastruct/avltree_init.c src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/functypes.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/avltree_insert.o src/libdatastruct/avltree_insert.lo: src/libdatastruct/avltree_insert.c src/include/skalibs/avltree.h
+src/libdatastruct/avltree_newnode.o src/libdatastruct/avltree_newnode.lo: src/libdatastruct/avltree_newnode.c src/include/skalibs/avlnode.h src/include/skalibs/avltree.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/avltree_zero.o src/libdatastruct/avltree_zero.lo: src/libdatastruct/avltree_zero.c src/include/skalibs/avltree.h
+src/libdatastruct/avltreen_delete.o src/libdatastruct/avltreen_delete.lo: src/libdatastruct/avltreen_delete.c src/include/skalibs/avlnode.h src/include/skalibs/avltreen.h src/include/skalibs/genset.h
+src/libdatastruct/avltreen_init.o src/libdatastruct/avltreen_init.lo: src/libdatastruct/avltreen_init.c src/include/skalibs/avlnode.h src/include/skalibs/avltreen.h src/include/skalibs/functypes.h src/include/skalibs/genset.h
+src/libdatastruct/avltreen_insert.o src/libdatastruct/avltreen_insert.lo: src/libdatastruct/avltreen_insert.c src/include/skalibs/avltreen.h
+src/libdatastruct/avltreen_newnode.o src/libdatastruct/avltreen_newnode.lo: src/libdatastruct/avltreen_newnode.c src/include/skalibs/avlnode.h src/include/skalibs/avltreen.h src/include/skalibs/genset.h
+src/libdatastruct/genset.o src/libdatastruct/genset.lo: src/libdatastruct/genset.c src/include/skalibs/genset.h
+src/libdatastruct/genset_iter.o src/libdatastruct/genset_iter.lo: src/libdatastruct/genset_iter.c src/include/skalibs/bitarray.h src/include/skalibs/functypes.h src/include/skalibs/genset.h
+src/libdatastruct/gensetdyn_delete.o src/libdatastruct/gensetdyn_delete.lo: src/libdatastruct/gensetdyn_delete.c src/include/skalibs/genalloc.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/gensetdyn_free.o src/libdatastruct/gensetdyn_free.lo: src/libdatastruct/gensetdyn_free.c src/include/skalibs/genalloc.h src/include/skalibs/gensetdyn.h src/include/skalibs/stralloc.h
+src/libdatastruct/gensetdyn_init.o src/libdatastruct/gensetdyn_init.lo: src/libdatastruct/gensetdyn_init.c src/include/skalibs/genalloc.h src/include/skalibs/gensetdyn.h src/include/skalibs/stralloc.h
+src/libdatastruct/gensetdyn_iter.o src/libdatastruct/gensetdyn_iter.lo: src/libdatastruct/gensetdyn_iter.c src/include/skalibs/bitarray.h src/include/skalibs/functypes.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/gensetdyn_new.o src/libdatastruct/gensetdyn_new.lo: src/libdatastruct/gensetdyn_new.c src/include/skalibs/genalloc.h src/include/skalibs/gensetdyn.h
+src/libdatastruct/gensetdyn_ready.o src/libdatastruct/gensetdyn_ready.lo: src/libdatastruct/gensetdyn_ready.c src/include/skalibs/genalloc.h src/include/skalibs/gensetdyn.h src/include/skalibs/stralloc.h
+src/libdatastruct/gensetdyn_zero.o src/libdatastruct/gensetdyn_zero.lo: src/libdatastruct/gensetdyn_zero.c src/include/skalibs/gensetdyn.h
+src/librandom/badrandom_char.o src/librandom/badrandom_char.lo: src/librandom/badrandom_char.c src/librandom/random-internal.h src/include/skalibs/random.h
+src/librandom/badrandom_finish.o src/librandom/badrandom_finish.lo: src/librandom/badrandom_finish.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/badrandom_here.o src/librandom/badrandom_here.lo: src/librandom/badrandom_here.c src/include/skalibs/config.h src/librandom/random-internal.h src/include/skalibs/sysdeps.h src/include/skalibs/unisurf.h
+src/librandom/badrandom_init.o src/librandom/badrandom_init.lo: src/librandom/badrandom_init.c src/include/skalibs/random.h
+src/librandom/badrandom_int.o src/librandom/badrandom_int.lo: src/librandom/badrandom_int.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/badrandom_string.o src/librandom/badrandom_string.lo: src/librandom/badrandom_string.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/goodrandom_char.o src/librandom/goodrandom_char.lo: src/librandom/goodrandom_char.c src/librandom/random-internal.h src/include/skalibs/random.h
+src/librandom/goodrandom_finish.o src/librandom/goodrandom_finish.lo: src/librandom/goodrandom_finish.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/goodrandom_here.o src/librandom/goodrandom_here.lo: src/librandom/goodrandom_here.c src/include/skalibs/config.h src/librandom/random-internal.h src/include/skalibs/sysdeps.h src/include/skalibs/unisurf.h
+src/librandom/goodrandom_init.o src/librandom/goodrandom_init.lo: src/librandom/goodrandom_init.c src/include/skalibs/random.h
+src/librandom/goodrandom_int.o src/librandom/goodrandom_int.lo: src/librandom/goodrandom_int.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/goodrandom_string.o src/librandom/goodrandom_string.lo: src/librandom/goodrandom_string.c src/librandom/random-internal.h src/include/skalibs/random.h src/include/skalibs/rrandom.h
+src/librandom/random_mask2.o src/librandom/random_mask2.lo: src/librandom/random_mask2.c src/librandom/random-internal.h src/include/skalibs/sysdeps.h
+src/librandom/random_name.o src/librandom/random_name.lo: src/librandom/random_name.c src/librandom/random-internal.h src/include/skalibs/random.h
+src/librandom/random_sauniquename.o src/librandom/random_sauniquename.lo: src/librandom/random_sauniquename.c src/include/skalibs/random.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/librandom/random_unsort.o src/librandom/random_unsort.lo: src/librandom/random_unsort.c src/include/skalibs/bytestr.h src/include/skalibs/random.h
+src/librandom/randomegd_open.o src/librandom/randomegd_open.lo: src/librandom/randomegd_open.c src/include/skalibs/djbunix.h src/include/skalibs/randomegd.h src/include/skalibs/webipc.h
+src/librandom/randomegd_readb.o src/librandom/randomegd_readb.lo: src/librandom/randomegd_readb.c src/include/skalibs/allreadwrite.h src/include/skalibs/randomegd.h
+src/librandom/randomegd_readnb.o src/librandom/randomegd_readnb.lo: src/librandom/randomegd_readnb.c src/include/skalibs/allreadwrite.h src/include/skalibs/randomegd.h
+src/librandom/rrandom_add.o src/librandom/rrandom_add.lo: src/librandom/rrandom_add.c src/include/skalibs/rrandom.h src/include/skalibs/unirandom.h
+src/librandom/rrandom_finish.o src/librandom/rrandom_finish.lo: src/librandom/rrandom_finish.c src/include/skalibs/rrandom.h src/include/skalibs/unirandom.h
+src/librandom/rrandom_name.o src/librandom/rrandom_name.lo: src/librandom/rrandom_name.c src/include/skalibs/rrandom.h src/include/skalibs/unirandom.h
+src/librandom/rrandom_read.o src/librandom/rrandom_read.lo: src/librandom/rrandom_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/error.h src/include/skalibs/rrandom.h src/include/skalibs/unirandom.h
+src/librandom/rrandom_readint.o src/librandom/rrandom_readint.lo: src/librandom/rrandom_readint.c src/librandom/random-internal.h src/include/skalibs/rrandom.h src/include/skalibs/uint.h src/include/skalibs/unirandom.h
+src/librandom/surf.o src/librandom/surf.lo: src/librandom/surf.c src/include/skalibs/bytestr.h src/include/skalibs/surf.h src/include/skalibs/uint32.h
+src/librandom/surf_autoinit.o src/librandom/surf_autoinit.lo: src/librandom/surf_autoinit.c src/include/skalibs/surf.h
+src/librandom/surf_here.o src/librandom/surf_here.lo: src/librandom/surf_here.c src/librandom/random-internal.h src/include/skalibs/surf.h
+src/librandom/surf_init.o src/librandom/surf_init.lo: src/librandom/surf_init.c src/include/skalibs/surf.h
+src/librandom/surf_makeseed.o src/librandom/surf_makeseed.lo: src/librandom/surf_makeseed.c src/include/skalibs/sha1.h src/include/skalibs/surf.h src/include/skalibs/tai.h src/include/skalibs/uint32.h
+src/librandom/surf_sinit.o src/librandom/surf_sinit.lo: src/librandom/surf_sinit.c src/include/skalibs/surf.h src/include/skalibs/uint32.h
+src/librandom/unidevrandom.o src/librandom/unidevrandom.lo: src/librandom/unidevrandom.c src/librandom/random-internal.h src/include/skalibs/sysdeps.h src/include/skalibs/unirandom.h src/include/skalibs/unirandomdev.h
+src/librandom/unidevurandom.o src/librandom/unidevurandom.lo: src/librandom/unidevurandom.c src/librandom/random-internal.h src/include/skalibs/sysdeps.h src/include/skalibs/unirandom.h src/include/skalibs/unirandomdev.h
+src/librandom/unihasegd.o src/librandom/unihasegd.lo: src/librandom/unihasegd.c src/include/skalibs/config.h src/librandom/random-internal.h src/include/skalibs/unirandom.h src/include/skalibs/unirandomegd.h
+src/librandom/unirandom_finish.o src/librandom/unirandom_finish.lo: src/librandom/unirandom_finish.c src/include/skalibs/unirandom.h
+src/librandom/unirandom_init.o src/librandom/unirandom_init.lo: src/librandom/unirandom_init.c src/include/skalibs/unirandom.h
+src/librandom/unirandom_readb.o src/librandom/unirandom_readb.lo: src/librandom/unirandom_readb.c src/include/skalibs/unirandom.h
+src/librandom/unirandom_readnb.o src/librandom/unirandom_readnb.lo: src/librandom/unirandom_readnb.c src/include/skalibs/unirandom.h
+src/librandom/unirandom_register.o src/librandom/unirandom_register.lo: src/librandom/unirandom_register.c src/librandom/random-internal.h src/include/skalibs/unirandom.h
+src/librandom/unirandomdev.o src/librandom/unirandomdev.lo: src/librandom/unirandomdev.c src/include/skalibs/buffer.h src/include/skalibs/djbunix.h src/include/skalibs/unirandom.h src/include/skalibs/unirandomdev.h
+src/librandom/unirandomegd.o src/librandom/unirandomegd.lo: src/librandom/unirandomegd.c src/include/skalibs/djbunix.h src/include/skalibs/randomegd.h src/include/skalibs/unirandom.h src/include/skalibs/unirandomegd.h
+src/librandom/unisurf.o src/librandom/unisurf.lo: src/librandom/unisurf.c src/include/skalibs/surf.h src/include/skalibs/unirandom.h src/include/skalibs/unisurf.h
+src/librandom/unisurf_init.o src/librandom/unisurf_init.lo: src/librandom/unisurf_init.c src/librandom/random-internal.h src/include/skalibs/surf.h src/include/skalibs/unirandom.h src/include/skalibs/unisurf.h
+src/libstdcrypto/md5_final.o src/libstdcrypto/md5_final.lo: src/libstdcrypto/md5_final.c src/include/skalibs/bytestr.h src/libstdcrypto/md5-internal.h src/include/skalibs/md5.h src/include/skalibs/uint32.h
+src/libstdcrypto/md5_init.o src/libstdcrypto/md5_init.lo: src/libstdcrypto/md5_init.c src/include/skalibs/md5.h
+src/libstdcrypto/md5_transform.o src/libstdcrypto/md5_transform.lo: src/libstdcrypto/md5_transform.c src/libstdcrypto/md5-internal.h src/include/skalibs/uint32.h
+src/libstdcrypto/md5_update.o src/libstdcrypto/md5_update.lo: src/libstdcrypto/md5_update.c src/include/skalibs/bytestr.h src/libstdcrypto/md5-internal.h src/include/skalibs/md5.h src/include/skalibs/uint32.h
+src/libstdcrypto/rc4.o src/libstdcrypto/rc4.lo: src/libstdcrypto/rc4.c src/include/skalibs/bytestr.h src/include/skalibs/rc4.h
+src/libstdcrypto/rc4_init.o src/libstdcrypto/rc4_init.lo: src/libstdcrypto/rc4_init.c src/include/skalibs/bytestr.h src/include/skalibs/rc4.h
+src/libstdcrypto/sha1_feed.o src/libstdcrypto/sha1_feed.lo: src/libstdcrypto/sha1_feed.c src/include/skalibs/bytestr.h src/libstdcrypto/sha1-internal.h src/include/skalibs/sha1.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha1_final.o src/libstdcrypto/sha1_final.lo: src/libstdcrypto/sha1_final.c src/libstdcrypto/sha1-internal.h src/include/skalibs/sha1.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha1_init.o src/libstdcrypto/sha1_init.lo: src/libstdcrypto/sha1_init.c src/include/skalibs/sha1.h
+src/libstdcrypto/sha1_transform.o src/libstdcrypto/sha1_transform.lo: src/libstdcrypto/sha1_transform.c src/libstdcrypto/sha1-internal.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha1_update.o src/libstdcrypto/sha1_update.lo: src/libstdcrypto/sha1_update.c src/libstdcrypto/sha1-internal.h src/include/skalibs/sha1.h
+src/libstdcrypto/sha256_feed.o src/libstdcrypto/sha256_feed.lo: src/libstdcrypto/sha256_feed.c src/include/skalibs/bytestr.h src/libstdcrypto/sha256-internal.h src/include/skalibs/sha256.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha256_final.o src/libstdcrypto/sha256_final.lo: src/libstdcrypto/sha256_final.c src/include/skalibs/bytestr.h src/libstdcrypto/sha256-internal.h src/include/skalibs/sha256.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha256_init.o src/libstdcrypto/sha256_init.lo: src/libstdcrypto/sha256_init.c src/include/skalibs/sha256.h
+src/libstdcrypto/sha256_transform.o src/libstdcrypto/sha256_transform.lo: src/libstdcrypto/sha256_transform.c src/libstdcrypto/sha256-internal.h src/include/skalibs/uint32.h
+src/libstdcrypto/sha256_update.o src/libstdcrypto/sha256_update.lo: src/libstdcrypto/sha256_update.c src/libstdcrypto/sha256-internal.h src/include/skalibs/sha256.h
+src/libstddjb/absolutepath.o src/libstddjb/absolutepath.lo: src/libstddjb/absolutepath.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/absolutepath_tmp.o src/libstddjb/absolutepath_tmp.lo: src/libstddjb/absolutepath_tmp.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/alloc.o src/libstddjb/alloc.lo: src/libstddjb/alloc.c src/libstddjb/alloc-internal.h src/include/skalibs/alloc.h src/include/skalibs/sysdeps.h
+src/libstddjb/alloc_0.o src/libstddjb/alloc_0.lo: src/libstddjb/alloc_0.c src/libstddjb/alloc-internal.h src/include/skalibs/alloc.h src/include/skalibs/sysdeps.h
+src/libstddjb/allread.o src/libstddjb/allread.lo: src/libstddjb/allread.c src/include/skalibs/allreadwrite.h
+src/libstddjb/allreadwrite.o src/libstddjb/allreadwrite.lo: src/libstddjb/allreadwrite.c src/include/skalibs/allreadwrite.h
+src/libstddjb/allwrite.o src/libstddjb/allwrite.lo: src/libstddjb/allwrite.c src/include/skalibs/allreadwrite.h
+src/libstddjb/baprintf.o src/libstddjb/baprintf.lo: src/libstddjb/baprintf.c src/include/skalibs/bufalloc.h src/include/skalibs/lolstdio.h
+src/libstddjb/basename.o src/libstddjb/basename.lo: src/libstddjb/basename.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/bitarray_and.o src/libstddjb/bitarray_and.lo: src/libstddjb/bitarray_and.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_clearsetn.o src/libstddjb/bitarray_clearsetn.lo: src/libstddjb/bitarray_clearsetn.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_firstclear.o src/libstddjb/bitarray_firstclear.lo: src/libstddjb/bitarray_firstclear.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_firstset.o src/libstddjb/bitarray_firstset.lo: src/libstddjb/bitarray_firstset.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_not.o src/libstddjb/bitarray_not.lo: src/libstddjb/bitarray_not.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_or.o src/libstddjb/bitarray_or.lo: src/libstddjb/bitarray_or.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_testandpoke.o src/libstddjb/bitarray_testandpoke.lo: src/libstddjb/bitarray_testandpoke.c src/include/skalibs/bitarray.h
+src/libstddjb/bitarray_xor.o src/libstddjb/bitarray_xor.lo: src/libstddjb/bitarray_xor.c src/include/skalibs/bitarray.h
+src/libstddjb/bprintf.o src/libstddjb/bprintf.lo: src/libstddjb/bprintf.c src/include/skalibs/buffer.h src/include/skalibs/lolstdio.h
+src/libstddjb/bufalloc_1.o src/libstddjb/bufalloc_1.lo: src/libstddjb/bufalloc_1.c src/include/skalibs/allreadwrite.h src/include/skalibs/bufalloc.h
+src/libstddjb/bufalloc_2.o src/libstddjb/bufalloc_2.lo: src/libstddjb/bufalloc_2.c src/include/skalibs/allreadwrite.h src/include/skalibs/bufalloc.h
+src/libstddjb/bufalloc_clean.o src/libstddjb/bufalloc_clean.lo: src/libstddjb/bufalloc_clean.c src/include/skalibs/bufalloc.h src/include/skalibs/bytestr.h
+src/libstddjb/bufalloc_flush.o src/libstddjb/bufalloc_flush.lo: src/libstddjb/bufalloc_flush.c src/include/skalibs/allreadwrite.h src/include/skalibs/bufalloc.h
+src/libstddjb/bufalloc_getfd.o src/libstddjb/bufalloc_getfd.lo: src/libstddjb/bufalloc_getfd.c src/include/skalibs/bufalloc.h
+src/libstddjb/bufalloc_getlen.o src/libstddjb/bufalloc_getlen.lo: src/libstddjb/bufalloc_getlen.c src/include/skalibs/bufalloc.h
+src/libstddjb/bufalloc_init.o src/libstddjb/bufalloc_init.lo: src/libstddjb/bufalloc_init.c src/include/skalibs/bufalloc.h src/include/skalibs/stralloc.h
+src/libstddjb/buffer_0.o src/libstddjb/buffer_0.lo: src/libstddjb/buffer_0.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_0f1.o src/libstddjb/buffer_0f1.lo: src/libstddjb/buffer_0f1.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_0small.o src/libstddjb/buffer_0small.lo: src/libstddjb/buffer_0small.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_1.o src/libstddjb/buffer_1.lo: src/libstddjb/buffer_1.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_1small.o src/libstddjb/buffer_1small.lo: src/libstddjb/buffer_1small.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_2.o src/libstddjb/buffer_2.lo: src/libstddjb/buffer_2.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_fill.o src/libstddjb/buffer_fill.lo: src/libstddjb/buffer_fill.c src/include/skalibs/buffer.h src/include/skalibs/cbuffer.h
+src/libstddjb/buffer_flush.o src/libstddjb/buffer_flush.lo: src/libstddjb/buffer_flush.c src/include/skalibs/buffer.h src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_flush1read.o src/libstddjb/buffer_flush1read.lo: src/libstddjb/buffer_flush1read.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_get.o src/libstddjb/buffer_get.lo: src/libstddjb/buffer_get.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_getall.o src/libstddjb/buffer_getall.lo: src/libstddjb/buffer_getall.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h
+src/libstddjb/buffer_getallnf.o src/libstddjb/buffer_getallnf.lo: src/libstddjb/buffer_getallnf.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_getfd.o src/libstddjb/buffer_getfd.lo: src/libstddjb/buffer_getfd.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_getlen.o src/libstddjb/buffer_getlen.lo: src/libstddjb/buffer_getlen.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_getv.o src/libstddjb/buffer_getv.lo: src/libstddjb/buffer_getv.c src/include/skalibs/buffer.h src/include/skalibs/diuint.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_getvall.o src/libstddjb/buffer_getvall.lo: src/libstddjb/buffer_getvall.c src/include/skalibs/buffer.h src/include/skalibs/diuint.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_getvallnf.o src/libstddjb/buffer_getvallnf.lo: src/libstddjb/buffer_getvallnf.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_init.o src/libstddjb/buffer_init.lo: src/libstddjb/buffer_init.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_put.o src/libstddjb/buffer_put.lo: src/libstddjb/buffer_put.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_putall.o src/libstddjb/buffer_putall.lo: src/libstddjb/buffer_putall.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_putallnf.o src/libstddjb/buffer_putallnf.lo: src/libstddjb/buffer_putallnf.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_putflush.o src/libstddjb/buffer_putflush.lo: src/libstddjb/buffer_putflush.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_putv.o src/libstddjb/buffer_putv.lo: src/libstddjb/buffer_putv.c src/include/skalibs/buffer.h src/include/skalibs/diuint.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_putvall.o src/libstddjb/buffer_putvall.lo: src/libstddjb/buffer_putvall.c src/include/skalibs/buffer.h src/include/skalibs/diuint.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_putvallnf.o src/libstddjb/buffer_putvallnf.lo: src/libstddjb/buffer_putvallnf.c src/include/skalibs/buffer.h
+src/libstddjb/buffer_putvflush.o src/libstddjb/buffer_putvflush.lo: src/libstddjb/buffer_putvflush.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_read.o src/libstddjb/buffer_read.lo: src/libstddjb/buffer_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/siovec.h
+src/libstddjb/buffer_write.o src/libstddjb/buffer_write.lo: src/libstddjb/buffer_write.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/siovec.h
+src/libstddjb/byte_chr.o src/libstddjb/byte_chr.lo: src/libstddjb/byte_chr.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/byte_copy.o src/libstddjb/byte_copy.lo: src/libstddjb/byte_copy.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/byte_count.o src/libstddjb/byte_count.lo: src/libstddjb/byte_count.c src/include/skalibs/bytestr.h
+src/libstddjb/byte_cr.o src/libstddjb/byte_cr.lo: src/libstddjb/byte_cr.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/byte_diff.o src/libstddjb/byte_diff.lo: src/libstddjb/byte_diff.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/byte_in.o src/libstddjb/byte_in.lo: src/libstddjb/byte_in.c src/include/skalibs/bytestr.h
+src/libstddjb/byte_rchr.o src/libstddjb/byte_rchr.lo: src/libstddjb/byte_rchr.c src/include/skalibs/bytestr.h
+src/libstddjb/byte_zero.o src/libstddjb/byte_zero.lo: src/libstddjb/byte_zero.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/case_diffb.o src/libstddjb/case_diffb.lo: src/libstddjb/case_diffb.c src/include/skalibs/bytestr.h
+src/libstddjb/case_diffs.o src/libstddjb/case_diffs.lo: src/libstddjb/case_diffs.c src/include/skalibs/bytestr.h
+src/libstddjb/case_lowerb.o src/libstddjb/case_lowerb.lo: src/libstddjb/case_lowerb.c src/include/skalibs/bytestr.h
+src/libstddjb/case_lowers.o src/libstddjb/case_lowers.lo: src/libstddjb/case_lowers.c src/include/skalibs/bytestr.h
+src/libstddjb/case_startb.o src/libstddjb/case_startb.lo: src/libstddjb/case_startb.c src/include/skalibs/bytestr.h
+src/libstddjb/case_str.o src/libstddjb/case_str.lo: src/libstddjb/case_str.c src/include/skalibs/bytestr.h src/include/skalibs/config.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/case_upperb.o src/libstddjb/case_upperb.lo: src/libstddjb/case_upperb.c src/include/skalibs/bytestr.h
+src/libstddjb/case_uppers.o src/libstddjb/case_uppers.lo: src/libstddjb/case_uppers.c src/include/skalibs/bytestr.h
+src/libstddjb/cbuffer_get.o src/libstddjb/cbuffer_get.lo: src/libstddjb/cbuffer_get.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_getv.o src/libstddjb/cbuffer_getv.lo: src/libstddjb/cbuffer_getv.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_init.o src/libstddjb/cbuffer_init.lo: src/libstddjb/cbuffer_init.c src/include/skalibs/cbuffer.h
+src/libstddjb/cbuffer_put.o src/libstddjb/cbuffer_put.lo: src/libstddjb/cbuffer_put.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_putv.o src/libstddjb/cbuffer_putv.lo: src/libstddjb/cbuffer_putv.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_rpeek.o src/libstddjb/cbuffer_rpeek.lo: src/libstddjb/cbuffer_rpeek.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_rseek.o src/libstddjb/cbuffer_rseek.lo: src/libstddjb/cbuffer_rseek.c src/include/skalibs/cbuffer.h
+src/libstddjb/cbuffer_unget.o src/libstddjb/cbuffer_unget.lo: src/libstddjb/cbuffer_unget.c src/include/skalibs/cbuffer.h
+src/libstddjb/cbuffer_unput.o src/libstddjb/cbuffer_unput.lo: src/libstddjb/cbuffer_unput.c src/include/skalibs/cbuffer.h
+src/libstddjb/cbuffer_wpeek.o src/libstddjb/cbuffer_wpeek.lo: src/libstddjb/cbuffer_wpeek.c src/include/skalibs/cbuffer.h src/include/skalibs/siovec.h
+src/libstddjb/cbuffer_wseek.o src/libstddjb/cbuffer_wseek.lo: src/libstddjb/cbuffer_wseek.c src/include/skalibs/cbuffer.h
+src/libstddjb/cdb_findnext.o src/libstddjb/cdb_findnext.lo: src/libstddjb/cdb_findnext.c src/include/skalibs/bytestr.h src/include/skalibs/cdb.h src/include/skalibs/uint32.h
+src/libstddjb/cdb_free.o src/libstddjb/cdb_free.lo: src/libstddjb/cdb_free.c src/include/skalibs/cdb.h
+src/libstddjb/cdb_hash.o src/libstddjb/cdb_hash.lo: src/libstddjb/cdb_hash.c src/include/skalibs/cdb.h src/include/skalibs/uint32.h
+src/libstddjb/cdb_init_map.o src/libstddjb/cdb_init_map.lo: src/libstddjb/cdb_init_map.c src/include/skalibs/cdb.h
+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/djbunix.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/bytestr.h src/include/skalibs/cdb.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/uint32.h
+src/libstddjb/cdb_successor.o src/libstddjb/cdb_successor.lo: src/libstddjb/cdb_successor.c src/include/skalibs/cdb.h src/include/skalibs/uint32.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/bytestr.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/uint.h src/include/skalibs/webipc.h
+src/libstddjb/child_spawn0.o src/libstddjb/child_spawn0.lo: src/libstddjb/child_spawn0.c src/include/skalibs/allreadwrite.h src/include/skalibs/config.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/sysdeps.h
+src/libstddjb/child_spawn1.o src/libstddjb/child_spawn1.lo: src/libstddjb/child_spawn1.c src/include/skalibs/allreadwrite.h src/include/skalibs/config.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/sysdeps.h
+src/libstddjb/coe.o src/libstddjb/coe.lo: src/libstddjb/coe.c src/include/skalibs/djbunix.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/dir_close.o src/libstddjb/dir_close.lo: src/libstddjb/dir_close.c src/include/skalibs/direntry.h
+src/libstddjb/dirname.o src/libstddjb/dirname.lo: src/libstddjb/dirname.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/doublefork.o src/libstddjb/doublefork.lo: src/libstddjb/doublefork.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/uint64.h
+src/libstddjb/env_addmodif.o src/libstddjb/env_addmodif.lo: src/libstddjb/env_addmodif.c src/include/skalibs/env.h src/include/skalibs/stralloc.h
+src/libstddjb/env_get.o src/libstddjb/env_get.lo: src/libstddjb/env_get.c src/include/skalibs/env.h src/include/skalibs/environ.h
+src/libstddjb/env_get2.o src/libstddjb/env_get2.lo: src/libstddjb/env_get2.c src/include/skalibs/bytestr.h src/include/skalibs/env.h
+src/libstddjb/env_len.o src/libstddjb/env_len.lo: src/libstddjb/env_len.c src/include/skalibs/env.h
+src/libstddjb/env_make.o src/libstddjb/env_make.lo: src/libstddjb/env_make.c src/include/skalibs/bytestr.h src/include/skalibs/env.h
+src/libstddjb/env_merge.o src/libstddjb/env_merge.lo: src/libstddjb/env_merge.c src/include/skalibs/bytestr.h src/include/skalibs/env.h
+src/libstddjb/env_string.o src/libstddjb/env_string.lo: src/libstddjb/env_string.c src/include/skalibs/env.h src/include/skalibs/stralloc.h
+src/libstddjb/envalloc_0.o src/libstddjb/envalloc_0.lo: src/libstddjb/envalloc_0.c src/include/skalibs/envalloc.h src/include/skalibs/genalloc.h
+src/libstddjb/envalloc_make.o src/libstddjb/envalloc_make.lo: src/libstddjb/envalloc_make.c src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/genalloc.h
+src/libstddjb/envalloc_merge.o src/libstddjb/envalloc_merge.lo: src/libstddjb/envalloc_merge.c src/include/skalibs/bytestr.h src/include/skalibs/env.h src/include/skalibs/envalloc.h src/include/skalibs/genalloc.h
+src/libstddjb/envalloc_uniq.o src/libstddjb/envalloc_uniq.lo: src/libstddjb/envalloc_uniq.c src/include/skalibs/bytestr.h src/include/skalibs/envalloc.h src/include/skalibs/genalloc.h
+src/libstddjb/envdir.o src/libstddjb/envdir.lo: src/libstddjb/envdir.c src/include/skalibs/bytestr.h src/include/skalibs/direntry.h src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/stralloc.h
+src/libstddjb/error_str.o src/libstddjb/error_str.lo: src/libstddjb/error_str.c src/include/skalibs/config.h src/include/skalibs/error.h
+src/libstddjb/error_temp.o src/libstddjb/error_temp.lo: src/libstddjb/error_temp.c src/include/skalibs/error.h
+src/libstddjb/execvep.o src/libstddjb/execvep.lo: src/libstddjb/execvep.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h
+src/libstddjb/fd_cat.o src/libstddjb/fd_cat.lo: src/libstddjb/fd_cat.c src/include/skalibs/djbunix.h src/include/skalibs/iobuffer.h
+src/libstddjb/fd_catn.o src/libstddjb/fd_catn.lo: src/libstddjb/fd_catn.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/iobuffer.h
+src/libstddjb/fd_chdir.o src/libstddjb/fd_chdir.lo: src/libstddjb/fd_chdir.c src/include/skalibs/djbunix.h
+src/libstddjb/fd_chmod.o src/libstddjb/fd_chmod.lo: src/libstddjb/fd_chmod.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h
+src/libstddjb/fd_chown.o src/libstddjb/fd_chown.lo: src/libstddjb/fd_chown.c src/include/skalibs/djbunix.h
+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_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
+src/libstddjb/fd_readv.o src/libstddjb/fd_readv.lo: src/libstddjb/fd_readv.c src/include/skalibs/allreadwrite.h
+src/libstddjb/fd_recv.o src/libstddjb/fd_recv.lo: src/libstddjb/fd_recv.c src/include/skalibs/allreadwrite.h
+src/libstddjb/fd_select.o src/libstddjb/fd_select.lo: src/libstddjb/fd_select.c
+src/libstddjb/fd_send.o src/libstddjb/fd_send.lo: src/libstddjb/fd_send.c src/include/skalibs/allreadwrite.h
+src/libstddjb/fd_sync.o src/libstddjb/fd_sync.lo: src/libstddjb/fd_sync.c src/include/skalibs/djbunix.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/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/genalloc_deepfree.o src/libstddjb/genalloc_deepfree.lo: src/libstddjb/genalloc_deepfree.c src/include/skalibs/genalloc.h src/include/skalibs/stralloc.h
+src/libstddjb/genwrite_flush_bufalloc.o src/libstddjb/genwrite_flush_bufalloc.lo: src/libstddjb/genwrite_flush_bufalloc.c src/include/skalibs/bufalloc.h src/include/skalibs/genwrite.h
+src/libstddjb/genwrite_flush_buffer.o src/libstddjb/genwrite_flush_buffer.lo: src/libstddjb/genwrite_flush_buffer.c src/include/skalibs/buffer.h src/include/skalibs/genwrite.h
+src/libstddjb/genwrite_flush_stralloc.o src/libstddjb/genwrite_flush_stralloc.lo: src/libstddjb/genwrite_flush_stralloc.c src/include/skalibs/genwrite.h
+src/libstddjb/genwrite_put_bufalloc.o src/libstddjb/genwrite_put_bufalloc.lo: src/libstddjb/genwrite_put_bufalloc.c src/include/skalibs/bufalloc.h src/include/skalibs/genwrite.h
+src/libstddjb/genwrite_put_buffer.o src/libstddjb/genwrite_put_buffer.lo: src/libstddjb/genwrite_put_buffer.c src/include/skalibs/buffer.h src/include/skalibs/genwrite.h
+src/libstddjb/genwrite_put_stralloc.o src/libstddjb/genwrite_put_stralloc.lo: src/libstddjb/genwrite_put_stralloc.c src/include/skalibs/genwrite.h src/include/skalibs/stralloc.h
+src/libstddjb/genwrite_stderr.o src/libstddjb/genwrite_stderr.lo: src/libstddjb/genwrite_stderr.c src/include/skalibs/buffer.h src/include/skalibs/genwrite.h
+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/bytestr.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/bytestr.h src/include/skalibs/skamisc.h
+src/libstddjb/getpeereid.o src/libstddjb/getpeereid.lo: src/libstddjb/getpeereid.c src/include/skalibs/getpeereid.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/int_scan.o src/libstddjb/int_scan.lo: src/libstddjb/int_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint.h
+src/libstddjb/iobuffer_fill.o src/libstddjb/iobuffer_fill.lo: src/libstddjb/iobuffer_fill.c src/include/skalibs/iobuffer.h
+src/libstddjb/iobuffer_flush.o src/libstddjb/iobuffer_flush.lo: src/libstddjb/iobuffer_flush.c src/include/skalibs/iobuffer.h
+src/libstddjb/iobuffer_init.o src/libstddjb/iobuffer_init.lo: src/libstddjb/iobuffer_init.c src/include/skalibs/iobuffer.h
+src/libstddjb/iobuffer_kfromu.o src/libstddjb/iobuffer_kfromu.lo: src/libstddjb/iobuffer_kfromu.c src/include/skalibs/buffer.h src/include/skalibs/iobuffer.h src/include/skalibs/nonposix.h src/include/skalibs/siovec.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobuffer_salvage.o src/libstddjb/iobuffer_salvage.lo: src/libstddjb/iobuffer_salvage.c src/include/skalibs/iobuffer.h
+src/libstddjb/iobuffer_ufromk.o src/libstddjb/iobuffer_ufromk.lo: src/libstddjb/iobuffer_ufromk.c src/include/skalibs/iobuffer.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_fill.o src/libstddjb/iobufferk_fill.lo: src/libstddjb/iobufferk_fill.c src/include/skalibs/iobuffer.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_finish.o src/libstddjb/iobufferk_finish.lo: src/libstddjb/iobufferk_finish.c src/include/skalibs/djbunix.h src/include/skalibs/iobuffer.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_flush.o src/libstddjb/iobufferk_flush.lo: src/libstddjb/iobufferk_flush.c src/include/skalibs/iobuffer.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_init.o src/libstddjb/iobufferk_init.lo: src/libstddjb/iobufferk_init.c src/include/skalibs/djbunix.h src/include/skalibs/iobuffer.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_isworking.o src/libstddjb/iobufferk_isworking.lo: src/libstddjb/iobufferk_isworking.c src/include/skalibs/iobuffer.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/iobufferk_nosys.o src/libstddjb/iobufferk_nosys.lo: src/libstddjb/iobufferk_nosys.c src/include/skalibs/iobuffer.h
+src/libstddjb/iobufferu_fill.o src/libstddjb/iobufferu_fill.lo: src/libstddjb/iobufferu_fill.c src/include/skalibs/buffer.h src/include/skalibs/iobuffer.h
+src/libstddjb/iobufferu_finish.o src/libstddjb/iobufferu_finish.lo: src/libstddjb/iobufferu_finish.c src/include/skalibs/alloc.h src/include/skalibs/iobuffer.h
+src/libstddjb/iobufferu_flush.o src/libstddjb/iobufferu_flush.lo: src/libstddjb/iobufferu_flush.c src/include/skalibs/buffer.h src/include/skalibs/iobuffer.h
+src/libstddjb/iobufferu_init.o src/libstddjb/iobufferu_init.lo: src/libstddjb/iobufferu_init.c src/include/skalibs/alloc.h src/include/skalibs/buffer.h src/include/skalibs/iobuffer.h
+src/libstddjb/iopause.o src/libstddjb/iopause.lo: src/libstddjb/iopause.c src/include/skalibs/config.h src/include/skalibs/iopause.h src/include/skalibs/sysdeps.h
+src/libstddjb/iopause_poll.o src/libstddjb/iopause_poll.lo: src/libstddjb/iopause_poll.c src/include/skalibs/iopause.h src/include/skalibs/tai.h
+src/libstddjb/iopause_ppoll.o src/libstddjb/iopause_ppoll.lo: src/libstddjb/iopause_ppoll.c src/include/skalibs/iopause.h src/include/skalibs/sysdeps.h src/include/skalibs/tai.h
+src/libstddjb/iopause_select.o src/libstddjb/iopause_select.lo: src/libstddjb/iopause_select.c src/include/skalibs/iopause.h src/include/skalibs/tai.h
+src/libstddjb/iopause_stamp.o src/libstddjb/iopause_stamp.lo: src/libstddjb/iopause_stamp.c src/include/skalibs/iopause.h src/include/skalibs/tai.h
+src/libstddjb/iovec_from_siovec.o src/libstddjb/iovec_from_siovec.lo: src/libstddjb/iovec_from_siovec.c src/include/skalibs/siovec.h
+src/libstddjb/ip46_scan.o src/libstddjb/ip46_scan.lo: src/libstddjb/ip46_scan.c src/include/skalibs/fmtscan.h src/include/skalibs/ip46.h
+src/libstddjb/ip46_scanlist.o src/libstddjb/ip46_scanlist.lo: src/libstddjb/ip46_scanlist.c src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h src/include/skalibs/ip46.h
+src/libstddjb/ip4_fmt.o src/libstddjb/ip4_fmt.lo: src/libstddjb/ip4_fmt.c src/include/skalibs/fmtscan.h src/include/skalibs/uint32.h
+src/libstddjb/ip4_fmtu32.o src/libstddjb/ip4_fmtu32.lo: src/libstddjb/ip4_fmtu32.c src/include/skalibs/fmtscan.h src/include/skalibs/uint32.h
+src/libstddjb/ip4_scan.o src/libstddjb/ip4_scan.lo: src/libstddjb/ip4_scan.c src/include/skalibs/uint.h
+src/libstddjb/ip4_scanlist.o src/libstddjb/ip4_scanlist.lo: src/libstddjb/ip4_scanlist.c src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h
+src/libstddjb/ip4_scanlist_u32.o src/libstddjb/ip4_scanlist_u32.lo: src/libstddjb/ip4_scanlist_u32.c src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h src/include/skalibs/uint32.h
+src/libstddjb/ip4_scanu32.o src/libstddjb/ip4_scanu32.lo: src/libstddjb/ip4_scanu32.c src/include/skalibs/fmtscan.h src/include/skalibs/uint32.h
+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/bytestr.h 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/bytestr.h src/include/skalibs/error.h src/include/skalibs/nonposix.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/bytestr.h src/include/skalibs/error.h src/include/skalibs/nonposix.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_eid.o src/libstddjb/ipc_eid.lo: src/libstddjb/ipc_eid.c src/include/skalibs/getpeereid.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/bytestr.h 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/bytestr.h src/include/skalibs/error.h src/include/skalibs/nonposix.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/tai.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
+src/libstddjb/leapsecs_here.o src/libstddjb/leapsecs_here.lo: src/libstddjb/leapsecs_here.c src/libstddjb/djbtime-internal.h src/include/skalibs/uint64.h
+src/libstddjb/leapsecs_init.o src/libstddjb/leapsecs_init.lo: src/libstddjb/leapsecs_init.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbunix.h src/include/skalibs/uint64.h
+src/libstddjb/leapsecs_sub.o src/libstddjb/leapsecs_sub.lo: src/libstddjb/leapsecs_sub.c src/libstddjb/djbtime-internal.h src/include/skalibs/uint64.h
+src/libstddjb/localtm_fmt.o src/libstddjb/localtm_fmt.lo: src/libstddjb/localtm_fmt.c src/include/skalibs/djbtime.h src/include/skalibs/uint.h
+src/libstddjb/localtm_from_ltm64.o src/libstddjb/localtm_from_ltm64.lo: src/libstddjb/localtm_from_ltm64.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/localtm_from_sysclock.o src/libstddjb/localtm_from_sysclock.lo: src/libstddjb/localtm_from_sysclock.c src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
+src/libstddjb/localtm_from_tai.o src/libstddjb/localtm_from_tai.lo: src/libstddjb/localtm_from_tai.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/localtm_from_utc.o src/libstddjb/localtm_from_utc.lo: src/libstddjb/localtm_from_utc.c src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
+src/libstddjb/localtm_scan.o src/libstddjb/localtm_scan.lo: src/libstddjb/localtm_scan.c src/include/skalibs/djbtime.h src/include/skalibs/uint.h
+src/libstddjb/localtmn_fmt.o src/libstddjb/localtmn_fmt.lo: src/libstddjb/localtmn_fmt.c src/include/skalibs/djbtime.h src/include/skalibs/uint32.h
+src/libstddjb/localtmn_from_sysclock.o src/libstddjb/localtmn_from_sysclock.lo: src/libstddjb/localtmn_from_sysclock.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/localtmn_from_tain.o src/libstddjb/localtmn_from_tain.lo: src/libstddjb/localtmn_from_tain.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/localtmn_scan.o src/libstddjb/localtmn_scan.lo: src/libstddjb/localtmn_scan.c src/include/skalibs/djbtime.h src/include/skalibs/uint32.h
+src/libstddjb/lock_ex.o src/libstddjb/lock_ex.lo: src/libstddjb/lock_ex.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/lock_exnb.o src/libstddjb/lock_exnb.lo: src/libstddjb/lock_exnb.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/lock_sh.o src/libstddjb/lock_sh.lo: src/libstddjb/lock_sh.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/lock_shnb.o src/libstddjb/lock_shnb.lo: src/libstddjb/lock_shnb.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/lock_un.o src/libstddjb/lock_un.lo: src/libstddjb/lock_un.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h
+src/libstddjb/lolprintf.o src/libstddjb/lolprintf.lo: src/libstddjb/lolprintf.c src/include/skalibs/buffer.h src/include/skalibs/lolstdio.h
+src/libstddjb/long_fmt.o src/libstddjb/long_fmt.lo: src/libstddjb/long_fmt.c src/include/skalibs/ulong.h
+src/libstddjb/long_scan.o src/libstddjb/long_scan.lo: src/libstddjb/long_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/ulong.h
+src/libstddjb/ltm64_from_localtm.o src/libstddjb/ltm64_from_localtm.lo: src/libstddjb/ltm64_from_localtm.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+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/include/skalibs/uint64.h
+src/libstddjb/ltm64_from_tai.o src/libstddjb/ltm64_from_tai.lo: src/libstddjb/ltm64_from_tai.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/ltm64_from_utc.o src/libstddjb/ltm64_from_utc.lo: src/libstddjb/ltm64_from_utc.c src/include/skalibs/config.h src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
+src/libstddjb/mininetstring_read.o src/libstddjb/mininetstring_read.lo: src/libstddjb/mininetstring_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/mininetstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint32.h
+src/libstddjb/mininetstring_write.o src/libstddjb/mininetstring_write.lo: src/libstddjb/mininetstring_write.c src/include/skalibs/allreadwrite.h src/include/skalibs/mininetstring.h src/include/skalibs/uint16.h src/include/skalibs/uint32.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/netstring_append.o src/libstddjb/netstring_append.lo: src/libstddjb/netstring_append.c src/include/skalibs/bytestr.h src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint.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/uint.h
+src/libstddjb/netstring_decode.o src/libstddjb/netstring_decode.lo: src/libstddjb/netstring_decode.c src/include/skalibs/fmtscan.h src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint.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/uint.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/cbuffer.h src/include/skalibs/error.h src/include/skalibs/netstring.h src/include/skalibs/stralloc.h src/include/skalibs/uint.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/uint.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/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/openreadclose.o src/libstddjb/openreadclose.lo: src/libstddjb/openreadclose.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.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/allreadwrite.h src/include/skalibs/djbunix.h
+src/libstddjb/openslurpclose.o src/libstddjb/openslurpclose.lo: src/libstddjb/openslurpclose.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/openwritenclose_suffix.o src/libstddjb/openwritenclose_suffix.lo: src/libstddjb/openwritenclose_suffix.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/uint64.h
+src/libstddjb/openwritenclose_unsafe.o src/libstddjb/openwritenclose_unsafe.lo: src/libstddjb/openwritenclose_unsafe.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/uint64.h
+src/libstddjb/pathexec.o src/libstddjb/pathexec.lo: src/libstddjb/pathexec.c src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/environ.h
+src/libstddjb/pathexec0.o src/libstddjb/pathexec0.lo: src/libstddjb/pathexec0.c src/include/skalibs/djbunix.h
+src/libstddjb/pathexec0_run.o src/libstddjb/pathexec0_run.lo: src/libstddjb/pathexec0_run.c src/include/skalibs/djbunix.h
+src/libstddjb/pathexec_fromenv.o src/libstddjb/pathexec_fromenv.lo: src/libstddjb/pathexec_fromenv.c src/include/skalibs/djbunix.h src/include/skalibs/env.h src/include/skalibs/stralloc.h
+src/libstddjb/pathexec_r.o src/libstddjb/pathexec_r.lo: src/libstddjb/pathexec_r.c src/include/skalibs/djbunix.h
+src/libstddjb/pathexec_r_name.o src/libstddjb/pathexec_r_name.lo: src/libstddjb/pathexec_r_name.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/env.h
+src/libstddjb/pathexec_run.o src/libstddjb/pathexec_run.lo: src/libstddjb/pathexec_run.c src/include/skalibs/config.h src/include/skalibs/djbunix.h src/include/skalibs/env.h
+src/libstddjb/pipe_internal.o src/libstddjb/pipe_internal.lo: src/libstddjb/pipe_internal.c src/include/skalibs/djbunix.h src/include/skalibs/sysdeps.h
+src/libstddjb/prog.o src/libstddjb/prog.lo: src/libstddjb/prog.c src/include/skalibs/strerr2.h
+src/libstddjb/prot.o src/libstddjb/prot.lo: src/libstddjb/prot.c src/include/skalibs/djbunix.h
+src/libstddjb/prot_grps.o src/libstddjb/prot_grps.lo: src/libstddjb/prot_grps.c src/include/skalibs/djbunix.h src/include/skalibs/nonposix.h src/include/skalibs/setgroups.h
+src/libstddjb/prot_readgroups.o src/libstddjb/prot_readgroups.lo: src/libstddjb/prot_readgroups.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h
+src/libstddjb/realpath.o src/libstddjb/realpath.lo: src/libstddjb/realpath.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h
+src/libstddjb/realpath_tmp.o src/libstddjb/realpath_tmp.lo: src/libstddjb/realpath_tmp.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.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
+src/libstddjb/rm_rf_in_tmp.o src/libstddjb/rm_rf_in_tmp.lo: src/libstddjb/rm_rf_in_tmp.c src/include/skalibs/bytestr.h src/include/skalibs/direntry.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/rm_rf_tmp.o src/libstddjb/rm_rf_tmp.lo: src/libstddjb/rm_rf_tmp.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/rmstar.o src/libstddjb/rmstar.lo: src/libstddjb/rmstar.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h
+src/libstddjb/sabasename.o src/libstddjb/sabasename.lo: src/libstddjb/sabasename.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/sadirname.o src/libstddjb/sadirname.lo: src/libstddjb/sadirname.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/sagetcwd.o src/libstddjb/sagetcwd.lo: src/libstddjb/sagetcwd.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/sagethostname.o src/libstddjb/sagethostname.lo: src/libstddjb/sagethostname.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/sanitize_read.o src/libstddjb/sanitize_read.lo: src/libstddjb/sanitize_read.c src/include/skalibs/allreadwrite.h src/include/skalibs/error.h
+src/libstddjb/sareadlink.o src/libstddjb/sareadlink.lo: src/libstddjb/sareadlink.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h
+src/libstddjb/satmp.o src/libstddjb/satmp.lo: src/libstddjb/satmp.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/sauniquename.o src/libstddjb/sauniquename.lo: src/libstddjb/sauniquename.c src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h src/include/skalibs/uint.h
+src/libstddjb/seek_cur.o src/libstddjb/seek_cur.lo: src/libstddjb/seek_cur.c src/include/skalibs/djbunix.h
+src/libstddjb/seek_set.o src/libstddjb/seek_set.lo: src/libstddjb/seek_set.c src/include/skalibs/djbunix.h
+src/libstddjb/selfpipe_finish.o src/libstddjb/selfpipe_finish.lo: src/libstddjb/selfpipe_finish.c src/include/skalibs/djbunix.h src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_init.o src/libstddjb/selfpipe_init.lo: src/libstddjb/selfpipe_init.c src/include/skalibs/djbunix.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_internal.o src/libstddjb/selfpipe_internal.lo: src/libstddjb/selfpipe_internal.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/libstddjb/selfpipe-internal.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_read.o src/libstddjb/selfpipe_read.lo: src/libstddjb/selfpipe_read.c src/include/skalibs/allreadwrite.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_trap.o src/libstddjb/selfpipe_trap.lo: src/libstddjb/selfpipe_trap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_trapset.o src/libstddjb/selfpipe_trapset.lo: src/libstddjb/selfpipe_trapset.c src/include/skalibs/nsig.h src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/selfpipe_untrap.o src/libstddjb/selfpipe_untrap.lo: src/libstddjb/selfpipe_untrap.c src/libstddjb/selfpipe-internal.h src/include/skalibs/selfpipe.h src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/sgetopt.o src/libstddjb/sgetopt.lo: src/libstddjb/sgetopt.c src/include/skalibs/buffer.h src/include/skalibs/sgetopt.h
+src/libstddjb/short_scan.o src/libstddjb/short_scan.lo: src/libstddjb/short_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/ushort.h
+src/libstddjb/sig.o src/libstddjb/sig.lo: src/libstddjb/sig.c src/include/skalibs/sig.h
+src/libstddjb/sig_block.o src/libstddjb/sig_block.lo: src/libstddjb/sig_block.c src/include/skalibs/sig.h
+src/libstddjb/sig_blocknone.o src/libstddjb/sig_blocknone.lo: src/libstddjb/sig_blocknone.c src/include/skalibs/sig.h
+src/libstddjb/sig_blockset.o src/libstddjb/sig_blockset.lo: src/libstddjb/sig_blockset.c src/include/skalibs/sig.h
+src/libstddjb/sig_catch.o src/libstddjb/sig_catch.lo: src/libstddjb/sig_catch.c src/include/skalibs/sig.h
+src/libstddjb/sig_pause.o src/libstddjb/sig_pause.lo: src/libstddjb/sig_pause.c src/include/skalibs/sig.h
+src/libstddjb/sig_push.o src/libstddjb/sig_push.lo: src/libstddjb/sig_push.c src/include/skalibs/sig.h
+src/libstddjb/sig_restoreto.o src/libstddjb/sig_restoreto.lo: src/libstddjb/sig_restoreto.c src/include/skalibs/sig.h
+src/libstddjb/sig_shield.o src/libstddjb/sig_shield.lo: src/libstddjb/sig_shield.c src/include/skalibs/sig.h
+src/libstddjb/sig_stack.o src/libstddjb/sig_stack.lo: src/libstddjb/sig_stack.c src/include/skalibs/nsig.h src/include/skalibs/sig.h
+src/libstddjb/sig_unblock.o src/libstddjb/sig_unblock.lo: src/libstddjb/sig_unblock.c src/include/skalibs/sig.h
+src/libstddjb/sig_unshield.o src/libstddjb/sig_unshield.lo: src/libstddjb/sig_unshield.c src/include/skalibs/sig.h
+src/libstddjb/sigfpe.o src/libstddjb/sigfpe.lo: src/libstddjb/sigfpe.c src/include/skalibs/segfault.h
+src/libstddjb/sigsegv.o src/libstddjb/sigsegv.lo: src/libstddjb/sigsegv.c src/include/skalibs/segfault.h
+src/libstddjb/siovec_bytechr.o src/libstddjb/siovec_bytechr.lo: src/libstddjb/siovec_bytechr.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/siovec_bytein.o src/libstddjb/siovec_bytein.lo: src/libstddjb/siovec_bytein.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/siovec_deal.o src/libstddjb/siovec_deal.lo: src/libstddjb/siovec_deal.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/siovec_from_iovec.o src/libstddjb/siovec_from_iovec.lo: src/libstddjb/siovec_from_iovec.c src/include/skalibs/siovec.h
+src/libstddjb/siovec_gather.o src/libstddjb/siovec_gather.lo: src/libstddjb/siovec_gather.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/siovec_len.o src/libstddjb/siovec_len.lo: src/libstddjb/siovec_len.c src/include/skalibs/siovec.h
+src/libstddjb/siovec_scatter.o src/libstddjb/siovec_scatter.lo: src/libstddjb/siovec_scatter.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/siovec_seek.o src/libstddjb/siovec_seek.lo: src/libstddjb/siovec_seek.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h
+src/libstddjb/skagetln.o src/libstddjb/skagetln.lo: src/libstddjb/skagetln.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/skagetlnsep.o src/libstddjb/skagetlnsep.lo: src/libstddjb/skagetlnsep.c src/include/skalibs/buffer.h src/include/skalibs/siovec.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/skasig_dfl.o src/libstddjb/skasig_dfl.lo: src/libstddjb/skasig_dfl.c src/include/skalibs/sig.h
+src/libstddjb/skasigaction.o src/libstddjb/skasigaction.lo: src/libstddjb/skasigaction.c src/include/skalibs/sig.h src/include/skalibs/sysdeps.h
+src/libstddjb/slurp.o src/libstddjb/slurp.lo: src/libstddjb/slurp.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/bytestr.h 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_u32.o src/libstddjb/socket_accept4_u32.lo: src/libstddjb/socket_accept4_u32.c src/include/skalibs/socket.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h
+src/libstddjb/socket_accept6.o src/libstddjb/socket_accept6.lo: src/libstddjb/socket_accept6.c src/include/skalibs/bytestr.h 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_bind4.o src/libstddjb/socket_bind4.lo: src/libstddjb/socket_bind4.c src/include/skalibs/bytestr.h 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/include/skalibs/uint16.h
+src/libstddjb/socket_bind6.o src/libstddjb/socket_bind6.lo: src/libstddjb/socket_bind6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_bind6r.o src/libstddjb/socket_bind6r.lo: src/libstddjb/socket_bind6r.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_conn4.o src/libstddjb/socket_conn4.lo: src/libstddjb/socket_conn4.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_conn4_u32.o src/libstddjb/socket_conn4_u32.lo: src/libstddjb/socket_conn4_u32.c src/include/skalibs/socket.h src/include/skalibs/uint16.h src/include/skalibs/uint32.h
+src/libstddjb/socket_conn6.o src/libstddjb/socket_conn6.lo: src/libstddjb/socket_conn6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_connected.o src/libstddjb/socket_connected.lo: src/libstddjb/socket_connected.c src/include/skalibs/allreadwrite.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h
+src/libstddjb/socket_deadlineconnstamp4.o src/libstddjb/socket_deadlineconnstamp4.lo: src/libstddjb/socket_deadlineconnstamp4.c src/include/skalibs/error.h src/include/skalibs/socket.h src/include/skalibs/tai.h src/include/skalibs/uint16.h
+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/include/skalibs/tai.h src/include/skalibs/uint16.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/tai.h src/include/skalibs/uint16.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/include/skalibs/tai.h src/include/skalibs/uint16.h
+src/libstddjb/socket_delay.o src/libstddjb/socket_delay.lo: src/libstddjb/socket_delay.c src/include/skalibs/nonposix.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/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/include/skalibs/tai.h src/include/skalibs/uint16.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
+src/libstddjb/socket_local4.o src/libstddjb/socket_local4.lo: src/libstddjb/socket_local4.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_local46.o src/libstddjb/socket_local46.lo: src/libstddjb/socket_local46.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/uint16.h
+src/libstddjb/socket_local6.o src/libstddjb/socket_local6.lo: src/libstddjb/socket_local6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_recv4.o src/libstddjb/socket_recv4.lo: src/libstddjb/socket_recv4.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_recv6.o src/libstddjb/socket_recv6.lo: src/libstddjb/socket_recv6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_remote4.o src/libstddjb/socket_remote4.lo: src/libstddjb/socket_remote4.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_remote46.o src/libstddjb/socket_remote46.lo: src/libstddjb/socket_remote46.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/uint16.h
+src/libstddjb/socket_remote6.o src/libstddjb/socket_remote6.lo: src/libstddjb/socket_remote6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_send4.o src/libstddjb/socket_send4.lo: src/libstddjb/socket_send4.c src/include/skalibs/bytestr.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_send6.o src/libstddjb/socket_send6.lo: src/libstddjb/socket_send6.c src/include/skalibs/bytestr.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h src/include/skalibs/uint16.h
+src/libstddjb/socket_tcp4.o src/libstddjb/socket_tcp4.lo: src/libstddjb/socket_tcp4.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h
+src/libstddjb/socket_tcp6.o src/libstddjb/socket_tcp6.lo: src/libstddjb/socket_tcp6.c src/include/skalibs/djbunix.h src/include/skalibs/ip46.h src/include/skalibs/nonposix.h src/include/skalibs/socket.h
+src/libstddjb/socket_timeoutconn.o src/libstddjb/socket_timeoutconn.lo: src/libstddjb/socket_timeoutconn.c src/include/skalibs/socket.h src/include/skalibs/tai.h src/include/skalibs/uint16.h
+src/libstddjb/socket_tryr.o src/libstddjb/socket_tryr.lo: src/libstddjb/socket_tryr.c src/include/skalibs/nonposix.h src/include/skalibs/socket.h
+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/include/skalibs/tai.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/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/include/skalibs/config.h
+src/libstddjb/str_cpy.o src/libstddjb/str_cpy.lo: src/libstddjb/str_cpy.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/str_diff.o src/libstddjb/str_diff.lo: src/libstddjb/str_diff.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/str_diffn.o src/libstddjb/str_diffn.lo: src/libstddjb/str_diffn.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/str_fmt.o src/libstddjb/str_fmt.lo: src/libstddjb/str_fmt.c src/include/skalibs/bytestr.h src/include/skalibs/fmtscan.h
+src/libstddjb/str_len.o src/libstddjb/str_len.lo: src/libstddjb/str_len.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/str_rchr.o src/libstddjb/str_rchr.lo: src/libstddjb/str_rchr.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/str_start.o src/libstddjb/str_start.lo: src/libstddjb/str_start.c src/include/skalibs/bytestr.h
+src/libstddjb/str_strn.o src/libstddjb/str_strn.lo: src/libstddjb/str_strn.c src/include/skalibs/bytestr.h src/include/skalibs/config.h
+src/libstddjb/stralloc_append.o src/libstddjb/stralloc_append.lo: src/libstddjb/stralloc_append.c src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_catb.o src/libstddjb/stralloc_catb.lo: src/libstddjb/stralloc_catb.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_catv.o src/libstddjb/stralloc_catv.lo: src/libstddjb/stralloc_catv.c src/include/skalibs/bytestr.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_copyb.o src/libstddjb/stralloc_copyb.lo: src/libstddjb/stralloc_copyb.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_free.o src/libstddjb/stralloc_free.lo: src/libstddjb/stralloc_free.c src/include/skalibs/alloc.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_insertb.o src/libstddjb/stralloc_insertb.lo: src/libstddjb/stralloc_insertb.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_ready_tuned.o src/libstddjb/stralloc_ready_tuned.lo: src/libstddjb/stralloc_ready_tuned.c src/include/skalibs/alloc.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_reverse.o src/libstddjb/stralloc_reverse.lo: src/libstddjb/stralloc_reverse.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_reverse_blocks.o src/libstddjb/stralloc_reverse_blocks.lo: src/libstddjb/stralloc_reverse_blocks.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_shrink.o src/libstddjb/stralloc_shrink.lo: src/libstddjb/stralloc_shrink.c src/include/skalibs/alloc.h src/include/skalibs/stralloc.h
+src/libstddjb/stralloc_zero.o src/libstddjb/stralloc_zero.lo: src/libstddjb/stralloc_zero.c src/include/skalibs/stralloc.h
+src/libstddjb/strerr.o src/libstddjb/strerr.lo: src/libstddjb/strerr.c src/include/skalibs/buffer.h src/include/skalibs/strerr.h
+src/libstddjb/strerr_sys.o src/libstddjb/strerr_sys.lo: src/libstddjb/strerr_sys.c src/include/skalibs/error.h src/include/skalibs/strerr.h
+src/libstddjb/string_format.o src/libstddjb/string_format.lo: src/libstddjb/string_format.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
+src/libstddjb/string_quote.o src/libstddjb/string_quote.lo: src/libstddjb/string_quote.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/string_quote_nodelim.o src/libstddjb/string_quote_nodelim.lo: src/libstddjb/string_quote_nodelim.c src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h
+src/libstddjb/string_quote_nodelim_mustquote.o src/libstddjb/string_quote_nodelim_mustquote.lo: src/libstddjb/string_quote_nodelim_mustquote.c src/include/skalibs/bytestr.h 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/bytestr.h 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/strn_fmt.o src/libstddjb/strn_fmt.lo: src/libstddjb/strn_fmt.c src/include/skalibs/fmtscan.h src/include/skalibs/uint.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
+src/libstddjb/sysclock_from_localtm.o src/libstddjb/sysclock_from_localtm.lo: src/libstddjb/sysclock_from_localtm.c src/include/skalibs/djbtime.h src/include/skalibs/uint64.h
+src/libstddjb/sysclock_from_localtmn.o src/libstddjb/sysclock_from_localtmn.lo: src/libstddjb/sysclock_from_localtmn.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/sysclock_from_ltm64.o src/libstddjb/sysclock_from_ltm64.lo: src/libstddjb/sysclock_from_ltm64.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/sysclock_from_tai.o src/libstddjb/sysclock_from_tai.lo: src/libstddjb/sysclock_from_tai.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/sysclock_from_utc.o src/libstddjb/sysclock_from_utc.lo: src/libstddjb/sysclock_from_utc.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/sysclock_get.o src/libstddjb/sysclock_get.lo: src/libstddjb/sysclock_get.c src/include/skalibs/config.h src/include/skalibs/sysdeps.h src/include/skalibs/tai.h
+src/libstddjb/sysclock_set.o src/libstddjb/sysclock_set.lo: src/libstddjb/sysclock_set.c src/include/skalibs/config.h src/include/skalibs/nonposix.h src/include/skalibs/sysdeps.h src/include/skalibs/tai.h
+src/libstddjb/tai_add.o src/libstddjb/tai_add.lo: src/libstddjb/tai_add.c src/include/skalibs/tai.h
+src/libstddjb/tai_from_localtm.o src/libstddjb/tai_from_localtm.lo: src/libstddjb/tai_from_localtm.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_from_ltm64.o src/libstddjb/tai_from_ltm64.lo: src/libstddjb/tai_from_ltm64.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_from_sysclock.o src/libstddjb/tai_from_sysclock.lo: src/libstddjb/tai_from_sysclock.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/tai_from_timespec.o src/libstddjb/tai_from_timespec.lo: src/libstddjb/tai_from_timespec.c src/include/skalibs/tai.h
+src/libstddjb/tai_from_timeval.o src/libstddjb/tai_from_timeval.lo: src/libstddjb/tai_from_timeval.c src/include/skalibs/tai.h
+src/libstddjb/tai_from_utc.o src/libstddjb/tai_from_utc.lo: src/libstddjb/tai_from_utc.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_now.o src/libstddjb/tai_now.lo: src/libstddjb/tai_now.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_pack.o src/libstddjb/tai_pack.lo: src/libstddjb/tai_pack.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_pack_little.o src/libstddjb/tai_pack_little.lo: src/libstddjb/tai_pack_little.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_relative_from_timespec.o src/libstddjb/tai_relative_from_timespec.lo: src/libstddjb/tai_relative_from_timespec.c src/include/skalibs/tai.h
+src/libstddjb/tai_relative_from_timeval.o src/libstddjb/tai_relative_from_timeval.lo: src/libstddjb/tai_relative_from_timeval.c src/include/skalibs/tai.h
+src/libstddjb/tai_sub.o src/libstddjb/tai_sub.lo: src/libstddjb/tai_sub.c src/include/skalibs/tai.h
+src/libstddjb/tai_unpack.o src/libstddjb/tai_unpack.lo: src/libstddjb/tai_unpack.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tai_unpack_little.o src/libstddjb/tai_unpack_little.lo: src/libstddjb/tai_unpack_little.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tain_add.o src/libstddjb/tain_add.lo: src/libstddjb/tain_add.c src/include/skalibs/tai.h
+src/libstddjb/tain_addsec.o src/libstddjb/tain_addsec.lo: src/libstddjb/tain_addsec.c src/include/skalibs/tai.h
+src/libstddjb/tain_approx.o src/libstddjb/tain_approx.lo: src/libstddjb/tain_approx.c src/include/skalibs/tai.h
+src/libstddjb/tain_clockmon.o src/libstddjb/tain_clockmon.lo: src/libstddjb/tain_clockmon.c src/include/skalibs/sysdeps.h src/include/skalibs/tai.h
+src/libstddjb/tain_fmt.o src/libstddjb/tain_fmt.lo: src/libstddjb/tain_fmt.c src/include/skalibs/fmtscan.h src/include/skalibs/tai.h
+src/libstddjb/tain_frac.o src/libstddjb/tain_frac.lo: src/libstddjb/tain_frac.c src/include/skalibs/tai.h
+src/libstddjb/tain_from_localtmn.o src/libstddjb/tain_from_localtmn.lo: src/libstddjb/tain_from_localtmn.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h
+src/libstddjb/tain_from_millisecs.o src/libstddjb/tain_from_millisecs.lo: src/libstddjb/tain_from_millisecs.c src/include/skalibs/tai.h
+src/libstddjb/tain_from_ntp.o src/libstddjb/tain_from_ntp.lo: src/libstddjb/tain_from_ntp.c src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tain_from_timespec.o src/libstddjb/tain_from_timespec.lo: src/libstddjb/tain_from_timespec.c src/include/skalibs/tai.h
+src/libstddjb/tain_from_timeval.o src/libstddjb/tain_from_timeval.lo: src/libstddjb/tain_from_timeval.c src/include/skalibs/tai.h
+src/libstddjb/tain_half.o src/libstddjb/tain_half.lo: src/libstddjb/tain_half.c src/include/skalibs/tai.h
+src/libstddjb/tain_infinite_relative.o src/libstddjb/tain_infinite_relative.lo: src/libstddjb/tain_infinite_relative.c src/include/skalibs/tai.h
+src/libstddjb/tain_less.o src/libstddjb/tain_less.lo: src/libstddjb/tain_less.c src/include/skalibs/tai.h
+src/libstddjb/tain_nano500.o src/libstddjb/tain_nano500.lo: src/libstddjb/tain_nano500.c src/include/skalibs/tai.h
+src/libstddjb/tain_now.o src/libstddjb/tain_now.lo: src/libstddjb/tain_now.c src/include/skalibs/config.h src/include/skalibs/sysdeps.h src/include/skalibs/tai.h
+src/libstddjb/tain_pack.o src/libstddjb/tain_pack.lo: src/libstddjb/tain_pack.c src/include/skalibs/tai.h src/include/skalibs/uint32.h
+src/libstddjb/tain_pack_little.o src/libstddjb/tain_pack_little.lo: src/libstddjb/tain_pack_little.c src/include/skalibs/tai.h src/include/skalibs/uint32.h
+src/libstddjb/tain_relative_from_timespec.o src/libstddjb/tain_relative_from_timespec.lo: src/libstddjb/tain_relative_from_timespec.c src/include/skalibs/tai.h
+src/libstddjb/tain_relative_from_timeval.o src/libstddjb/tain_relative_from_timeval.lo: src/libstddjb/tain_relative_from_timeval.c src/include/skalibs/tai.h
+src/libstddjb/tain_scan.o src/libstddjb/tain_scan.lo: src/libstddjb/tain_scan.c src/include/skalibs/fmtscan.h src/include/skalibs/tai.h
+src/libstddjb/tain_setnow.o src/libstddjb/tain_setnow.lo: src/libstddjb/tain_setnow.c src/include/skalibs/tai.h
+src/libstddjb/tain_sub.o src/libstddjb/tain_sub.lo: src/libstddjb/tain_sub.c src/include/skalibs/tai.h
+src/libstddjb/tain_sysclock.o src/libstddjb/tain_sysclock.lo: src/libstddjb/tain_sysclock.c src/include/skalibs/tai.h
+src/libstddjb/tain_to_millisecs.o src/libstddjb/tain_to_millisecs.lo: src/libstddjb/tain_to_millisecs.c src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/tain_ulong.o src/libstddjb/tain_ulong.lo: src/libstddjb/tain_ulong.c src/include/skalibs/tai.h
+src/libstddjb/tain_unpack.o src/libstddjb/tain_unpack.lo: src/libstddjb/tain_unpack.c src/include/skalibs/tai.h src/include/skalibs/uint32.h
+src/libstddjb/tain_unpack_little.o src/libstddjb/tain_unpack_little.lo: src/libstddjb/tain_unpack_little.c src/include/skalibs/tai.h src/include/skalibs/uint32.h
+src/libstddjb/timespec_from_tai.o src/libstddjb/timespec_from_tai.lo: src/libstddjb/timespec_from_tai.c src/include/skalibs/tai.h
+src/libstddjb/timespec_from_tai_relative.o src/libstddjb/timespec_from_tai_relative.lo: src/libstddjb/timespec_from_tai_relative.c src/include/skalibs/sysdeps.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/timespec_from_tain.o src/libstddjb/timespec_from_tain.lo: src/libstddjb/timespec_from_tain.c src/include/skalibs/tai.h
+src/libstddjb/timespec_from_tain_relative.o src/libstddjb/timespec_from_tain_relative.lo: src/libstddjb/timespec_from_tain_relative.c src/include/skalibs/tai.h
+src/libstddjb/timestamp.o src/libstddjb/timestamp.lo: src/libstddjb/timestamp.c src/include/skalibs/tai.h
+src/libstddjb/timestamp_fmt.o src/libstddjb/timestamp_fmt.lo: src/libstddjb/timestamp_fmt.c src/include/skalibs/tai.h
+src/libstddjb/timestamp_r.o src/libstddjb/timestamp_r.lo: src/libstddjb/timestamp_r.c src/include/skalibs/tai.h
+src/libstddjb/timestamp_scan.o src/libstddjb/timestamp_scan.lo: src/libstddjb/timestamp_scan.c src/include/skalibs/tai.h
+src/libstddjb/timeval_from_tai.o src/libstddjb/timeval_from_tai.lo: src/libstddjb/timeval_from_tai.c src/include/skalibs/tai.h
+src/libstddjb/timeval_from_tai_relative.o src/libstddjb/timeval_from_tai_relative.lo: src/libstddjb/timeval_from_tai_relative.c src/include/skalibs/sysdeps.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/timeval_from_tain.o src/libstddjb/timeval_from_tain.lo: src/libstddjb/timeval_from_tain.c src/include/skalibs/tai.h
+src/libstddjb/timeval_from_tain_relative.o src/libstddjb/timeval_from_tain_relative.lo: src/libstddjb/timeval_from_tain_relative.c src/include/skalibs/tai.h
+src/libstddjb/ucharn_findlen.o src/libstddjb/ucharn_findlen.lo: src/libstddjb/ucharn_findlen.c src/include/skalibs/fmtscan.h
+src/libstddjb/ucharn_fmt.o src/libstddjb/ucharn_fmt.lo: src/libstddjb/ucharn_fmt.c src/include/skalibs/fmtscan.h
+src/libstddjb/ucharn_fmt_little.o src/libstddjb/ucharn_fmt_little.lo: src/libstddjb/ucharn_fmt_little.c src/include/skalibs/fmtscan.h
+src/libstddjb/ucharn_scan.o src/libstddjb/ucharn_scan.lo: src/libstddjb/ucharn_scan.c src/include/skalibs/fmtscan.h
+src/libstddjb/ucharn_scan_little.o src/libstddjb/ucharn_scan_little.lo: src/libstddjb/ucharn_scan_little.c src/include/skalibs/fmtscan.h
+src/libstddjb/ucspi_get.o src/libstddjb/ucspi_get.lo: src/libstddjb/ucspi_get.c src/include/skalibs/bytestr.h src/include/skalibs/env.h
+src/libstddjb/uint160_scan.o src/libstddjb/uint160_scan.lo: src/libstddjb/uint160_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_fmtlist.o src/libstddjb/uint16_fmtlist.lo: src/libstddjb/uint16_fmtlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_pack.o src/libstddjb/uint16_pack.lo: src/libstddjb/uint16_pack.c src/include/skalibs/bytestr.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_pack_big.o src/libstddjb/uint16_pack_big.lo: src/libstddjb/uint16_pack_big.c src/include/skalibs/bytestr.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_reverse.o src/libstddjb/uint16_reverse.lo: src/libstddjb/uint16_reverse.c src/include/skalibs/uint16.h
+src/libstddjb/uint16_scan.o src/libstddjb/uint16_scan.lo: src/libstddjb/uint16_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_scanlist.o src/libstddjb/uint16_scanlist.lo: src/libstddjb/uint16_scanlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_unpack.o src/libstddjb/uint16_unpack.lo: src/libstddjb/uint16_unpack.c src/include/skalibs/bytestr.h src/include/skalibs/uint16.h
+src/libstddjb/uint16_unpack_big.o src/libstddjb/uint16_unpack_big.lo: src/libstddjb/uint16_unpack_big.c src/include/skalibs/bytestr.h src/include/skalibs/uint16.h
+src/libstddjb/uint320_scan.o src/libstddjb/uint320_scan.lo: src/libstddjb/uint320_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint32.h
+src/libstddjb/uint32_fmtlist.o src/libstddjb/uint32_fmtlist.lo: src/libstddjb/uint32_fmtlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint32_pack.o src/libstddjb/uint32_pack.lo: src/libstddjb/uint32_pack.c src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libstddjb/uint32_pack_big.o src/libstddjb/uint32_pack_big.lo: src/libstddjb/uint32_pack_big.c src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libstddjb/uint32_reverse.o src/libstddjb/uint32_reverse.lo: src/libstddjb/uint32_reverse.c src/include/skalibs/uint32.h
+src/libstddjb/uint32_scan.o src/libstddjb/uint32_scan.lo: src/libstddjb/uint32_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint32.h
+src/libstddjb/uint32_scanlist.o src/libstddjb/uint32_scanlist.lo: src/libstddjb/uint32_scanlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint32_unpack.o src/libstddjb/uint32_unpack.lo: src/libstddjb/uint32_unpack.c src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libstddjb/uint32_unpack_big.o src/libstddjb/uint32_unpack_big.lo: src/libstddjb/uint32_unpack_big.c src/include/skalibs/bytestr.h src/include/skalibs/uint32.h
+src/libstddjb/uint640_fmt.o src/libstddjb/uint640_fmt.lo: src/libstddjb/uint640_fmt.c src/include/skalibs/uint64.h
+src/libstddjb/uint640_scan.o src/libstddjb/uint640_scan.lo: src/libstddjb/uint640_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint64.h
+src/libstddjb/uint64_fmt.o src/libstddjb/uint64_fmt.lo: src/libstddjb/uint64_fmt.c src/include/skalibs/fmtscan.h src/include/skalibs/uint64.h
+src/libstddjb/uint64_fmtlist.o src/libstddjb/uint64_fmtlist.lo: src/libstddjb/uint64_fmtlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint64_pack.o src/libstddjb/uint64_pack.lo: src/libstddjb/uint64_pack.c src/include/skalibs/bytestr.h src/include/skalibs/uint64.h
+src/libstddjb/uint64_pack_big.o src/libstddjb/uint64_pack_big.lo: src/libstddjb/uint64_pack_big.c src/include/skalibs/bytestr.h src/include/skalibs/uint64.h
+src/libstddjb/uint64_reverse.o src/libstddjb/uint64_reverse.lo: src/libstddjb/uint64_reverse.c src/include/skalibs/uint64.h
+src/libstddjb/uint64_scan.o src/libstddjb/uint64_scan.lo: src/libstddjb/uint64_scan.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint64.h
+src/libstddjb/uint64_scanlist.o src/libstddjb/uint64_scanlist.lo: src/libstddjb/uint64_scanlist.c src/libstddjb/fmtscan-internal.h src/include/skalibs/uint16.h
+src/libstddjb/uint64_unpack.o src/libstddjb/uint64_unpack.lo: src/libstddjb/uint64_unpack.c src/include/skalibs/bytestr.h 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/bytestr.h src/include/skalibs/uint64.h
+src/libstddjb/uncoe.o src/libstddjb/uncoe.lo: src/libstddjb/uncoe.c src/include/skalibs/djbunix.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
+src/libstddjb/utc_from_sysclock.o src/libstddjb/utc_from_sysclock.lo: src/libstddjb/utc_from_sysclock.c src/include/skalibs/config.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/utc_from_tai.o src/libstddjb/utc_from_tai.lo: src/libstddjb/utc_from_tai.c src/libstddjb/djbtime-internal.h src/include/skalibs/djbtime.h src/include/skalibs/tai.h src/include/skalibs/uint64.h
+src/libstddjb/vbaprintf.o src/libstddjb/vbaprintf.lo: src/libstddjb/vbaprintf.c src/include/skalibs/bufalloc.h src/include/skalibs/lolstdio.h src/include/skalibs/stralloc.h
+src/libstddjb/vbprintf.o src/libstddjb/vbprintf.lo: src/libstddjb/vbprintf.c src/include/skalibs/buffer.h src/include/skalibs/lolstdio.h
+src/libstddjb/wait_nointr.o src/libstddjb/wait_nointr.lo: src/libstddjb/wait_nointr.c src/include/skalibs/djbunix.h
+src/libstddjb/wait_pid_nohang.o src/libstddjb/wait_pid_nohang.lo: src/libstddjb/wait_pid_nohang.c src/include/skalibs/djbunix.h
+src/libstddjb/wait_pids_nohang.o src/libstddjb/wait_pids_nohang.lo: src/libstddjb/wait_pids_nohang.c src/include/skalibs/djbunix.h
+src/libstddjb/wait_reap.o src/libstddjb/wait_reap.lo: src/libstddjb/wait_reap.c src/include/skalibs/djbunix.h
+src/libstddjb/waitn.o src/libstddjb/waitn.lo: src/libstddjb/waitn.c src/include/skalibs/djbunix.h
+src/libstddjb/waitn_reap.o src/libstddjb/waitn_reap.lo: src/libstddjb/waitn_reap.c src/include/skalibs/djbunix.h
+src/libstddjb/waitpid_nointr.o src/libstddjb/waitpid_nointr.lo: src/libstddjb/waitpid_nointr.c src/include/skalibs/djbunix.h
+src/libunixonacid/bufalloc_timed_flush.o src/libunixonacid/bufalloc_timed_flush.lo: src/libunixonacid/bufalloc_timed_flush.c src/include/skalibs/bufalloc.h src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/buffer_timed_fill.o src/libunixonacid/buffer_timed_fill.lo: src/libunixonacid/buffer_timed_fill.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/buffer_timed_flush.o src/libunixonacid/buffer_timed_flush.lo: src/libunixonacid/buffer_timed_flush.c src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/buffer_timed_get.o src/libunixonacid/buffer_timed_get.lo: src/libunixonacid/buffer_timed_get.c src/include/skalibs/buffer.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/dd_cancel.o src/libunixonacid/dd_cancel.lo: src/libunixonacid/dd_cancel.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/dd_close.o src/libunixonacid/dd_close.lo: src/libunixonacid/dd_close.c src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/dd_commit.o src/libunixonacid/dd_commit.lo: src/libunixonacid/dd_commit.c src/include/skalibs/bytestr.h src/include/skalibs/djbunix.h src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/dd_commit_devino.o src/libunixonacid/dd_commit_devino.lo: src/libunixonacid/dd_commit_devino.c src/include/skalibs/uint64.h src/include/skalibs/unix-transactional.h
+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/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
+src/libunixonacid/kolbak_unenqueue.o src/libunixonacid/kolbak_unenqueue.lo: src/libunixonacid/kolbak_unenqueue.c src/include/skalibs/kolbak.h
+src/libunixonacid/mkdir_unique.o src/libunixonacid/mkdir_unique.lo: src/libunixonacid/mkdir_unique.c src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.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/stralloc.h src/include/skalibs/tai.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/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_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_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_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/opengetlnclose.o src/libunixonacid/opengetlnclose.lo: src/libunixonacid/opengetlnclose.c src/include/skalibs/buffer.h src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/opengetlnclose_at.o src/libunixonacid/opengetlnclose_at.lo: src/libunixonacid/opengetlnclose_at.c src/include/skalibs/buffer.h src/include/skalibs/djbunix.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/openreadnclose_at.o src/libunixonacid/openreadnclose_at.lo: src/libunixonacid/openreadnclose_at.c src/include/skalibs/allreadwrite.h src/include/skalibs/djbunix.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/openslurpclose_at.o src/libunixonacid/openslurpclose_at.lo: src/libunixonacid/openslurpclose_at.c src/include/skalibs/djbunix.h src/include/skalibs/stralloc.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/openwritenclose.o src/libunixonacid/openwritenclose.lo: src/libunixonacid/openwritenclose.c src/include/skalibs/skamisc.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/openwritenclose_devino.o src/libunixonacid/openwritenclose_devino.lo: src/libunixonacid/openwritenclose_devino.c src/include/skalibs/skamisc.h src/include/skalibs/uint64.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/openwritenclose_devino_tmp.o src/libunixonacid/openwritenclose_devino_tmp.lo: src/libunixonacid/openwritenclose_devino_tmp.c src/include/skalibs/djbunix.h src/include/skalibs/random.h src/include/skalibs/stralloc.h src/include/skalibs/uint64.h src/include/skalibs/unix-transactional.h
+src/libunixonacid/openwritenclose_tmp.o src/libunixonacid/openwritenclose_tmp.lo: src/libunixonacid/openwritenclose_tmp.c src/include/skalibs/stralloc.h src/include/skalibs/uint64.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_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/include/skalibs/kolbak.h 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
+src/libunixonacid/skaclient_putmsg.o src/libunixonacid/skaclient_putmsg.lo: src/libunixonacid/skaclient_putmsg.c src/include/skalibs/kolbak.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_putmsgv.o src/libunixonacid/skaclient_putmsgv.lo: src/libunixonacid/skaclient_putmsgv.c src/include/skalibs/kolbak.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_putv.o src/libunixonacid/skaclient_putv.lo: src/libunixonacid/skaclient_putv.c src/include/skalibs/siovec.h src/include/skalibs/skaclient.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_send.o src/libunixonacid/skaclient_send.lo: src/libunixonacid/skaclient_send.c src/include/skalibs/skaclient.h src/include/skalibs/tai.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_sendmsg.o src/libunixonacid/skaclient_sendmsg.lo: src/libunixonacid/skaclient_sendmsg.c src/include/skalibs/skaclient.h src/include/skalibs/tai.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_sendmsgv.o src/libunixonacid/skaclient_sendmsgv.lo: src/libunixonacid/skaclient_sendmsgv.c src/include/skalibs/skaclient.h src/include/skalibs/tai.h src/include/skalibs/unixmessage.h
+src/libunixonacid/skaclient_sendv.o src/libunixonacid/skaclient_sendv.lo: src/libunixonacid/skaclient_sendv.c src/include/skalibs/siovec.h src/include/skalibs/skaclient.h src/include/skalibs/tai.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/bytestr.h 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_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/skaclient.h src/include/skalibs/tai.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/include/skalibs/tai.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/bytestr.h src/include/skalibs/error.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/include/skalibs/tai.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/include/skalibs/uint32.h
+src/libunixonacid/skaclient_zero.o src/libunixonacid/skaclient_zero.lo: src/libunixonacid/skaclient_zero.c src/include/skalibs/skaclient.h
+src/libunixonacid/timed_flush.o src/libunixonacid/timed_flush.lo: src/libunixonacid/timed_flush.c src/include/skalibs/bufalloc.h src/include/skalibs/error.h src/include/skalibs/functypes.h src/include/skalibs/iopause.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/timed_get.o src/libunixonacid/timed_get.lo: src/libunixonacid/timed_get.c src/include/skalibs/allreadwrite.h src/include/skalibs/functypes.h src/include/skalibs/iopause.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/timed_getln.o src/libunixonacid/timed_getln.lo: src/libunixonacid/timed_getln.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/skamisc.h src/include/skalibs/stralloc.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/timed_getlnmax.o src/libunixonacid/timed_getlnmax.lo: src/libunixonacid/timed_getlnmax.c src/include/skalibs/allreadwrite.h src/include/skalibs/buffer.h src/include/skalibs/functypes.h src/include/skalibs/skamisc.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h
+src/libunixonacid/unixmessage_bits_closeall.o src/libunixonacid/unixmessage_bits_closeall.lo: src/libunixonacid/unixmessage_bits_closeall.c src/include/skalibs/bitarray.h src/include/skalibs/unixmessage.h
+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_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/bytestr.h src/include/skalibs/diuint.h src/include/skalibs/genalloc.h src/include/skalibs/siovec.h src/include/skalibs/stralloc.h src/include/skalibs/sysdeps.h src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_read.o src/libunixonacid/unixmessage_read.lo: src/libunixonacid/unixmessage_read.c src/include/skalibs/buffer.h src/include/skalibs/cbuffer.h src/include/skalibs/djbunix.h src/include/skalibs/error.h src/include/skalibs/nonposix.h src/include/skalibs/siovec.h src/include/skalibs/sysdeps.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/buffer.h src/include/skalibs/cbuffer.h src/include/skalibs/error.h src/include/skalibs/stralloc.h src/include/skalibs/uint.h 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/stralloc.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/buffer.h src/include/skalibs/cbuffer.h src/include/skalibs/stralloc.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/diuint.h src/include/skalibs/djbunix.h src/include/skalibs/genalloc.h src/include/skalibs/nonposix.h src/include/skalibs/stralloc.h src/include/skalibs/sysdeps.h src/include/skalibs/uint.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/diuint.h src/include/skalibs/genalloc.h src/include/skalibs/stralloc.h src/include/skalibs/sysdeps.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/genalloc.h src/include/skalibs/stralloc.h src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_sender_timed_flush.o src/libunixonacid/unixmessage_sender_timed_flush.lo: src/libunixonacid/unixmessage_sender_timed_flush.c src/include/skalibs/functypes.h src/include/skalibs/genalloc.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_sender_zero.o src/libunixonacid/unixmessage_sender_zero.lo: src/libunixonacid/unixmessage_sender_zero.c src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_timed_handle.o src/libunixonacid/unixmessage_timed_handle.lo: src/libunixonacid/unixmessage_timed_handle.c src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_timed_receive.o src/libunixonacid/unixmessage_timed_receive.lo: src/libunixonacid/unixmessage_timed_receive.c src/include/skalibs/functypes.h src/include/skalibs/tai.h src/include/skalibs/unix-timed.h src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_v_zero.o src/libunixonacid/unixmessage_v_zero.lo: src/libunixonacid/unixmessage_v_zero.c src/include/skalibs/unixmessage.h
+src/libunixonacid/unixmessage_zero.o src/libunixonacid/unixmessage_zero.lo: src/libunixonacid/unixmessage_zero.c src/include/skalibs/unixmessage.h
diff --git a/package/info b/package/info
new file mode 100644
index 0000000..5da5a0c
--- /dev/null
+++ b/package/info
@@ -0,0 +1,4 @@
+package=skalibs
+version=2.0.0.0
+category=prog
+package_macro_name=SKALIBS
diff --git a/patch-for-solaris b/patch-for-solaris
new file mode 100755
index 0000000..02f2e3c
--- /dev/null
+++ b/patch-for-solaris
@@ -0,0 +1,17 @@
+#!/usr/xpg4/bin/sh
+
+patchit () {
+ echo '#!/usr/xpg4/bin/sh' > $1.tmp
+ tail -n +2 $1 >> $1.tmp
+ mv -f $1.tmp $1
+ chmod 755 $1
+}
+
+patchit ./configure
+patchit ./tools/install.sh
+patchit ./tools/gen-deps.sh
+
+echo 'SHELL := /usr/xpg4/bin/sh' > Makefile.tmp
+echo >> Makefile.tmp
+cat Makefile >> Makefile.tmp
+mv -f Makefile.tmp Makefile
diff --git a/src/etc/leapsecs.dat b/src/etc/leapsecs.dat
new file mode 100644
index 0000000..86a9a90
Binary files /dev/null and b/src/etc/leapsecs.dat differ
diff --git a/src/headers/error-addrinuse b/src/headers/error-addrinuse
new file mode 100644
index 0000000..6f1e4fe
--- /dev/null
+++ b/src/headers/error-addrinuse
@@ -0,0 +1,3 @@
+
+/* BSD sucks */
+#define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS) || ((e) == EADDRINUSE))
diff --git a/src/headers/error-already b/src/headers/error-already
new file mode 100644
index 0000000..ac6b8a7
--- /dev/null
+++ b/src/headers/error-already
@@ -0,0 +1 @@
+#define error_isalready(e) (((e) == EALREADY) || ((e) == EINPROGRESS))
diff --git a/src/headers/error-footer b/src/headers/error-footer
new file mode 100644
index 0000000..ddd5dae
--- /dev/null
+++ b/src/headers/error-footer
@@ -0,0 +1,2 @@
+
+#endif
diff --git a/src/headers/error-header b/src/headers/error-header
new file mode 100644
index 0000000..b891b6b
--- /dev/null
+++ b/src/headers/error-header
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#include
+#include
+
+extern char const *error_str (int) gccattr_const ;
+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
new file mode 100644
index 0000000..fd0c01d
--- /dev/null
+++ b/src/headers/error-proto
@@ -0,0 +1,3 @@
+
+/* Did I ever mention that BSD sucks ? */
+#define EPROTO EPROTOTYPE
diff --git a/src/headers/gidstuff-16 b/src/headers/gidstuff-16
new file mode 100644
index 0000000..491de89
--- /dev/null
+++ b/src/headers/gidstuff-16
@@ -0,0 +1,7 @@
+#include
+
+#define GID_FMT UINT16_FMT
+#define gid_fmt(s, u) uint16_fmt(s, u)
+#define gid_scan(s, u) uint16_scan(s, u)
+#define gid_fmtlist(s, tab, n) uint16_fmtlist(s, tab, n)
+#define gid_scanlist(tab, max, s, num) uint16_scanlist(tab, max, s, num)
diff --git a/src/headers/gidstuff-32 b/src/headers/gidstuff-32
new file mode 100644
index 0000000..a8ed0e8
--- /dev/null
+++ b/src/headers/gidstuff-32
@@ -0,0 +1,7 @@
+#include
+
+#define GID_FMT UINT32_FMT
+#define gid_fmt(s, u) uint32_fmt(s, u)
+#define gid_scan(s, u) uint32_scan(s, u)
+#define gid_fmtlist(s, tab, n) uint32_fmtlist(s, tab, n)
+#define gid_scanlist(tab, max, s, num) uint32_scanlist(tab, max, s, num)
diff --git a/src/headers/gidstuff-64 b/src/headers/gidstuff-64
new file mode 100644
index 0000000..3d441e6
--- /dev/null
+++ b/src/headers/gidstuff-64
@@ -0,0 +1,7 @@
+#include
+
+#define GID_FMT UINT64_FMT
+#define gid_fmt(s, u) uint64_fmt(s, u)
+#define gid_scan(s, u) uint64_scan(s, u)
+#define gid_fmtlist(s, tab, n) uint64_fmtlist(s, tab, n)
+#define gid_scanlist(tab, max, s, num) uint64_scanlist(tab, max, s, num)
diff --git a/src/headers/gidstuff-footer b/src/headers/gidstuff-footer
new file mode 100644
index 0000000..ddd5dae
--- /dev/null
+++ b/src/headers/gidstuff-footer
@@ -0,0 +1,2 @@
+
+#endif
diff --git a/src/headers/gidstuff-header b/src/headers/gidstuff-header
new file mode 100644
index 0000000..73bf86b
--- /dev/null
+++ b/src/headers/gidstuff-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef GIDSTUFF_H
+#define GIDSTUFF_H
+
diff --git a/src/headers/ip46-footer b/src/headers/ip46-footer
new file mode 100644
index 0000000..4340daf
--- /dev/null
+++ b/src/headers/ip46-footer
@@ -0,0 +1,10 @@
+
+#define ip46_from_ip(i, s, h) ((h) ? ip46_from_ip6(i, s) : ip46_from_ip4(i, s))
+
+#define socket_recvnb46_g(fd, buf, len, i, port, deadline) socket_recvnb46(fd, buf, len, i, port, (deadline), &STAMP)
+#define socket_sendnb46_g(fd, buf, len, i, port, deadline) socket_sendnb46(fd, buf, len, i, port, (deadline), &STAMP)
+
+extern int socket_deadlineconnstamp46 (int, ip46_t const *, uint16, tain_t const *, tain_t *) ;
+#define socket_deadlineconnstamp46_g(fd, ip, port, deadline) socket_deadlineconnstamp46(fd, ip, port, (deadline), &STAMP)
+
+#endif
diff --git a/src/headers/ip46-header b/src/headers/ip46-header
new file mode 100644
index 0000000..4f0cf8c
--- /dev/null
+++ b/src/headers/ip46-header
@@ -0,0 +1,34 @@
+/* ISC license. */
+
+#ifndef IP46_H
+#define IP46_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define IP46_FMT IP6_FMT
+#define IP4_ANY "\0\0\0"
+#define IP6_ANY "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+#define IP4_LOCAL "\177\0\0\1"
+#define IP6_LOCAL "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1"
+
+typedef struct ip46full_s ip46full_t, *ip46full_t_ref ;
+
+struct ip46full_s
+{
+ char ip[16] ;
+ unsigned int is6: 1 ;
+} ;
+#define IP46FULL_ZERO { .ip = IP6_ANY, .is6 = 0 }
+
+#define ip46full_is6(i) ((i)->is6)
+#define ip46full_fmt(s, i) ((i)->is6 ? ip6_fmt(s, (i)->ip) : ip4_fmt(s, (i)->ip))
+extern unsigned int ip46full_scan (char const *, ip46full_t_ref) ;
+extern unsigned int ip46full_scanlist (ip46full_t_ref, unsigned int, char const *, unsigned int *) ;
+#define ip46full_from_ip4(i, ip4) (byte_copy((i)->ip, 4, ip4), byte_zero((i)->ip + 4, 12), (i)->is6 = 0)
+#define ip46full_from_ip6(i, ip6) (byte_copy((i)->ip, 16, ip6), (i)->is6 = 1)
+
diff --git a/src/headers/ip46-with b/src/headers/ip46-with
new file mode 100644
index 0000000..0cd3d19
--- /dev/null
+++ b/src/headers/ip46-with
@@ -0,0 +1,24 @@
+typedef ip46full_t ip46_t, *ip46_t_ref ;
+#define IP46_ZERO IP46FULL_ZERO
+
+#define SKALIBS_IPV6_ENABLED
+#define SKALIBS_IP_SIZE 16
+#define ip46_is6(i) ip46full_is6(i)
+#define ip46_fmt(s, i) ip46full_fmt(s, i)
+#define ip46_scan(s, i) ip46full_scan(s, i)
+#define ip46_scanlist(out, max, s, num) ip46full_scanlist(out, max, s, num)
+#define ip46_from_ip4(i, ip4) (ip46full_from_ip4(i, ip4), 1)
+#define ip46_from_ip6(i, ip6) (ip46full_from_ip6(i, ip6), 1)
+
+#define socket_connect46(s, i, port) ((i)->is6 ? socket_connect6(s, (i)->ip, port) : socket_connect4(s, (i)->ip, port))
+#define socket_bind46(s, i, port) ((i)->is6 ? socket_bind6(s, (i)->ip, port) : socket_bind4(s, (i)->ip, port))
+#define socket_bind46_reuse(s, i, port) ((i)->is6 ? socket_bind6_reuse(s, (i)->ip, port) : socket_bind4_reuse(s, (i)->ip, port))
+#define socket_tcp46(h) ((h) ? socket_tcp6() : socket_tcp4())
+#define socket_udp46(h) ((h) ? socket_udp6() : socket_udp4())
+#define socket_recv46(fd, s, len, i, port) ((i)->is6 ? socket_recv6(fd, s, len, (i)->ip, port) : socket_recv4(fd, s, len, (i)->ip, port))
+#define socket_send46(fd, s, len, i, port) ((i)->is6 ? socket_send6(fd, s, len, (i)->ip, port) : socket_send4(fd, s, len, (i)->ip, port))
+extern int socket_local46 (int, ip46_t_ref, uint16 *) ;
+extern int socket_remote46 (int, ip46_t_ref, uint16 *) ;
+
+#define socket_recvnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_recvnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_recvnb4(fd, buf, len, (i)->ip, port, deadline, stamp))
+#define socket_sendnb46(fd, buf, len, i, port, deadline, stamp) ((i)->is6 ? socket_sendnb6(fd, buf, len, (i)->ip, port, deadline, stamp) : socket_sendnb4(fd, buf, len, (i)->ip, port, deadline, stamp))
diff --git a/src/headers/ip46-without b/src/headers/ip46-without
new file mode 100644
index 0000000..7887482
--- /dev/null
+++ b/src/headers/ip46-without
@@ -0,0 +1,28 @@
+typedef struct ip46_s ip46_t, *ip46_t_ref ;
+struct ip46_s
+{
+ char ip[4] ;
+} ;
+#define IP46_ZERO { .ip = "\0\0\0" }
+
+#undef SKALIBS_IPV6_ENABLED
+#define SKALIBS_IP_SIZE 4
+#define ip46_is6(ip) 0
+#define ip46_fmt(s, i) ip4_fmt(s, (i)->ip)
+#define ip46_scan(s, i) ip4_scan(s, (i)->ip)
+#define ip46_scanlist(out, max, s, num) ip4_scanlist((out)->ip, max, s, num)
+#define ip46_from_ip4(i, ip4) (byte_copy((i)->ip, 4, ip4), 1)
+#define ip46_from_ip6(i, ip6) (errno = ENOSYS, 0)
+
+#define socket_connect46(s, i, port) socket_connect4(s, (i)->ip, port)
+#define socket_bind46(s, i, port) socket_bind4(s, (i)->ip, port)
+#define socket_bind46_reuse(s, i, port) socket_bind4_reuse(s, (i)->ip, port)
+#define socket_tcp46(h) socket_tcp4()
+#define socket_udp46(h) socket_udp4()
+#define socket_recv46(fd, s, len, i, port) socket_recv4(fd, s, len, (i)->ip, port)
+#define socket_send46(fd, s, len, i, port) socket_send4(fd, s, len, (i)->ip, port)
+#define socket_local46(fd, i, port) socket_local4(fd, (i)->ip, port)
+#define socket_remote46(fd, i, port) socket_remote4(fd, (i)->ip, port)
+
+#define socket_recvnb46(fd, buf, len, i, port, deadline, stamp) socket_recvnb4(fd, buf, len, (i)->ip, port, deadline, stamp)
+#define socket_sendnb46(fd, buf, len, i, port, deadline, stamp) socket_sendnb4(fd, buf, len, (i)->ip, port, deadline, stamp)
diff --git a/src/headers/setgroups-footer b/src/headers/setgroups-footer
new file mode 100644
index 0000000..ddd5dae
--- /dev/null
+++ b/src/headers/setgroups-footer
@@ -0,0 +1,2 @@
+
+#endif
diff --git a/src/headers/setgroups-header b/src/headers/setgroups-header
new file mode 100644
index 0000000..0b8697a
--- /dev/null
+++ b/src/headers/setgroups-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef SETGROUPS_H
+#define SETGROUPS_H
+
diff --git a/src/headers/setgroups-stub b/src/headers/setgroups-stub
new file mode 100644
index 0000000..3c54861
--- /dev/null
+++ b/src/headers/setgroups-stub
@@ -0,0 +1,2 @@
+#include
+#define setgroups(n, s) (errno = ENOSYS, -1)
diff --git a/src/headers/uint-16 b/src/headers/uint-16
new file mode 100644
index 0000000..85434db
--- /dev/null
+++ b/src/headers/uint-16
@@ -0,0 +1,34 @@
+#include
+
+#define UINT_PACK 2
+#define uint_pack uint16_pack
+#define uint_pack_big uint16_pack_big
+#define uint_unpack(s, u) uint16_unpack(s, (uint16 *)(char *)(u))
+#define uint_unpack_big(s, u) uint16_unpack_big(s, (uint16 *)(char *)(u))
+
+#define uint_reverse uint16_reverse
+#define uint_big_endian uint16_big_endian
+#define uint_little_endian uint16_little_endian
+
+#define UINT_FMT UINT16_FMT
+#define UINT_OFMT UINT16_OFMT
+#define UINT_XFMT UINT16_XFMT
+#define UINT_BFMT UINT16_BFMT
+
+#define uint_fmt_base uint16_fmt_base
+#define uint0_fmt_base uint160_fmt_base
+#define uint_fmt uint16_fmt
+#define uint0_fmt uint160_fmt
+#define uint_ofmt uint16_ofmt
+#define uint0_ofmt uint160_ofmt
+#define uint_xfmt uint16_xfmt
+#define uint0_xfmt uint160_xfmt
+#define uint_bfmt uint16_bfmt
+#define uint0_bfmt uint160_bfmt
+
+#define uint_fmtlist(s, tab, n) uint16_fmtlist(s, tab, n)
+
+#define uint_scan_base(s, u, b) uint16_scan_base(s, (uint16 *)(char *)(u), b)
+#define uint0_scan_base(s, u, b) uint160_scan_base(s, (uint16 *)(char *)(u), b)
+
+#define uint_scanlist(tab, max, s, num) uint16_scanlist(tab, max, s, num)
diff --git a/src/headers/uint-32 b/src/headers/uint-32
new file mode 100644
index 0000000..32c6600
--- /dev/null
+++ b/src/headers/uint-32
@@ -0,0 +1,34 @@
+#include
+
+#define UINT_PACK 4
+#define uint_pack uint32_pack
+#define uint_pack_big uint32_pack_big
+#define uint_unpack(s, u) uint32_unpack(s, (uint32 *)(char *)(u))
+#define uint_unpack_big(s, u) uint32_unpack_big(s, (uint32 *)(char *)(u))
+
+#define uint_reverse uint32_reverse
+#define uint_big_endian uint32_big_endian
+#define uint_little_endian uint32_little_endian
+
+#define UINT_FMT UINT32_FMT
+#define UINT_OFMT UINT32_OFMT
+#define UINT_XFMT UINT32_XFMT
+#define UINT_BFMT UINT32_BFMT
+
+#define uint_fmt_base uint32_fmt_base
+#define uint0_fmt_base uint320_fmt_base
+#define uint_fmt uint32_fmt
+#define uint0_fmt uint320_fmt
+#define uint_ofmt uint32_ofmt
+#define uint0_ofmt uint320_ofmt
+#define uint_xfmt uint32_xfmt
+#define uint0_xfmt uint320_xfmt
+#define uint_bfmt uint32_bfmt
+#define uint0_bfmt uint320_bfmt
+
+#define uint_fmtlist(s, tab, n) uint32_fmtlist(s, tab, n)
+
+#define uint_scan_base(s, u, b) uint32_scan_base(s, (uint32 *)(char *)(u), b)
+#define uint0_scan_base(s, u, b) uint320_scan_base(s, (uint32 *)(char *)(u), b)
+
+#define uint_scanlist(tab, max, s, num) uint32_scanlist(tab, max, s, num)
diff --git a/src/headers/uint-64 b/src/headers/uint-64
new file mode 100644
index 0000000..31926d9
--- /dev/null
+++ b/src/headers/uint-64
@@ -0,0 +1,34 @@
+#include
+
+#define UINT_PACK 8
+#define uint_pack uint64_pack
+#define uint_pack_big uint64_pack_big
+#define uint_unpack(s, u) uint64_unpack(s, (uint64 *)(char *)(u))
+#define uint_unpack_big(s, u) uint64_unpack_big(s, (uint64 *)(char *)(u))
+
+#define uint_reverse uint64_reverse
+#define uint_big_endian uint64_big_endian
+#define uint_little_endian uint64_little_endian
+
+#define UINT_FMT UINT64_FMT
+#define UINT_OFMT UINT64_OFMT
+#define UINT_XFMT UINT64_XFMT
+#define UINT_BFMT UINT64_BFMT
+
+#define uint_fmt_base uint64_fmt_base
+#define uint0_fmt_base uint640_fmt_base
+#define uint_fmt uint64_fmt
+#define uint0_fmt uint640_fmt
+#define uint_ofmt uint64_ofmt
+#define uint0_ofmt uint640_ofmt
+#define uint_xfmt uint64_xfmt
+#define uint0_xfmt uint640_xfmt
+#define uint_bfmt uint64_bfmt
+#define uint0_bfmt uint640_bfmt
+
+#define uint_fmtlist(s, tab, n) uint64_fmtlist(s, tab, n)
+
+#define uint_scan_base(s, u, b) uint64_scan_base(s, (uint64 *)(char *)(u), b)
+#define uint0_scan_base(s, u, b) uint640_scan_base(s, (uint64 *)(char *)(u), b)
+
+#define uint_scanlist(tab, max, s, num) uint64_scanlist(tab, max, s, num)
diff --git a/src/headers/uint-footer b/src/headers/uint-footer
new file mode 100644
index 0000000..68bbaf7
--- /dev/null
+++ b/src/headers/uint-footer
@@ -0,0 +1,10 @@
+#define uint_scan(s, u) uint_scan_base(s, (u), 10)
+#define uint0_scan(s, u) uint0_scan_base(s, (u), 10)
+#define uint_oscan(s, u) uint_scan_base(s, (u), 8)
+#define uint0_oscan(s, u) uint0_scan_base(s, (u), 8)
+#define uint_xscan(s, u) uint_scan_base(s, (u), 16)
+#define uint0_xscan(s, u) uint0_scan_base(s, (u), 16)
+#define uint_bscan(s, u) uint_scan_base(s, (u), 2)
+#define uint0_bscan(s, u) uint0_scan_base(s, (u), 2)
+
+#endif
diff --git a/src/headers/uint-header b/src/headers/uint-header
new file mode 100644
index 0000000..8136b0c
--- /dev/null
+++ b/src/headers/uint-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef UINT_H
+#define UINT_H
+
diff --git a/src/headers/uint16-bendian b/src/headers/uint16-bendian
new file mode 100644
index 0000000..e1d0427
--- /dev/null
+++ b/src/headers/uint16-bendian
@@ -0,0 +1,3 @@
+#define uint16_little_endian(s, n) uint16_reverse((s), (n))
+#define uint16_big_endian(s, n)
+
diff --git a/src/headers/uint16-footer b/src/headers/uint16-footer
new file mode 100644
index 0000000..5602571
--- /dev/null
+++ b/src/headers/uint16-footer
@@ -0,0 +1,40 @@
+
+extern void uint16_pack (char *, uint16) ;
+extern void uint16_pack_big (char *, uint16) ;
+extern void uint16_unpack (char const *, uint16 *) ;
+extern void uint16_unpack_big (char const *, uint16 *) ;
+extern void uint16_reverse (char *, unsigned int) ;
+
+#define UINT16_FMT 6
+#define UINT16_OFMT 7
+#define UINT16_XFMT 5
+#define UINT16_BFMT 17
+
+#define uint16_fmt_base(s, u, b) uint64_fmt_base(s, (uint64)(uint16)(u), b)
+#define uint160_fmt_base(s, u, n, b) uint640_fmt_base(s, (uint64)(uint16)(u), n, b)
+
+#define uint16_fmt(s, u) uint64_fmt(s, (uint64)(uint16)(u))
+#define uint160_fmt(s, u, n) uint64_fmt(s, (uint64)(uint16)(u), n)
+#define uint16_ofmt(s, o) uint64_ofmt(s, (uint64)(uint16)(o))
+#define uint160_ofmt(s, o, n) uint64_ofmt(s, (uint64)(uint16)(o), n)
+#define uint16_xfmt(s, x) uint64_xfmt(s, (uint64)(uint16)(x))
+#define uint160_xfmt(s, x, n) uint64_xfmt(s, (uint64)(uint16)(x), n)
+#define uint16_bfmt(s, b) uint64_bfmt(s, (uint64)(uint16)(b))
+#define uint160_bfmt(s, b, n) uint64_bfmt(s, (uint64)(uint16)(b), n)
+
+extern unsigned int uint16_fmtlist (char *, uint16 const *, unsigned int) ;
+
+extern unsigned int uint16_scan_base (char const *, uint16 *, unsigned char) ;
+extern unsigned int uint160_scan_base (char const *, uint16 *, unsigned char) ;
+#define uint16_scan(s, u) uint16_scan_base(s, (u), 10)
+#define uint160_scan(s, u) uint160_scan_base(s, (u), 10)
+#define uint16_oscan(s, u) uint16_scan_base(s, (u), 8)
+#define uint160_oscan(s, u) uint160_scan_base(s, (u), 8)
+#define uint16_xscan(s, u) uint16_scan_base(s, (u), 16)
+#define uint160_xscan(s, u) uint160_scan_base(s, (u), 16)
+#define uint16_bscan(s, u) uint16_scan_base(s, (u), 2)
+#define uint160_bscan(s, u) uint160_scan_base(s, (u), 2)
+
+extern unsigned int uint16_scanlist (uint16 *, unsigned int, char const *, unsigned int *) ;
+
+#endif
diff --git a/src/headers/uint16-header b/src/headers/uint16-header
new file mode 100644
index 0000000..a8058c6
--- /dev/null
+++ b/src/headers/uint16-header
@@ -0,0 +1,9 @@
+/* ISC license. */
+
+#ifndef UINT16_H
+#define UINT16_H
+
+#include
+#include
+
+typedef uint16_t uint16 ;
diff --git a/src/headers/uint16-lendian b/src/headers/uint16-lendian
new file mode 100644
index 0000000..a9f9945
--- /dev/null
+++ b/src/headers/uint16-lendian
@@ -0,0 +1,3 @@
+#define uint16_little_endian(s, n)
+#define uint16_big_endian(s, n) uint16_reverse((s), (n))
+
diff --git a/src/headers/uint32-bendian b/src/headers/uint32-bendian
new file mode 100644
index 0000000..27903c7
--- /dev/null
+++ b/src/headers/uint32-bendian
@@ -0,0 +1,3 @@
+#define uint32_little_endian(s, n) uint32_reverse((s), (n))
+#define uint32_big_endian(s, n)
+
diff --git a/src/headers/uint32-footer b/src/headers/uint32-footer
new file mode 100644
index 0000000..7cfe7ba
--- /dev/null
+++ b/src/headers/uint32-footer
@@ -0,0 +1,39 @@
+extern void uint32_pack (char *, uint32) ;
+extern void uint32_pack_big (char *, uint32) ;
+extern void uint32_unpack (char const *, uint32 *) ;
+extern void uint32_unpack_big (char const *, uint32 *) ;
+extern void uint32_reverse (char *, unsigned int) ;
+
+#define UINT32_FMT 11
+#define UINT32_OFMT 13
+#define UINT32_XFMT 9
+#define UINT32_BFMT 33
+
+#define uint32_fmt_base(s, u, b) uint64_fmt_base(s, (uint64)(uint32)(u), b)
+#define uint320_fmt_base(s, u, n, b) uint640_fmt_base(s, (uint64)(uint32)(u), n, b)
+
+#define uint32_fmt(s, u) uint64_fmt(s, (uint64)(uint32)(u))
+#define uint320_fmt(s, u, n) uint640_fmt(s, (uint64)(uint32)(u), n)
+#define uint32_ofmt(s, o) uint64_ofmt(s, (uint64)(uint32)(o))
+#define uint320_ofmt(s, o, n) uint640_ofmt(s, (uint64)(uint32)(o), n)
+#define uint32_xfmt(s, x) uint64_xfmt(s, (uint64)(uint32)(x))
+#define uint320_xfmt(s, x, n) uint640_xfmt(s, (uint64)(uint32)(x), n)
+#define uint32_bfmt(s, b) uint64_bfmt(s, (uint64)(uint32)(b))
+#define uint320_bfmt(s, b, n) uint640_bfmt(s, (uint64)(uint32)(b), n)
+
+extern unsigned int uint32_fmtlist (char *, uint32 const *, unsigned int) ;
+
+extern unsigned int uint32_scan_base (char const *, uint32 *, unsigned char) ;
+extern unsigned int uint320_scan_base (char const *, uint32 *, unsigned char) ;
+#define uint32_scan(s, u) uint32_scan_base(s, (u), 10)
+#define uint320_scan(s, u) uint320_scan_base(s, (u), 10)
+#define uint32_oscan(s, u) uint32_scan_base(s, (u), 8)
+#define uint320_oscan(s, u) uint320_scan_base(s, (u), 8)
+#define uint32_xscan(s, u) uint32_scan_base(s, (u), 16)
+#define uint320_xscan(s, u) uint320_scan_base(s, (u), 16)
+#define uint32_bscan(s, u) uint32_scan_base(s, (u), 2)
+#define uint320_bscan(s, u) uint320_scan_base(s, (u), 2)
+
+extern unsigned int uint32_scanlist (uint32 *, unsigned int, char const *, unsigned int *) ;
+
+#endif
diff --git a/src/headers/uint32-header b/src/headers/uint32-header
new file mode 100644
index 0000000..f71267f
--- /dev/null
+++ b/src/headers/uint32-header
@@ -0,0 +1,9 @@
+/* ISC license. */
+
+#ifndef UINT32_H
+#define UINT32_H
+
+#include
+#include
+
+typedef uint32_t uint32 ;
diff --git a/src/headers/uint32-inttypesh b/src/headers/uint32-inttypesh
new file mode 100644
index 0000000..47a8910
--- /dev/null
+++ b/src/headers/uint32-inttypesh
@@ -0,0 +1,3 @@
+#include
+typedef uint32_t uint32 ;
+
diff --git a/src/headers/uint32-lendian b/src/headers/uint32-lendian
new file mode 100644
index 0000000..f88c111
--- /dev/null
+++ b/src/headers/uint32-lendian
@@ -0,0 +1,3 @@
+#define uint32_little_endian(s, n)
+#define uint32_big_endian(s, n) uint32_reverse((s), (n))
+
diff --git a/src/headers/uint32-noulong32 b/src/headers/uint32-noulong32
new file mode 100644
index 0000000..4705047
--- /dev/null
+++ b/src/headers/uint32-noulong32
@@ -0,0 +1,2 @@
+typedef unsigned int uint32 ;
+
diff --git a/src/headers/uint32-stdinth b/src/headers/uint32-stdinth
new file mode 100644
index 0000000..dc9eb42
--- /dev/null
+++ b/src/headers/uint32-stdinth
@@ -0,0 +1,3 @@
+#include
+typedef uint32_t uint32 ;
+
diff --git a/src/headers/uint32-ulong32 b/src/headers/uint32-ulong32
new file mode 100644
index 0000000..87119a5
--- /dev/null
+++ b/src/headers/uint32-ulong32
@@ -0,0 +1,2 @@
+typedef unsigned long uint32 ;
+
diff --git a/src/headers/uint64-bendian b/src/headers/uint64-bendian
new file mode 100644
index 0000000..2485bec
--- /dev/null
+++ b/src/headers/uint64-bendian
@@ -0,0 +1,3 @@
+#define uint64_little_endian(s, n) uint64_reverse((s), (n))
+#define uint64_big_endian(s, n)
+
diff --git a/src/headers/uint64-footer b/src/headers/uint64-footer
new file mode 100644
index 0000000..df620a5
--- /dev/null
+++ b/src/headers/uint64-footer
@@ -0,0 +1,39 @@
+extern void uint64_pack (char *, uint64) ;
+extern void uint64_pack_big (char *, uint64) ;
+extern void uint64_unpack (char const *, uint64 *) ;
+extern void uint64_unpack_big (char const *, uint64 *) ;
+extern void uint64_reverse (char *, unsigned int) ;
+
+#define UINT64_FMT 21
+#define UINT64_OFMT 25
+#define UINT64_XFMT 17
+#define UINT64_BFMT 65
+
+extern unsigned int uint64_fmt_base (char *, uint64, unsigned char) ;
+extern unsigned int uint640_fmt_base (char *, uint64, unsigned int, unsigned char) ;
+
+#define uint64_fmt(s, u) uint64_fmt_base(s, (u), 10)
+#define uint640_fmt(s, u, n) uint640_fmt_base(s, u, (n), 10)
+#define uint64_ofmt(s, u) uint64_fmt_base(s, (u), 8)
+#define uint640_ofmt(s, u, n) uint640_fmt_base(s, u, (n), 8)
+#define uint64_xfmt(s, u) uint64_fmt_base(s, (u), 16)
+#define uint640_xfmt(s, u, n) uint640_fmt_base(s, u, (n), 16)
+#define uint64_bfmt(s, u) uint64_fmt_base(s, (u), 2)
+#define uint640_bfmt(s, u, n) uint640_fmt_base(s, u, (n), 2)
+
+extern unsigned int uint64_fmtlist (char *, uint64 const *, unsigned int) ;
+
+extern unsigned int uint64_scan_base (char const *, uint64 *, unsigned char) ;
+extern unsigned int uint640_scan_base (char const *, uint64 *, unsigned char) ;
+#define uint64_scan(s, u) uint64_scan_base(s, (u), 10)
+#define uint640_scan(s, u) uint640_scan_base(s, (u), 10)
+#define uint64_oscan(s, u) uint64_scan_base(s, (u), 8)
+#define uint640_oscan(s, u) uint640_scan_base(s, (u), 8)
+#define uint64_xscan(s, u) uint64_scan_base(s, (u), 16)
+#define uint640_xscan(s, u) uint640_scan_base(s, (u), 16)
+#define uint64_bscan(s, u) uint64_scan_base(s, (u), 2)
+#define uint640_bscan(s, u) uint640_scan_base(s, (u), 2)
+
+extern unsigned int uint64_scanlist (uint64 *, unsigned int, char const *, unsigned int *) ;
+
+#endif
diff --git a/src/headers/uint64-header b/src/headers/uint64-header
new file mode 100644
index 0000000..f0f10e6
--- /dev/null
+++ b/src/headers/uint64-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef UINT64_H
+#define UINT64_H
+
diff --git a/src/headers/uint64-lendian b/src/headers/uint64-lendian
new file mode 100644
index 0000000..ffdb4de
--- /dev/null
+++ b/src/headers/uint64-lendian
@@ -0,0 +1,3 @@
+#define uint64_little_endian(s, n)
+#define uint64_big_endian(s, n) uint64_reverse((s), (n))
+
diff --git a/src/headers/uint64-noulong64 b/src/headers/uint64-noulong64
new file mode 100644
index 0000000..c72ebef
--- /dev/null
+++ b/src/headers/uint64-noulong64
@@ -0,0 +1,2 @@
+typedef unsigned long long uint64 ;
+
diff --git a/src/headers/uint64-stdinth b/src/headers/uint64-stdinth
new file mode 100644
index 0000000..9c43f44
--- /dev/null
+++ b/src/headers/uint64-stdinth
@@ -0,0 +1,3 @@
+#include
+
+typedef uint64_t uint64 ;
diff --git a/src/headers/uint64-ulong64 b/src/headers/uint64-ulong64
new file mode 100644
index 0000000..d9313d4
--- /dev/null
+++ b/src/headers/uint64-ulong64
@@ -0,0 +1 @@
+typedef unsigned long uint64 ;
diff --git a/src/headers/ulong-32 b/src/headers/ulong-32
new file mode 100644
index 0000000..b1b3326
--- /dev/null
+++ b/src/headers/ulong-32
@@ -0,0 +1,32 @@
+#include
+
+#define ULONG_PACK 4
+#define ulong_pack uint32_pack
+#define ulong_pack_big uint32_pack_big
+#define ulong_unpack(s, u) uint32_unpack(s, (uint32 *)(char *)(u))
+#define ulong_unpack_big(s, u) uint32_unpack_big(s, (uint32 *)(char *)(u))
+
+#define ulong_reverse uint32_reverse
+#define ulong_big_endian uint32_big_endian
+#define ulong_little_endian uint32_little_endian
+
+#define ULONG_FMT UINT32_FMT
+#define ULONG_OFMT UINT32_OFMT
+#define ULONG_XFMT UINT32_XFMT
+#define ULONG_BFMT UINT32_BFMT
+
+#define ulong_fmt uint32_fmt
+#define ulong0_fmt uint320_fmt
+#define ulong_ofmt uint32_ofmt
+#define ulong0_ofmt uint320_ofmt
+#define ulong_xfmt uint32_xfmt
+#define ulong0_xfmt uint320_xfmt
+#define ulong_bfmt uint32_bfmt
+#define ulong0_bfmt uint320_bfmt
+
+#define ulong_fmtlist(s, tab, n) uint32_fmtlist(s, tab, n)
+
+#define ulong_scan_base(s, u, b) uint32_scan_base(s, (uint32 *)(char *)(u), b)
+#define ulong0_scan_base(s, u, b) uint320_scan_base(s, (uint32 *)(char *)(u), b)
+
+#define ulong_scanlist(tab, max, s, num) uint32_scanlist(tab, max, s, num)
diff --git a/src/headers/ulong-64 b/src/headers/ulong-64
new file mode 100644
index 0000000..016fd1f
--- /dev/null
+++ b/src/headers/ulong-64
@@ -0,0 +1,32 @@
+#include
+
+#define ULONG_PACK 8
+#define ulong_pack uint64_pack
+#define ulong_pack_big uint64_pack_big
+#define ulong_unpack(s, u) uint64_unpack(s, (uint64 *)(char *)(u))
+#define ulong_unpack_big(s, u) uint64_unpack_big(s, (uint64 *)(char *)(u))
+
+#define ulong_reverse uint64_reverse
+#define ulong_big_endian uint64_big_endian
+#define ulong_little_endian uint64_little_endian
+
+#define ULONG_FMT UINT64_FMT
+#define ULONG_OFMT UINT64_OFMT
+#define ULONG_XFMT UINT64_XFMT
+#define ULONG_BFMT UINT64_BFMT
+
+#define ulong_fmt uint64_fmt
+#define ulong0_fmt uint640_fmt
+#define ulong_ofmt uint64_ofmt
+#define ulong0_ofmt uint640_ofmt
+#define ulong_xfmt uint64_xfmt
+#define ulong0_xfmt uint640_xfmt
+#define ulong_bfmt uint64_bfmt
+#define ulong0_bfmt uint640_bfmt
+
+#define ulong_fmtlist(s, tab, n) uint64_fmtlist(s, tab, n)
+
+#define ulong_scan_base(s, u, b) uint64_scan_base(s, (uint64 *)(char *)(u), b)
+#define ulong0_scan_base(s, u, b) uint640_scan_base(s, (uint64 *)(char *)(u), b)
+
+#define ulong_scanlist(tab, max, s, num) uint64_scanlist(tab, max, s, num)
diff --git a/src/headers/ulong-footer b/src/headers/ulong-footer
new file mode 100644
index 0000000..0607872
--- /dev/null
+++ b/src/headers/ulong-footer
@@ -0,0 +1,10 @@
+#define ulong_scan(s, u) ulong_scan_base(s, (u), 10)
+#define ulong0_scan(s, u) ulong0_scan_base(s, (u), 10)
+#define ulong_oscan(s, u) ulong_scan_base(s, (u), 8)
+#define ulong0_oscan(s, u) ulong0_scan_base(s, (u), 8)
+#define ulong_xscan(s, u) ulong_scan_base(s, (u), 16)
+#define ulong0_xscan(s, u) ulong0_scan_base(s, (u), 16)
+#define ulong_bscan(s, u) ulong_scan_base(s, (u), 2)
+#define ulong0_bscan(s, u) ulong0_scan_base(s, (u), 2)
+
+#endif
diff --git a/src/headers/ulong-header b/src/headers/ulong-header
new file mode 100644
index 0000000..98e6f37
--- /dev/null
+++ b/src/headers/ulong-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef ULONG_H
+#define ULONG_H
+
diff --git a/src/headers/ushort-16 b/src/headers/ushort-16
new file mode 100644
index 0000000..0e210c6
--- /dev/null
+++ b/src/headers/ushort-16
@@ -0,0 +1,34 @@
+#include
+
+#define USHORT_PACK 2
+#define ushort_pack uint16_pack
+#define ushort_pack_big uint16_pack_big
+#define ushort_unpack(s, u) uint16_unpack(s, (uint16 *)(char *)(u))
+#define ushort_unpack_big(s, u) uint16_unpack_big(s, (uint16 *)(char *)(u))
+
+#define ushort_reverse uint16_reverse
+#define ushort_big_endian uint16_big_endian
+#define ushort_little_endian uint16_little_endian
+
+#define USHORT_FMT UINT16_FMT
+#define USHORT_OFMT UINT16_OFMT
+#define USHORT_XFMT UINT16_XFMT
+#define USHORT_BFMT UINT16_BFMT
+
+#define ushort_fmt_base uint16_fmt_base
+#define ushort0_fmt_base uint160_fmt_base
+#define ushort_fmt uint16_fmt
+#define ushort0_fmt uint160_fmt
+#define ushort_ofmt uint16_ofmt
+#define ushort0_ofmt uint160_ofmt
+#define ushort_xfmt uint16_xfmt
+#define ushort0_xfmt uint160_xfmt
+#define ushort_bfmt uint16_bfmt
+#define ushort0_bfmt uint160_bfmt
+
+#define ushort_fmtlist(s, tab, n) uint16_fmtlist(s, tab, n)
+
+#define ushort_scan_base(s, u, b) uint16_scan_base(s, (uint16 *)(char *)(u), b)
+#define ushort0_scan_base(s, u, b) uint160_scan_base(s, (uint16 *)(char *)(u), b)
+
+#define ushort_scanlist(tab, max, s, num) uint16_scanlist(tab, max, s, num)
diff --git a/src/headers/ushort-32 b/src/headers/ushort-32
new file mode 100644
index 0000000..b41aef4
--- /dev/null
+++ b/src/headers/ushort-32
@@ -0,0 +1,34 @@
+#include
+
+#define USHORT_PACK 4
+#define ushort_pack uint32_pack
+#define ushort_pack_big uint32_pack_big
+#define ushort_unpack(s, u) uint32_unpack(s, (uint32 *)(char *)(u))
+#define ushort_unpack_big(s, u) uint32_unpack_big(s, (uint32 *)(char *)(u))
+
+#define ushort_reverse uint32_reverse
+#define ushort_big_endian uint32_big_endian
+#define ushort_little_endian uint32_little_endian
+
+#define USHORT_FMT UINT32_FMT
+#define USHORT_OFMT UINT32_OFMT
+#define USHORT_XFMT UINT32_XFMT
+#define USHORT_BFMT UINT32_BFMT
+
+#define ushort_fmt_base uint32_fmt_base
+#define ushort0_fmt_base uint320_fmt_base
+#define ushort_fmt uint32_fmt
+#define ushort0_fmt uint320_fmt
+#define ushort_ofmt uint32_ofmt
+#define ushort0_ofmt uint320_ofmt
+#define ushort_xfmt uint32_xfmt
+#define ushort0_xfmt uint320_xfmt
+#define ushort_bfmt uint32_bfmt
+#define ushort0_bfmt uint320_bfmt
+
+#define ushort_fmtlist(s, tab, n) uint32_fmtlist(s, tab, n)
+
+#define ushort_scan_base(s, u, b) uint32_scan_base(s, (uint32 *)(char *)(u), b)
+#define ushort0_scan_base(s, u, b) uint320_scan_base(s, (uint32 *)(char *)(u), b)
+
+#define ushort_scanlist(tab, max, s, num) uint32_scanlist(tab, max, s, num)
diff --git a/src/headers/ushort-footer b/src/headers/ushort-footer
new file mode 100644
index 0000000..db56f73
--- /dev/null
+++ b/src/headers/ushort-footer
@@ -0,0 +1,10 @@
+#define ushort_scan(s, u) ushort_scan_base(s, (u), 10)
+#define ushort0_scan(s, u) ushort0_scan_base(s, (u), 10)
+#define ushort_oscan(s, u) ushort_scan_base(s, (u), 8)
+#define ushort0_oscan(s, u) ushort0_scan_base(s, (u), 8)
+#define ushort_xscan(s, u) ushort_scan_base(s, (u), 16)
+#define ushort0_xscan(s, u) ushort0_scan_base(s, (u), 16)
+#define ushort_bscan(s, u) ushort_scan_base(s, (u), 2)
+#define ushort0_bscan(s, u) ushort0_scan_base(s, (u), 2)
+
+#endif
diff --git a/src/headers/ushort-header b/src/headers/ushort-header
new file mode 100644
index 0000000..66b7f9a
--- /dev/null
+++ b/src/headers/ushort-header
@@ -0,0 +1,5 @@
+/* ISC license. */
+
+#ifndef USHORT_H
+#define USHORT_H
+
diff --git a/src/include/skalibs/alloc.h b/src/include/skalibs/alloc.h
new file mode 100644
index 0000000..707d5c1
--- /dev/null
+++ b/src/include/skalibs/alloc.h
@@ -0,0 +1,16 @@
+/* ISC license. */
+
+#ifndef ALLOC_H
+#define ALLOC_H
+
+#include
+
+typedef char aligned_char gccattr_aligned ;
+typedef aligned_char *aligned_char_ref, **aligned_char_ref_ref ;
+
+extern aligned_char_ref alloc (unsigned int) ;
+extern void alloc_free (void *) ;
+#define alloc_re(p, old, new) alloc_realloc(p, new)
+extern int alloc_realloc (aligned_char_ref_ref, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/allreadwrite.h b/src/include/skalibs/allreadwrite.h
new file mode 100644
index 0000000..6b2a0cf
--- /dev/null
+++ b/src/include/skalibs/allreadwrite.h
@@ -0,0 +1,27 @@
+/* ISC license. */
+
+#ifndef ALLREADWRITE_H
+#define ALLREADWRITE_H
+
+#include
+#include
+#include
+
+extern int sanitize_read (int) ;
+extern int unsanitize_read (int) ;
+
+extern unsigned int allreadwrite (iofunc_t_ref, int, char *, unsigned int) ;
+
+extern int fd_read (int, char *, unsigned int) ;
+extern int fd_write (int, char const *, unsigned int) ;
+
+extern int fd_recv (int, char *, unsigned int, unsigned int) ;
+extern int fd_send (int, char const *, unsigned int, unsigned int) ;
+
+extern unsigned int allread (int, char *, unsigned int) ;
+extern unsigned int allwrite (int, char const *, unsigned int) ;
+
+extern int fd_readv (int, struct iovec const *, unsigned int) ;
+extern int fd_writev (int, struct iovec const *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/avlnode.h b/src/include/skalibs/avlnode.h
new file mode 100644
index 0000000..4d13d15
--- /dev/null
+++ b/src/include/skalibs/avlnode.h
@@ -0,0 +1,44 @@
+/* ISC license. */
+
+#ifndef AVLNODE_H
+#define AVLNODE_H
+
+#include
+#include
+
+
+#define AVLNODE_MAXDEPTH 49 /* enough for 2^32 nodes in the worst case */
+
+typedef int avliterfunc_t (unsigned int, unsigned int, void *) ;
+typedef avliterfunc_t *avliterfunc_t_ref ;
+
+typedef struct avlnode_s avlnode, *avlnode_ref ;
+struct avlnode_s
+{
+ unsigned int data ;
+ unsigned int child[2] ;
+ signed char balance : 2 ;
+} ;
+
+#define AVLNODE_ZERO { .data = 0, .child = { (unsigned int)-1, (unsigned int)-1 }, .balance = 0 }
+extern avlnode const avlnode_zero ;
+
+extern unsigned int avlnode_searchnode (avlnode const *, unsigned int, unsigned int, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+extern int avlnode_search (avlnode const *, unsigned int, unsigned int, void const *, unsigned int *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+extern unsigned int avlnode_height (avlnode const *, unsigned int, unsigned int) gccattr_pure ;
+
+extern unsigned int avlnode_extremenode (avlnode const *, unsigned int, unsigned int, int) gccattr_pure ;
+#define avlnode_minnode(s, max, r) avlnode_extremenode(s, max, (r), 0)
+#define avlnode_maxnode(s, max, r) avlnode_extremenode(s, max, (r), 1)
+
+extern int avlnode_extreme (avlnode const *, unsigned int, unsigned int, int, unsigned int *) ;
+#define avlnode_min(s, max, r, data) avlnode_extreme(s, max, (r), 0, data)
+#define avlnode_max(s, max, r, data) avlnode_extreme(s, max, (r), 1, data)
+
+extern unsigned int avlnode_insertnode (avlnode_ref, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+extern unsigned int avlnode_delete (avlnode_ref, unsigned int, unsigned int *, void const *, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+#define avlnode_deletenode(s, max, r, i, dtok, f, p) avlnode_delete(s, max, r, (*(dtok))((s)[i].data), dtok, f, p)
+
+extern int avlnode_iter (avlnode_ref, unsigned int, unsigned int, avliterfunc_t_ref, void *) ;
+
+#endif
diff --git a/src/include/skalibs/avltree.h b/src/include/skalibs/avltree.h
new file mode 100644
index 0000000..cefd116
--- /dev/null
+++ b/src/include/skalibs/avltree.h
@@ -0,0 +1,55 @@
+/* ISC license. */
+
+#ifndef AVLTREE_H
+#define AVLTREE_H
+
+#include
+#include
+#include
+
+typedef struct avltree_s avltree, *avltree_ref ;
+struct avltree_s
+{
+ gensetdyn x ;
+ unsigned int root ;
+ dtokfunc_t_ref dtok ;
+ cmpfunc_t_ref kcmp ;
+ void *external ;
+} ;
+
+#define AVLTREE_ZERO { .x = GENSETDYN_ZERO, .root = (unsigned int)-1, .dtok = 0, .kcmp = 0, .external = 0 }
+extern avltree const avltree_zero ;
+#define avltree_len(t) gensetdyn_n(&(t)->x)
+#define avltree_totalsize(t) ((t)->x.storage.len)
+#define avltree_nodes(t) ((avlnode_ref)(t)->x.storage.s)
+#define avltree_data(t, i) (avltree_nodes(t)[i].data)
+#define avltree_root(t) ((t)->root)
+#define avltree_setroot(t, r) ((t)->root = (r))
+
+extern void avltree_free (avltree_ref) ;
+extern void avltree_init (avltree_ref, unsigned int, unsigned int, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+#define AVLTREE_INIT(b, num, den, dtk, f, p) { .x = GENSETDYN_INIT(avlnode, (b), num, den), .root = (unsigned int)-1, .dtok = (dtk), .kcmp = (f), .external = (p) }
+
+#define avltree_searchnode(t, k) avlnode_searchnode(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), k, (t)->dtok, (t)->kcmp, (t)->external)
+#define avltree_search(t, k, data) avlnode_search(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), k, (data), (t)->dtok, (t)->kcmp, (t)->external)
+
+#define avltree_height(t) avlnode_height(avltree_nodes(t), avltree_totalsize(t), avltree_root(t))
+
+#define avltree_extremenode(t, h) avlnode_extremenode(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), h)
+#define avltree_minnode(t) avltree_extremenode((t), 0)
+#define avltree_maxnode(t) avltree_extremenode((t), 1)
+
+#define avltree_extreme(t, h, data) avlnode_extreme(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), (h), data)
+#define avltree_min(t, data) avltree_extreme((t), 0, data)
+#define avltree_max(t, data) avltree_extreme((t), 1, data)
+
+extern int avltree_newnode (avltree_ref, unsigned int, unsigned int *) ;
+#define avltree_insertnode(t, i) avltree_setroot(t, avlnode_insertnode(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), i, (t)->dtok, (t)->kcmp, (t)->external))
+extern int avltree_insert (avltree_ref, unsigned int) ;
+
+#define avltree_deletenode(t, i) avltree_delete(t, (*(t)->dtok)(avltree_data(t, i)))
+extern int avltree_delete (avltree_ref, void const *) ;
+
+#define avltree_iter(t, f, p) avlnode_iter(avltree_nodes(t), avltree_totalsize(t), avltree_root(t), f, p)
+
+#endif
diff --git a/src/include/skalibs/avltreen.h b/src/include/skalibs/avltreen.h
new file mode 100644
index 0000000..8151e9d
--- /dev/null
+++ b/src/include/skalibs/avltreen.h
@@ -0,0 +1,87 @@
+/* ISC license. */
+
+#ifndef AVLTREEN_H
+#define AVLTREEN_H
+
+#include
+#include
+#include
+
+
+ /* avltreen: just the structure. Storage and freelist are outside. */
+
+typedef struct avltreen_s avltreen, *avltreen_ref ;
+struct avltreen_s
+{
+ genset x ;
+ unsigned int root ;
+ dtokfunc_t_ref dtok ;
+ cmpfunc_t_ref kcmp ;
+ void *external ;
+} ;
+
+#define AVLTREEN_ZERO { .x = GENSET_ZERO, .root = (unsigned int)-1, .dtok = 0, .kcmp = 0, .external = 0 }
+#define avltreen_totalsize(t) ((t)->x.max)
+#define avltreen_len(t) genset_n(&(t)->x)
+#define avltreen_nodes(t) ((avlnode_ref)(t)->x.storage)
+#define avltreen_data(t, i) (avltreen_nodes(t)[i].data)
+#define avltreen_root(t) ((t)->root)
+#define avltreen_setroot(t, r) ((t)->root = (r))
+extern void avltreen_init (avltreen_ref, avlnode_ref, unsigned int *, unsigned int, dtokfunc_t_ref, cmpfunc_t_ref, void *) ;
+
+#define avltreen_searchnode(t, k) avlnode_searchnode(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), (k), (t)->dtok, (t)->kcmp, (t)->external)
+#define avltreen_search(t, k, data) avlnode_search(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), k, (data), (t)->dtok, (t)->kcmp, (t)->external)
+
+#define avltreen_height(t) avlnode_height(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t))
+
+#define avltreen_extremenode(t, h) avlnode_extremenode(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), h)
+#define avltreen_minnode(t) avltreen_extremenode((t), 0)
+#define avltreen_maxnode(t) avltreen_extremenode((t), 1)
+
+#define avltreen_extreme(t, h, data) avlnode_extreme(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), (h), data)
+#define avltreen_min(t, data) avltreen_extreme((t), 0, data)
+#define avltreen_max(t, data) avltreen_extreme((t), 1, data)
+
+extern unsigned int avltreen_newnode (avltreen_ref, unsigned int) ;
+#define avltreen_insertnode(t, i) avltreen_setroot(t, avlnode_insertnode(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), i, (t)->dtok, (t)->kcmp, (t)->external))
+extern int avltreen_insert (avltreen_ref, unsigned int) ;
+
+#define avltreen_deletenode(t, i) avltreen_delete(t, avltreen_data(t, i))
+extern int avltreen_delete (avltreen_ref, void const *) ;
+
+#define avltreen_iter(t, f, p) avlnode_iter(avltreen_nodes(t), avltreen_totalsize(t), avltreen_root(t), f, p)
+
+
+ /* avltreeb: everything in one place. Stack or BSS, or heap if you insist */
+
+#define AVLTREEB_TYPE(size) struct { avlnode storage[size] ; unsigned int freelist[size] ; avltreen info ; }
+#define avltreeb_init(t, size, dtk, f, p) avltreen_init(&(t)->info, (t)->storage, (t)->freelist, size, dtk, f, p)
+#define avltreeb_totalsize(t) avltreen_totalsize(&(t)->info)
+#define avltreeb_len(t) avltreen_len(&(t)->info)
+#define avltreeb_nodes(t) ((avlnode_ref)(t)->storage)
+#define avltreeb_data(t, i) (avltreeb_nodes(t)[i].data)
+#define avltreeb_root(t) ((t)->info.root)
+#define avltreeb_setroot(t, r) ((t)->info.root = (r))
+
+#define avltreeb_searchnode(t, k) avlnode_searchnode(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), (k), (t)->info.dtok, (t)->info.kcmp, (t)->info.external)
+#define avltreeb_search(t, k, data) avlnode_search(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), k, (data), (t)->info.dtok, (t)->info.kcmp, (t)->info.external)
+#define avltreeb_height(t) avlnode_height(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t))
+
+#define avltreeb_extremenode(t, h) avlnode_extremenode(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), h)
+#define avltreeb_minnode(t) avltreeb_extremenode((t), 0)
+#define avltreeb_maxnode(t) avltreeb_extremenode((t), 1)
+
+#define avltreeb_extreme(t, h, data) avlnode_extremenode(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), h, data)
+#define avltreeb_min(t, data) avltreeb_extreme((t), 0, data)
+#define avltreeb_max(t, data) avltreeb_extreme((t), 1, data)
+
+#define avltreeb_newnode(t, d) avltreen_newnode(&(t)->info, d)
+#define avltreeb_insertnode(t, i) avltreeb_setroot(t, avlnode_insertnode(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), (i), (t)->info.dtok, (t)->info.kcmp, (t)->info.external))
+#define avltreeb_insert(t, d) avltreen_insert(&(t)->info, d)
+
+#define avltreeb_deletenode(t, i) avltreeb_delete(t, avltreeb_data(t, i))
+#define avltreeb_delete(t, k) avltreen_delete(&(t)->info, k)
+
+#define avltreeb_iter(t, f, p) avlnode_iter(avltreeb_nodes(t), avltreeb_totalsize(t), avltreeb_root(t), f, p)
+
+#endif
diff --git a/src/include/skalibs/biguint.h b/src/include/skalibs/biguint.h
new file mode 100644
index 0000000..94e99a9
--- /dev/null
+++ b/src/include/skalibs/biguint.h
@@ -0,0 +1,46 @@
+/* ISC license. */
+
+#ifndef BIGUINT_H
+#define BIGUINT_H
+
+#include
+#include
+
+extern void bu_pack (char *, uint32 const *, unsigned int) ;
+extern void bu_unpack (char const *, uint32 *, unsigned int) ;
+extern void bu_pack_big (char *, uint32 const *, unsigned int) ;
+extern void bu_unpack_big (char const *, uint32 *, unsigned int) ;
+extern unsigned int bu_fmt (char *, uint32 const *, unsigned int) ;
+extern unsigned int bu_scanlen (char const *, unsigned int *) ;
+extern int bu_scan (char const *, unsigned int, uint32 *, unsigned int, unsigned int) ;
+
+extern unsigned int bu_len (uint32 const *, unsigned int) gccattr_pure ;
+extern void bu_zero (uint32 *, unsigned int) ;
+extern int bu_copy (uint32 *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_cmp (uint32 const *, unsigned int, uint32 const *, unsigned int) gccattr_pure ;
+
+#define bu_add(c, cn, a, an, b, bn) bu_addc(c, cn, a, an, b, (bn), 0)
+extern int bu_addc (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, int) ;
+#define bu_sub(c, cn, a, an, b, bn) bu_subc(c, cn, a, an, b, (bn), 0)
+extern int bu_subc (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, int) ;
+extern int bu_mul (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_div (uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 *, unsigned int, uint32 *, unsigned int) ;
+extern int bu_mod (uint32 *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_gcd (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ;
+
+#define bu_slb(a, n) bu_slbc(a, n, 0)
+extern int bu_slbc (uint32 *, unsigned int, int) ;
+#define bu_srb(a, n) bu_srbc(a, n, 0)
+extern int bu_srbc (uint32 *, unsigned int, int) ;
+
+extern int bu_addmod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_submod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_invmod (uint32 *, unsigned int, uint32 const *, unsigned int) ;
+extern int bu_divmod (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int, uint32 const *, unsigned int) ;
+
+extern void bu_scan_internal (char const *, unsigned int, uint32 *) ;
+extern void bu_copy_internal (uint32 *, uint32 const *, unsigned int) ;
+extern void bu_div_internal (uint32 *, unsigned int, uint32 const *, unsigned int, uint32 *, unsigned int) ;
+extern void bu_divmod_internal (uint32 *, uint32 *, uint32 const *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/bitarray.h b/src/include/skalibs/bitarray.h
new file mode 100644
index 0000000..7cf79b3
--- /dev/null
+++ b/src/include/skalibs/bitarray.h
@@ -0,0 +1,33 @@
+/* ISC license. */
+
+#ifndef BITARRAY_H
+#define BITARRAY_H
+
+#include
+
+#define bitarray_div8(n) ((n) ? 1U + (((n) - 1) >> 3) : 0U)
+
+extern void bitarray_clearsetn (unsigned char *, unsigned int, unsigned int, int) ;
+#define bitarray_clearn(s, start, len) bitarray_clearsetn(s, start, (len), 0)
+#define bitarray_setn(s, start, len) bitarray_clearsetn(s, start, (len), 1)
+
+#define bitarray_peek(s, n) (((s)[(n)>>3] & (1U<<((n)&7))) ? 1 : 0)
+#define bitarray_isset(b, n) bitarray_peek(b, n)
+#define bitarray_clear(s, n) ((s)[(n)>>3] &= ~(1U << ((n) & 7)))
+#define bitarray_set(s, n) ((s)[(n)>>3] |= 1U << ((n) & 7))
+#define bitarray_poke(s, n, h) ((h) ? bitarray_set(s, n) : bitarray_clear(s, n))
+
+extern int bitarray_testandpoke (unsigned char *, unsigned int, int) ;
+#define bitarray_testandclear(b, n) bitarray_testandpoke(b, n, 0)
+#define bitarray_testandset(b, n) bitarray_testandpoke(b, n, 1)
+
+extern unsigned int bitarray_firstclear (unsigned char const *, unsigned int) gccattr_pure ;
+extern unsigned int bitarray_firstset (unsigned char const *, unsigned int) gccattr_pure ;
+#define bitarray_first(s, n, h) ((h) ? bitarray_firstset(s, n) : bitarray_firstclear(s, n))
+
+extern void bitarray_not (unsigned char *, unsigned int, unsigned int) ;
+extern void bitarray_and (unsigned char *, unsigned char const *, unsigned char const *, unsigned int) ;
+extern void bitarray_or (unsigned char *, unsigned char const *, unsigned char const *, unsigned int) ;
+extern void bitarray_xor (unsigned char *, unsigned char const *, unsigned char const *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/bufalloc.h b/src/include/skalibs/bufalloc.h
new file mode 100644
index 0000000..c2779b6
--- /dev/null
+++ b/src/include/skalibs/bufalloc.h
@@ -0,0 +1,36 @@
+/* ISC license. */
+
+#ifndef BUFALLOC_H
+#define BUFALLOC_H
+
+#include
+#include
+
+typedef struct bufalloc bufalloc, *bufalloc_ref ;
+struct bufalloc
+{
+ stralloc x ;
+ unsigned int p ;
+ int fd ;
+ int (*op) (int, char const *, unsigned int) ;
+} ;
+
+#define BUFALLOC_ZERO { .x = STRALLOC_ZERO, .p = 0, .fd = -1, .op = 0 }
+#define BUFALLOC_INIT(f, d) { .x = STRALLOC_ZERO, .p = 0, .fd = (d), .op = (f) }
+extern void bufalloc_init (bufalloc_ref, int (*)(int, char const *, unsigned int), int) ;
+#define bufalloc_shrink(ba) stralloc_shrink(&(ba)->x)
+#define bufalloc_free(ba) stralloc_free(&(ba)->x)
+#define bufalloc_put(ba, s, n) stralloc_catb(&(ba)->x, s, n)
+#define bufalloc_puts(ba, s) stralloc_cats(&(ba)->x, s)
+#define bufalloc_putv(ba, v, n) stralloc_catv(&(ba)->x, v, n)
+#define bufalloc_fd(ba) ((ba)->fd)
+extern int bufalloc_getfd (bufalloc const *) gccattr_pure ;
+extern int bufalloc_flush (bufalloc_ref) ;
+extern void bufalloc_clean (bufalloc_ref) ;
+#define bufalloc_len(ba) ((ba)->x.len - (ba)->p)
+extern unsigned int bufalloc_getlen (bufalloc const *) gccattr_pure ;
+#define bufalloc_isempty(ba) ((ba)->x.len == (ba)->p)
+
+extern bufalloc_ref bufalloc_1, bufalloc_2 ;
+
+#endif
diff --git a/src/include/skalibs/buffer.h b/src/include/skalibs/buffer.h
new file mode 100644
index 0000000..3064c51
--- /dev/null
+++ b/src/include/skalibs/buffer.h
@@ -0,0 +1,134 @@
+/* ISC license. */
+
+#ifndef BUFFER_H
+#define BUFFER_H
+
+#include
+#include
+#include
+#include
+#include
+
+typedef int buffer_io_func_t (int, siovec_t const *, unsigned int, void *) ;
+typedef buffer_io_func_t *buffer_io_func_t_ref ;
+
+typedef struct buffer_s buffer, buffer_t, *buffer_ref, *buffer_t_ref ;
+struct buffer_s
+{
+ buffer_io_func_t *op ;
+ int fd ;
+ cbuffer_t c ;
+ void *aux ;
+} ;
+#define BUFFER_ZERO { .op = 0, .fd = -1, .c = CBUFFER_ZERO, .aux = 0 }
+
+
+ /*
+ Circular buffers need to be 1 char bigger than the storage space,
+ so that the head == tail case is nonambiguous (empty).
+ */
+
+#define BUFFER_INSIZE 8193
+#define BUFFER_OUTSIZE 8193
+#define BUFFER_ERRSIZE 1025
+#define BUFFER_INSIZE_SMALL 513
+#define BUFFER_OUTSIZE_SMALL 513
+
+#define BUFFER_INIT_AUX(f, d, buf, len, data) { .op = (f), .fd = (d), .c = CBUFFER_INIT(buf, len), .aux = (data) }
+#define BUFFER_INIT(f, d, buf, len) BUFFER_INIT_AUX(f, d, buf, (len), 0)
+extern int buffer_init_aux (buffer *, buffer_io_func_t *, int, char *, unsigned int, void *) ;
+#define buffer_init(b, f, d, buf, len) buffer_init_aux(b, f, d, buf, len, 0)
+
+
+ /* Writing */
+
+extern int buffer_flush (buffer *) ;
+
+#define buffer_putnoflush(b, s, len) cbuffer_put(&(b)->c, s, len)
+#define buffer_putvnoflush(b, v, n) cbuffer_putv(&(b)->c, v, n)
+#define buffer_putsnoflush(b, s) buffer_putnoflush(b, (s), str_len(s))
+
+extern int buffer_putallnoflush (buffer *, char const *, unsigned int) ;
+extern int buffer_putvallnoflush (buffer *, siovec_t const *, unsigned int) ;
+#define buffer_putsallnoflush(b, s) buffer_putallnoflush(b, (s), str_len(s))
+
+extern int buffer_putall (buffer *, char const *, unsigned int, unsigned int *) ;
+extern int buffer_putvall (buffer *, siovec_t const *, unsigned int, diuint *) ;
+#define buffer_putsall(b, s, w) buffer_putall(b, s, str_len(s), w)
+
+#define buffer_putallflush(b, s, len, w) (buffer_putall(b, s, len, w) && buffer_flush(b))
+#define buffer_putvallflush(b, v, n, w) (buffer_putvall(b, v, n, w) && buffer_flush(b))
+#define buffer_putsallflush(b, s, w) buffer_putallflush(b, s, str_len(s), w)
+
+extern int buffer_put (buffer *, char const *, unsigned int) ;
+extern int buffer_putv (buffer *, siovec_t const *, unsigned int) ;
+#define buffer_puts(b, s) buffer_put(b, (s), str_len(s))
+
+extern int buffer_putflush (buffer *, char const *, unsigned int) ;
+extern int buffer_putvflush (buffer *, siovec_t const *, unsigned int) ;
+#define buffer_putsflush(b, s) buffer_putflush(b, (s), str_len(s))
+
+#define buffer_unput(b, n) cbuffer_unput(&(b)->c, n)
+#define buffer_wpeek(b, v) cbuffer_wpeek(&(b)->c, v)
+#define buffer_wseek(b, n) cbuffer_wseek(&(b)->c, n)
+extern buffer_io_func_t buffer_write ;
+
+
+ /* Reading */
+
+extern int buffer_fill (buffer *) ;
+
+#define buffer_getnofill(b, s, len) cbuffer_get(&(b)->c, s, len)
+#define buffer_getvnofill(b, v, n) cbuffer_getv(&(b)->c, v, n)
+
+extern int buffer_getallnofill (buffer *, char *, unsigned int) ;
+extern int buffer_getvallnofill (buffer *, siovec_t const *, unsigned int) ;
+
+extern int buffer_getall (buffer *, char *, unsigned int, unsigned int *) ;
+extern int buffer_getvall (buffer *, siovec_t const *, unsigned int, diuint *) ;
+
+extern int buffer_get (buffer *, char *, unsigned int) ;
+extern int buffer_getv (buffer *, siovec_t const *, unsigned int) ;
+
+#define buffer_unget(b, n) cbuffer_unget(&(b)->c, n)
+#define buffer_rpeek(b, n) cbuffer_rpeek(&(b)->c, n)
+#define buffer_rseek(b, n) cbuffer_rseek(&(b)->c, n)
+extern buffer_io_func_t buffer_read ;
+
+
+ /* Utility */
+
+#define buffer_len(b) cbuffer_len(&(b)->c)
+extern unsigned int buffer_getlen (buffer const *) gccattr_pure ;
+#define buffer_available(b) cbuffer_available(&(b)->c)
+#define buffer_isempty(b) cbuffer_isempty(&(b)->c)
+#define buffer_isfull(b) cbuffer_isfull(&(b)->c)
+#define buffer_fd(b) ((b)->fd)
+extern int buffer_getfd (buffer const *) gccattr_pure ;
+#define buffer_isreadable(b) (!buffer_isfull(b))
+#define buffer_iswritable(b) (!buffer_isempty(b))
+
+
+ /* Globals */
+
+extern buffer_io_func_t buffer_flush1read ;
+
+extern buffer buffer_0_ ;
+#define buffer_0 (&buffer_0_)
+
+extern buffer buffer_0small_ ;
+#define buffer_0small (&buffer_0small_)
+
+extern buffer buffer_0f1_ ;
+#define buffer_0f1 (&buffer_0f1_)
+
+extern buffer buffer_1_ ;
+#define buffer_1 (&buffer_1_)
+
+extern buffer buffer_1small_ ;
+#define buffer_1small (&buffer_1small_)
+
+extern buffer buffer_2_ ;
+#define buffer_2 (&buffer_2_)
+
+#endif
diff --git a/src/include/skalibs/bytestr.h b/src/include/skalibs/bytestr.h
new file mode 100644
index 0000000..52e9bd6
--- /dev/null
+++ b/src/include/skalibs/bytestr.h
@@ -0,0 +1,65 @@
+/* ISC license. */
+
+#ifndef BYTESTR_H
+#define BYTESTR_H
+
+#include
+#include
+
+/* for Alphas and other archs where char != 8bit */
+#define T8(x) ((x) & 0xffU)
+
+#ifndef SKALIBS_FLAG_REPLACE_LIBC
+
+#include
+#include
+
+#define byte_copy(to, n, from) memmove(to, (from), n)
+#define byte_copyr(to, n, from) memmove(to, (from), n)
+#define byte_diff(a, n, b) memcmp(a, (b), n)
+#define byte_zero(p, n) memset(p, 0, n)
+#define str_len(s) strlen(s)
+#define str_diff(a, b) strcmp(a, b)
+#define str_diffn(a, b, n) strncmp(a, b, n)
+#define str_copy(to, from) strlen(strcpy(to, from))
+
+#else
+
+extern void byte_copy (char *, unsigned int, char const *) ;
+extern void byte_copyr (char *, unsigned int, char const *) ;
+extern int byte_diff (char const *, unsigned int, char const *) gccattr_pure ;
+extern void byte_zero (void *, unsigned int) ;
+extern unsigned int str_len (char const *) gccattr_pure ;
+extern int str_diff (char const *, char const *) gccattr_pure ;
+extern int str_diffn (char const *, char const *, unsigned int) gccattr_pure ;
+extern unsigned int str_copy (char *, char const *) ;
+
+#endif
+
+
+extern unsigned int byte_chr (char const *, unsigned int, int) gccattr_pure ;
+extern unsigned int byte_rchr (char const *, unsigned int, int) gccattr_pure ;
+extern unsigned int byte_in (char const *, unsigned int, char const *, unsigned int) gccattr_pure ;
+#define byte_equal(s, n, t) (!byte_diff((s), (n), (t)))
+extern unsigned int byte_count (char const *, unsigned int, char) gccattr_pure ;
+
+#define str_diffb(a, n, b) str_diffn(a, (b), n)
+extern unsigned int str_chr (char const *, int) gccattr_pure ;
+extern unsigned int str_rchr (char const *, int) gccattr_pure ;
+extern int str_start (char const *, char const *) gccattr_pure ;
+#define str_equal(s, t) (!str_diff(s, t))
+extern unsigned int str_strn (char const *, unsigned int, char const *, unsigned int) gccattr_pure ;
+
+extern void case_lowers (char *) ;
+extern void case_lowerb (char *, unsigned int) ;
+extern void case_uppers (char *) ;
+extern void case_upperb (char *, unsigned int) ;
+#define case_equals(a, b) (!case_diffs(a, b))
+#define case_equalb(a, n, b) (!case_diffb(a, n, b))
+extern int case_diffs (char const *, char const *) gccattr_pure ;
+extern int case_diffb (char const *, unsigned int, char const *) gccattr_pure ;
+#define case_starts(s, t) case_startb(s, str_len(s), t)
+extern int case_startb (char const *, unsigned int, char const *) gccattr_pure ;
+extern unsigned int case_str (char const *, char const *) gccattr_pure ;
+
+#endif
diff --git a/src/include/skalibs/cbuffer.h b/src/include/skalibs/cbuffer.h
new file mode 100644
index 0000000..a80e3af
--- /dev/null
+++ b/src/include/skalibs/cbuffer.h
@@ -0,0 +1,62 @@
+/* ISC license. */
+
+#ifndef CBUFFER_H
+#define CBUFFER_H
+
+#include
+#include
+#include
+#include
+
+typedef struct cbuffer_s cbuffer_t, *cbuffer_t_ref ;
+struct cbuffer_s
+{
+ char *x ;
+ unsigned int a ; /* total length */
+ unsigned int p ; /* head */
+ unsigned int n ; /* tail */
+} ;
+#define CBUFFER_ZERO { .x = 0, .a = 0, .p = 0, .n = 0 }
+
+ /*
+ Circular buffers need to be 1 char bigger than the storage space,
+ so that the head == tail case is nonambiguous (empty).
+ */
+
+#define CBUFFER_INIT(buf, len) { .x = (buf), .a = (len), .p = 0, .n = 0 }
+extern int cbuffer_init (cbuffer_t *, char *, unsigned int) ;
+
+
+ /* Writing */
+
+extern unsigned int cbuffer_put (cbuffer_t *, char const *, unsigned int) ;
+extern unsigned int cbuffer_putv (cbuffer_t *, siovec_t const *, unsigned int) ;
+#define cbuffer_puts(b, s) cbuffer_put(b, (s), str_len(s))
+
+#define cbuffer_UNPUT(b, w) ((b)->n = ((b)->a + (b)->n - w) % (b)->a, w) ;
+extern unsigned int cbuffer_unput (cbuffer_t *, unsigned int) ;
+extern void cbuffer_wpeek (cbuffer_t *, siovec_t *) ;
+#define cbuffer_WSEEK(b, w) ((b)->n = ((b)->n + (w)) % (b)->a, w)
+extern unsigned int cbuffer_wseek (cbuffer_t *, unsigned int) ;
+
+
+ /* Reading */
+
+extern unsigned int cbuffer_get (cbuffer_t *, char *, unsigned int) ;
+extern unsigned int cbuffer_getv (cbuffer_t *, siovec_t const *, unsigned int) ;
+
+#define cbuffer_UNGET(b, n) ((b)->p = ((b)->a + (b)->p - n) % (b)->a, n) ;
+extern unsigned int cbuffer_unget (cbuffer_t *, unsigned int) ;
+extern void cbuffer_rpeek (cbuffer_t *, siovec_t *) ;
+#define cbuffer_RSEEK(b, n) ((b)->p = ((b)->p + (n)) % (b)->a, n)
+extern unsigned int cbuffer_rseek (cbuffer_t *, unsigned int) ;
+
+
+ /* Utility */
+
+#define cbuffer_len(b) ((unsigned int)(((b)->a - (b)->p + (b)->n) % (b)->a))
+#define cbuffer_available(b) ((unsigned int)(((b)->a - (b)->n + (b)->p - 1) % (b)->a))
+#define cbuffer_isempty(b) (!cbuffer_len(b))
+#define cbuffer_isfull(b) (!cbuffer_available(b))
+
+#endif
diff --git a/src/include/skalibs/cdb.h b/src/include/skalibs/cdb.h
new file mode 100644
index 0000000..9e9aae0
--- /dev/null
+++ b/src/include/skalibs/cdb.h
@@ -0,0 +1,51 @@
+/* ISC license. */
+
+#ifndef CDB_H
+#define CDB_H
+
+#include
+#include
+
+#define CDB_HASHSTART 5381
+extern uint32 cdb_hashadd (uint32, unsigned char) gccattr_const ;
+extern uint32 cdb_hash (char const *, unsigned int) gccattr_pure ;
+
+typedef struct cdb cdb_t, *cdb_t_ref ;
+struct cdb
+{
+ char *map ; /* 0 if no map */
+ int fd ; /* -1 if uninitted, negative if mapped, nonnegative if nomapped */
+ uint32 size ; /* initialized if map is nonzero */
+ uint32 loop ; /* number of hash slots searched under this key */
+ uint32 khash ; /* initialized if loop is nonzero */
+ uint32 kpos ; /* initialized if loop is nonzero */
+ uint32 hpos ; /* initialized if loop is nonzero */
+ uint32 hslots ; /* initialized if loop is nonzero */
+ uint32 dpos ; /* initialized if cdb_findnext() returns 1 */
+ uint32 dlen ; /* initialized if cdb_findnext() returns 1 */
+} ;
+
+#define CDB_ZERO { .map = 0, .fd = -1, .size = 0, .loop = 0, .khash = 0, .kpos = 0, .hpos = 0, .hslots = 0, .dpos = 0, .dlen = 0 }
+extern struct cdb const cdb_zero ;
+
+extern void cdb_free (struct cdb *) ;
+
+#define cdb_init(c, fd) (cdb_init_map(c, (fd), 1) ? 0 : -1)
+extern int cdb_init_map (struct cdb *, int fd, int) ;
+extern int cdb_mapfile (struct cdb *, char const *) ;
+extern int cdb_read (struct cdb *, char *, unsigned int, uint32) ;
+#define cdb_findstart(c) ((c)->loop = 0)
+extern int cdb_findnext (struct cdb *, char const *, unsigned int) ;
+#define cdb_find(c, s, len) (cdb_findstart(c), cdb_findnext(c, s, len))
+
+#define cdb_datapos(c) ((c)->dpos)
+#define cdb_datalen(c) ((c)->dlen)
+#define cdb_keypos(c) ((c)->kpos)
+#define cdb_keylen(c) ((c)->dpos - (c)->kpos)
+
+#define cdb_traverse_init(c, kpos) (*(kpos) = 2048)
+#define cdb_firstkey(c, kpos) (cdb_traverse_init(c, kpos), cdb_nextkey(c, kpos))
+extern int cdb_nextkey (struct cdb *, uint32 *) ;
+extern int cdb_successor (struct cdb *, char const *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/cdb_make.h b/src/include/skalibs/cdb_make.h
new file mode 100644
index 0000000..d0a949b
--- /dev/null
+++ b/src/include/skalibs/cdb_make.h
@@ -0,0 +1,27 @@
+/* ISC license. */
+
+#ifndef CDB_MAKE_H
+#define CDB_MAKE_H
+
+#include
+#include
+#include
+#include
+
+typedef struct cdb_make cdb_make, *cdb_make_ref ;
+struct cdb_make
+{
+ char buf[BUFFER_OUTSIZE] ;
+ genalloc hplist ; /* diuint32 */
+ buffer b ;
+ uint32 pos ;
+ int fd ;
+} ;
+
+#define CDB_MAKE_ZERO { .buf = "", .hplist = GENALLOC_ZERO, .b = BUFFER_INIT(&buffer_write, -1, 0, 0), .pos = 2048, .fd = -1 }
+
+extern int cdb_make_start (struct cdb_make *, int) ;
+extern int cdb_make_add (struct cdb_make *, char const *, unsigned int, char const *, unsigned int) ;
+extern int cdb_make_finish (struct cdb_make *) ;
+
+#endif
diff --git a/src/include/skalibs/datastruct.h b/src/include/skalibs/datastruct.h
new file mode 100644
index 0000000..1c7d816
--- /dev/null
+++ b/src/include/skalibs/datastruct.h
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#ifndef DATASTRUCT_H
+#define DATASTRUCT_H
+
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/src/include/skalibs/direntry.h b/src/include/skalibs/direntry.h
new file mode 100644
index 0000000..3150e51
--- /dev/null
+++ b/src/include/skalibs/direntry.h
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#ifndef DIRENTRY_H
+#define DIRENTRY_H
+
+#include
+#include
+
+typedef struct dirent direntry, direntry_t, *direntry_ref, *direntry_t_ref ;
+
+extern int dir_close (DIR *) ;
+
+#endif
diff --git a/src/include/skalibs/diuint.h b/src/include/skalibs/diuint.h
new file mode 100644
index 0000000..1c13bd8
--- /dev/null
+++ b/src/include/skalibs/diuint.h
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#ifndef DIUINT_H
+#define DIUINT_H
+
+typedef struct diuint diuint, *diuint_ref ;
+struct diuint
+{
+ unsigned int left ;
+ unsigned int right ;
+} ;
+
+#define DIUINT_ZERO { .left = 0, .right = 0 }
+
+#endif
diff --git a/src/include/skalibs/diuint32.h b/src/include/skalibs/diuint32.h
new file mode 100644
index 0000000..cd8ae75
--- /dev/null
+++ b/src/include/skalibs/diuint32.h
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+#ifndef DIUINT32_H
+#define DIUINT32_H
+
+#include
+
+typedef struct diuint32 diuint32, *diuint32_ref ;
+struct diuint32
+{
+ uint32 left ;
+ uint32 right ;
+} ;
+
+#define DIUINT32_ZERO { .left = 0, .right = 0 }
+
+#endif
diff --git a/src/include/skalibs/djbtime.h b/src/include/skalibs/djbtime.h
new file mode 100644
index 0000000..60a1d0b
--- /dev/null
+++ b/src/include/skalibs/djbtime.h
@@ -0,0 +1,70 @@
+/* ISC license. */
+
+#ifndef DJBTIME_H
+#define DJBTIME_H
+
+#include
+#include
+#include
+#include
+#include
+
+
+/* UTC <--> TAI conversions */
+/* sysclock can be either TAI-10 or UTC */
+
+extern int utc_from_tai (uint64 *, tai_t const *) ;
+extern int tai_from_utc (tai_t *, uint64) ;
+extern int utc_from_sysclock (uint64 *) ;
+extern int sysclock_from_utc (uint64 *) ;
+
+
+/* NTP internal format */
+
+#define NTP_OFFSET 2208988800UL
+extern int ntp_from_tain (uint64 *, tain_t const *) ;
+extern int tain_from_ntp (tain_t *, uint64) ;
+
+
+/* localtime handling - replaces caltimedate functions */
+/* ltm64 can be either TAI-10 or UTC depending on --enable-right-tz */
+/* normally ltm64 is the same as sysclock, but we allow it to be different */
+/* for instance for musl TAI-10 systems */
+
+typedef struct localtmn_s localtmn_t, *localtmn_t_ref ;
+struct localtmn_s
+{
+ struct tm tm ;
+ uint32 nano ;
+} ;
+
+extern int ltm64_from_tai (uint64 *, tai_t const *) ;
+extern int tai_from_ltm64 (tai_t *, uint64) ;
+extern int ltm64_from_utc (uint64 *) ;
+extern int utc_from_ltm64 (uint64 *) ;
+extern int ltm64_from_sysclock (uint64 *) ;
+extern int sysclock_from_ltm64 (uint64 *) ;
+
+extern int localtm_from_ltm64 (struct tm *, uint64, int) ;
+extern int ltm64_from_localtm (uint64 *, struct tm const *) ;
+extern int localtm_from_sysclock (struct tm *, uint64, int) ;
+extern int sysclock_from_localtm (uint64 *, struct tm const *) ;
+extern int localtm_from_utc (struct tm *, uint64, int) ;
+extern int utc_from_localtm (uint64 *, struct tm const *) ;
+extern int localtm_from_tai (struct tm *, tai_t const *, int) ;
+extern int tai_from_localtm (tai_t *, struct tm const *) ;
+
+extern int localtmn_from_tain (localtmn_t_ref, tain_t const *, int) ;
+extern int tain_from_localtmn (tain_t *, localtmn_t const *) ;
+extern int localtmn_from_sysclock (localtmn_t_ref, tain_t const *, int) ;
+extern int sysclock_from_localtmn (tain_t *, localtmn_t const *) ;
+
+#define LOCALTM_FMT 21
+extern unsigned int localtm_fmt (char *, struct tm const *) ;
+extern unsigned int localtm_scan (char const *, struct tm *) ;
+
+#define LOCALTMN_FMT 31
+extern unsigned int localtmn_fmt (char *, localtmn_t const *) ;
+extern unsigned int localtmn_scan (char const *, localtmn_t_ref) ;
+
+#endif
diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h
new file mode 100644
index 0000000..b5f5db4
--- /dev/null
+++ b/src/include/skalibs/djbunix.h
@@ -0,0 +1,149 @@
+/* ISC license. */
+
+#ifndef DJBUNIX_H
+#define DJBUNIX_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include /* compatibility */
+
+#define DJBUNIX_FLAG_NB 0x01U
+#define DJBUNIX_FLAG_COE 0x02U
+
+extern int coe (int) ;
+extern int uncoe (int) ;
+extern int ndelay_on (int) ;
+extern int ndelay_off (int) ;
+extern int pipe_internal (int *, unsigned int) ;
+#define pipenb(p) pipe_internal(p, DJBUNIX_FLAG_NB)
+#define pipecoe(p) pipe_internal(p, DJBUNIX_FLAG_COE)
+#define pipenbcoe(p) pipe_internal(p, DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int fd_copy (int, int) ;
+extern int fd_copy2 (int, int, int, int) ;
+extern int fd_move (int, int) ;
+extern int fd_move2 (int, int, int, int) ;
+extern int fd_close (int) ;
+extern int fd_chmod (int, unsigned int) ;
+extern int fd_chown (int, unsigned int, unsigned int) ;
+extern int fd_sync (int) ;
+extern int fd_cat (int, int) ;
+extern unsigned int fd_catn (int, int, unsigned int) ;
+extern int fd_ensure_open (int, int) ;
+#define fd_sanitize() (fd_ensure_open(0, 0) && fd_ensure_open(1, 1))
+extern int lock_ex (int) ;
+extern int lock_exnb (int) ;
+extern int lock_sh (int) ;
+extern int lock_shnb (int) ;
+extern int lock_un (int) ;
+extern int open2 (char const *, unsigned int) ;
+extern int open3 (char const *, unsigned int, unsigned int) ;
+extern int open_read (char const *) ;
+extern int open_readb (char const *) ;
+extern int open_excl (char const *) ;
+extern int open_append (char const *) ;
+extern int open_create (char const *) ;
+extern int open_trunc (char const *) ;
+extern int open_write (char const *) ;
+extern int socket_internal (int, int, int, unsigned int) ;
+extern int socketpair_internal (int, int, int, unsigned int, int *) ;
+
+extern int pathexec_env (char const *, char const *) ;
+extern void pathexec_r (char const *const *, char const *const *, unsigned int, char const *, unsigned int) ;
+extern void pathexec_r_name (char const *, char const *const *, char const *const *, unsigned int, char const *, unsigned int) ;
+extern void pathexec_fromenv (char const *const *, char const *const *, unsigned int) ;
+extern void execvep (char const *, char const *const *, char const *const *, char const *) ;
+extern void pathexec_run (char const *, char const *const *, char const *const *) ;
+extern void pathexec0_run (char const *const *, char const *const *) ;
+extern void pathexec (char const *const *) ;
+extern void pathexec0 (char const *const *) ;
+
+#define prot_gid(gid) setgid(gid)
+#define prot_uid(uid) setuid(uid)
+extern int prot_readgroups (char const *, gid_t *, unsigned int) ;
+extern int prot_grps (char const *) ;
+extern int prot_setuidgid (char const *) ;
+
+extern long seek_cur (int) ;
+extern int seek_set (int, long) ;
+extern int seek_end (int) ;
+extern int seek_trunc (int, long) ;
+#define seek_begin(fd) (seek_set((fd), 0))
+
+extern pid_t wait_nointr (int *) ;
+extern pid_t waitpid_nointr (pid_t, int *, int) ;
+#define wait_pid(pid, wstat) waitpid_nointr(pid, (wstat), 0)
+#define wait_nohang(wstat) waitpid_nointr(-1, (wstat), WNOHANG)
+extern pid_t wait_pid_nohang (pid_t, int *) ;
+extern int wait_pids_nohang (pid_t const *, unsigned int, int *) ;
+#define wait_status(w) (WIFSIGNALED(w) ? 126 : WEXITSTATUS(w))
+extern unsigned int wait_reap (void) ;
+extern int waitn (pid_t *, unsigned int) ;
+extern int waitn_reap (pid_t *, unsigned int) ;
+
+extern pid_t doublefork (void) ;
+
+extern int fd_chdir (int) ;
+
+#define absolutepath(sa, s) sarealpath(sa, s)
+/* extern char *realpath (char const *, char *) ; */
+extern char *realpath_tmp (char const *, char *, stralloc *) ;
+extern int sarealpath (stralloc *, char const *) ;
+extern int sarealpath_tmp (stralloc *, char const *, stralloc *) ;
+/* extern char *basename (char *) ; */
+extern int sabasename (stralloc *, char const *, unsigned int) ;
+/* extern char *dirname (char *) ; */
+extern int sadirname (stralloc *, char const *, unsigned int) ;
+extern int sagetcwd (stralloc *) ;
+extern int sareadlink (stralloc *, char const *) ;
+extern int sagethostname (stralloc *) ;
+
+extern int slurp (stralloc *, int) ;
+extern int openslurpclose (stralloc *, char const *) ;
+extern int openreadclose (char const *, stralloc *, unsigned int) ;
+extern int openreadnclose (char const *, char *, unsigned int) ;
+extern int openreadfileclose (char const *, stralloc *, unsigned int) ;
+
+#define openwritenclose_unsafe(f, s, n) openwritenclose_unsafe_internal(f, s, (n), 0, 0, 0)
+#define openwritenclose_unsafe_sync(f, s, n) openwritenclose_unsafe_internal(f, s, (n), 0, 0, 1)
+#define openwritenclose_unsafe_devino(f, s, n, dev, ino) openwritenclose_unsafe_internal(f, s, n, dev, (ino), 0)
+#define openwritenclose_unsafe_devino_sync(f, s, n, dev, ino) openwritenclose_unsafe_internal(f, s, n, dev, (ino), 1)
+extern int openwritenclose_unsafe_internal (char const *, char const *, unsigned int, uint64 *, uint64 *, int) ;
+
+#define openwritenclose_suffix(f, s, n, t) openwritenclose_suffix_internal(f, s, n, 0, 0, 0, t)
+#define openwritenclose_suffix_sync(f, s, n, t) openwritenclose_suffix_internal(f, s, n, 0, 0, 1, t)
+#define openwritenclose_suffix_devino(f, s, n, t, dev, ino) openwritenclose_suffix_internal(f, s, n, dev, (ino), 0, t)
+#define openwritenclose_suffix_devino_sync(f, s, n, t, dev, ino) openwritenclose_suffix_internal(f, s, n, dev, (ino), 1, t)
+extern int openwritenclose_suffix_internal (char const *, char const *, unsigned int, uint64 *, uint64 *, int, char const *) ;
+
+extern int rm_rf (char const *) ;
+extern int rm_rf_tmp (char const *, stralloc *) ;
+extern int rm_rf_in_tmp (stralloc *, unsigned int) ; /* caution ! */
+extern int rmstar (char const *) ;
+extern int rmstar_tmp (char const *, stralloc *) ;
+
+
+ /* Simple spawn functions. 0 for no communication, 1 for a child/parent pipe. */
+
+extern pid_t child_spawn0 (char const *, char const *const *, char const *const *) ;
+extern pid_t child_spawn1 (char const *, char const *const *, char const *const *, int *, int) ;
+
+
+ /*
+ Unified function to fork a child with communication canals.
+ * uses posix_spawn() if available, else uses fork+exec
+ * requests n (the last arg) communication fds between parent and child
+ * if n=1, the fd is a Unix socket. If more canals are needed, you can
+ pass them through that socket.
+ * if n>=2, the fds are pipes, parent reads on even and writes on odd.
+ */
+
+extern pid_t child_spawn (char const *, char const *const *, char const *const *, int *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/env.h b/src/include/skalibs/env.h
new file mode 100644
index 0000000..ccb3aac
--- /dev/null
+++ b/src/include/skalibs/env.h
@@ -0,0 +1,26 @@
+/* ISC license. */
+
+#ifndef ENV_H
+#define ENV_H
+
+#include
+#include
+
+extern unsigned int env_len (char const *const *) gccattr_pure ;
+extern char const *env_get (char const *) gccattr_pure ;
+extern char const *env_get2 (char const *const *, char const *) gccattr_pure ;
+extern char const *ucspi_get (char const *) gccattr_pure ;
+extern int env_addmodif (stralloc *, char const *, char const *) ;
+extern int env_make (char const **, unsigned int, char const *, unsigned int) ;
+extern unsigned int env_merge (char const **, unsigned int, char const *const *, unsigned int, char const *, unsigned int) ;
+extern int env_string (stralloc *, char const *const *, unsigned int) ;
+
+#define SKALIBS_ENVDIR_VERBATIM 0x01
+#define SKALIBS_ENVDIR_NOCHOMP 0x02
+extern int envdir_internal (char const *, stralloc *, unsigned int, char) ;
+#define envdir(path, sa) envdir_internal(path, (sa), 0, '\n')
+#define envdir_leaveblanks(path, sa) envdir_internal(path, (sa), SKALIBS_ENVDIR_NOCHOMP, '\n')
+#define envdir_verbatim_chomp(path, sa) envdir_internal(path, (sa), SKALIBS_ENVDIR_VERBATIM, '\n')
+#define envdir_verbatim(path, sa) envdir_internal(path, (sa), SKALIBS_ENVDIR_VERBATIM|SKALIBS_ENVDIR_NOCHOMP, '\n')
+
+#endif
diff --git a/src/include/skalibs/envalloc.h b/src/include/skalibs/envalloc.h
new file mode 100644
index 0000000..1ebcd6b
--- /dev/null
+++ b/src/include/skalibs/envalloc.h
@@ -0,0 +1,15 @@
+/* ISC license. */
+
+#ifndef ENVALLOC_H
+#define ENVALLOC_H
+
+#include
+
+#define ENVALLOC_ZERO GENALLOC_ZERO
+
+extern int envalloc_make (genalloc *, unsigned int, char const *, unsigned int) ;
+extern int envalloc_uniq (genalloc *, char) ;
+extern int envalloc_merge (genalloc *, char const *const *, unsigned int, char const *, unsigned int) ;
+extern int envalloc_0 (genalloc *) ;
+
+#endif
diff --git a/src/include/skalibs/environ.h b/src/include/skalibs/environ.h
new file mode 100644
index 0000000..6bf3041
--- /dev/null
+++ b/src/include/skalibs/environ.h
@@ -0,0 +1,8 @@
+/* ISC license. */
+
+#ifndef ENVIRON_H
+#define ENVIRON_H
+
+extern char **environ ;
+
+#endif
diff --git a/src/include/skalibs/fmtscan.h b/src/include/skalibs/fmtscan.h
new file mode 100644
index 0000000..ccfd160
--- /dev/null
+++ b/src/include/skalibs/fmtscan.h
@@ -0,0 +1,53 @@
+/* ISC license. */
+
+#ifndef FMTSCAN_H
+#define FMTSCAN_H
+
+#include
+#include
+
+
+ /* fmt */
+
+
+extern unsigned char fmtscan_asc (unsigned char) gccattr_const ;
+
+extern unsigned int str_fmt (char *, char const *) ;
+extern unsigned int strn_fmt (char *, char const *, unsigned int) ;
+
+#define IP4_FMT 20
+extern unsigned int ip4_fmt (char *, char const *) ;
+extern unsigned int ip4_fmtu32 (char *, uint32) ;
+
+extern unsigned int ucharn_fmt (char *, char const *, unsigned int) ;
+extern unsigned int ucharn_fmt_little (char *, char const *, unsigned int) ;
+
+#define IP6_FMT 40
+extern unsigned int ip6_fmt (char *, char const *) ;
+
+#define short_fmt(s, u) long_fmt((s), (long)(u))
+#define int_fmt(s, u) long_fmt((s), (long)(u))
+extern unsigned int long_fmt (char *, long) ;
+
+
+ /* scan */
+
+
+extern unsigned char fmtscan_num (unsigned char, unsigned char) gccattr_const ;
+
+extern unsigned int ip4_scan (char const *, char *) ;
+extern unsigned int ip4_scanu32 (char const *, uint32 *) ;
+extern unsigned int ip4_scanlist_u32 (uint32 *, unsigned int, char const *, unsigned int *) ;
+extern unsigned int ip4_scanlist (char *, unsigned int, char const *, unsigned int *) ;
+extern unsigned int ip6_scan (char const *, char *) ;
+extern unsigned int ip6_scanlist (char *, unsigned int, char const *, unsigned int *) ;
+
+extern unsigned int ucharn_scan (char const *, char *, unsigned int) ;
+extern unsigned int ucharn_scan_little (char const *, char *, unsigned int) ;
+extern unsigned int ucharn_findlen (char const *) gccattr_pure ;
+
+extern unsigned int short_scan (char const *, short *) ;
+extern unsigned int int_scan (char const *, int *) ;
+extern unsigned int long_scan (char const *, long *) ;
+
+#endif
diff --git a/src/include/skalibs/functypes.h b/src/include/skalibs/functypes.h
new file mode 100644
index 0000000..15cdbcc
--- /dev/null
+++ b/src/include/skalibs/functypes.h
@@ -0,0 +1,33 @@
+/* ISC license. */
+
+#ifndef FUNCTYPES_H
+#define FUNCTYPES_H
+
+typedef int uintcmpfunc_t (unsigned int, unsigned int, void *) ;
+typedef uintcmpfunc_t *uintcmpfunc_t_ref ;
+
+typedef int cmpfunc_t (void const *, void const *, void *) ;
+typedef cmpfunc_t *cmpfunc_t_ref ;
+
+typedef void *dtokfunc_t (unsigned int, void *) ;
+typedef dtokfunc_t *dtokfunc_t_ref ;
+
+typedef int iterfunc_t (char *, void *) ;
+typedef iterfunc_t *iterfunc_t_ref ;
+
+typedef void freefunc_t (void *) ;
+typedef freefunc_t *freefunc_t_ref ;
+
+typedef int initfunc_t (void *) ;
+typedef initfunc_t *initfunc_t_ref ;
+
+typedef unsigned int uinitfunc_t (void *) ;
+typedef uinitfunc_t *uinitfunc_t_ref ;
+
+typedef int iofunc_t (int, char *, unsigned int) ;
+typedef iofunc_t *iofunc_t_ref ;
+
+typedef unsigned int alliofunc_t (int, char *, unsigned int) ;
+typedef alliofunc_t *alliofunc_t_ref ;
+
+#endif
diff --git a/src/include/skalibs/gccattributes.h b/src/include/skalibs/gccattributes.h
new file mode 100644
index 0000000..0584480
--- /dev/null
+++ b/src/include/skalibs/gccattributes.h
@@ -0,0 +1,61 @@
+/* ISC license. */
+
+#ifndef GCCATTRIBUTES_H
+#define GCCATTRIBUTES_H
+
+#ifdef __GNUC__
+
+#define gccattr_noreturn __attribute__((__noreturn__))
+#define gccattr_noinline __attribute__((__noinline__))
+#define gccattr_inline __attribute__((__always_inline__))
+#define gccattr_const __attribute__((__const__))
+#define gccattr_unused __attribute__((__unused__))
+#define gccattr_used __attribute__((__used__))
+#define gccattr_weak __attribute__((__weak__))
+#define gccattr_aligned __attribute__((__aligned__))
+
+# if (__GNUC__ >= 3) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 96))
+#define gccattr_malloc __attribute__((__malloc__))
+#define gccattr_pure __attribute__((__pure__))
+# else
+#define gccattr_malloc
+#define gccattr_pure
+# endif
+
+# if (__GNUC__ >= 3)
+#define gccattr_deprecated __attribute__((__deprecated__))
+# else
+#define gccattr_deprecated
+# endif
+
+#else
+
+#define gccattr_noreturn
+#define gccattr_noinline
+#define gccattr_inline
+#define gccattr_const
+#define gccattr_unused
+#define gccattr_used
+#define gccattr_weak
+#define gccattr_aligned
+#define gccattr_malloc
+#define gccattr_pure
+#define gccattr_deprecated
+
+#endif
+
+#ifdef GCCATTR_COMPAT_0_22
+#define _a_noreturn gccattr_noreturn
+#define _a_noinline gccattr_noinline
+#define _a_inline gccattr_inline
+#define _a_const gccattr_const
+#define _a_unused gccattr_unused
+#define _a_used gccattr_used
+#define _a_weak gccattr_weak
+#define _a_aligned gccattr_aligned
+#define _a_malloc gccattr_malloc
+#define _a_pure gccattr_pure
+#define _a_deprecated gccattr_deprecated
+#endif
+
+#endif
diff --git a/src/include/skalibs/genalloc.h b/src/include/skalibs/genalloc.h
new file mode 100644
index 0000000..1aa0613
--- /dev/null
+++ b/src/include/skalibs/genalloc.h
@@ -0,0 +1,35 @@
+/* ISC license. */
+
+#ifndef GENALLOC_H
+#define GENALLOC_H
+
+#include
+#include
+
+typedef stralloc genalloc, *genalloc_ref ;
+
+#define GENALLOC_ZERO STRALLOC_ZERO
+#define genalloc_zero stralloc_zero
+
+#define genalloc_s(type, g) ((type *)((g)->s))
+#define genalloc_len(type, g) ((g)->len/sizeof(type))
+#define genalloc_setlen(type, g, n) ((g)->len = (n)*sizeof(type))
+
+#define genalloc_ready(type, g, n) stralloc_ready((g), (n)*sizeof(type))
+#define genalloc_ready_tuned(type, g, n, base, fracnum, fracden) stralloc_ready_tuned((g), (n)*sizeof(type), base, fracnum, fracden)
+#define genalloc_readyplus(type, g, n) stralloc_readyplus((g), (n)*sizeof(type))
+#define genalloc_free(type, g) stralloc_free(g)
+#define genalloc_shrink(type, g) stralloc_shrink(g)
+#define genalloc_catb(type, g, s, n) stralloc_catb((g), (char const *)(s), (n)*sizeof(type))
+#define genalloc_copyb(type, g, s, n) stralloc_copyb((g), (char const *)(s), (n)*sizeof(type))
+#define genalloc_copy(type, g1, g2) stralloc_copy((g1), g2)
+#define genalloc_cat(type, g1, g2) stralloc_cat((g1), g2)
+#define genalloc_append(type, g, p) stralloc_catb((g), (char const *)(p), sizeof(type))
+#define genalloc_reverse(type, g) stralloc_reverse_blocks((g), sizeof(type))
+#define genalloc_insertb(type, g, offset, s, n) stralloc_insertb((g), (offset)*sizeof(type), (char const *)(s), (n)*sizeof(type))
+#define genalloc_insert(type, g1, offset, g2) stralloc_insert((g1), (offset)*sizeof(type), (g2))
+
+#define genalloc_deepfree(type, g, f) genalloc_deepfree_size(g, (freefunc_t_ref)(f), sizeof(type))
+extern void genalloc_deepfree_size (genalloc *, freefunc_t_ref, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/genset.h b/src/include/skalibs/genset.h
new file mode 100644
index 0000000..5eb47d7
--- /dev/null
+++ b/src/include/skalibs/genset.h
@@ -0,0 +1,37 @@
+/* ISC license. */
+
+#ifndef GENSET_H
+#define GENSET_H
+
+#include
+
+typedef struct genset_s genset, *genset_ref ;
+struct genset_s
+{
+ char *storage ;
+ unsigned int *freelist ;
+ unsigned int esize ;
+ unsigned int max ;
+ unsigned int sp ;
+} ;
+
+#define GENSET_ZERO { .storage = 0, .freelist = 0, .esize = 1, .max = 0, .sp = 0 }
+extern void genset_init (genset_ref, void *, unsigned int *, unsigned int, unsigned int) ;
+#define GENSET_init(g, type, storage, fl, size) genset_init(g, storage, fl, sizeof(type), size)
+
+#define genset_p(type, g, i) ((type *)((g)->storage + (i) * (g)->esize))
+extern unsigned int genset_new (genset_ref) ;
+extern int genset_delete (genset_ref, unsigned int) ;
+#define genset_n(g) ((g)->max - (g)->sp)
+extern unsigned int genset_iter (genset_ref, iterfunc_t_ref, void *) ;
+
+
+#define GENSETB_TYPE(type, size) struct { type storage[size] ; unsigned int freelist[size] ; genset info ; }
+#define GENSETB_init(type, g, size) GENSET_init(&(g)->info, type, (g)->storage, (g)->freelist, size)
+#define gensetb_p(type, g, i) genset_p(type, &(g)->info, i)
+#define gensetb_new(g) genset_new(&(g)->info)
+#define gensetb_delete(g, i) genset_delete(&(g)->info, i)
+#define gensetb_n(g) genset_n(&(g)->info)
+#define gensetb_iter(g, f, p) genset_iter(&(g)->info, f, p)
+
+#endif
diff --git a/src/include/skalibs/gensetdyn.h b/src/include/skalibs/gensetdyn.h
new file mode 100644
index 0000000..4fe396b
--- /dev/null
+++ b/src/include/skalibs/gensetdyn.h
@@ -0,0 +1,40 @@
+/* ISC license. */
+
+#ifndef GENSETDYN_H
+#define GENSETDYN_H
+
+#include
+#include
+#include
+
+typedef struct gensetdyn_s gensetdyn, *gensetdyn_ref ;
+struct gensetdyn_s
+{
+ stralloc storage ;
+ genalloc freelist ; /* array of unsigned int */
+ unsigned int esize ;
+ unsigned int base ;
+ unsigned int fracnum ;
+ unsigned int fracden ;
+} ;
+
+#define GENSETDYN_ZERO { .storage = STRALLOC_ZERO, .freelist = GENALLOC_ZERO, .esize = 1, .base = 0, .fracnum = 0, .fracden = 1 }
+extern gensetdyn const gensetdyn_zero ;
+
+#define GENSETDYN_INIT(type, b, num, den) { .storage = STRALLOC_ZERO, .freelist = GENALLOC_ZERO, .esize = sizeof(type), .base = (b), .fracnum = (num), .fracden = (den) }
+extern void gensetdyn_init (gensetdyn_ref, unsigned int, unsigned int, unsigned int, unsigned int) ;
+
+#define gensetdyn_n(g) ((g)->storage.len - genalloc_len(unsigned int, &(g)->freelist))
+extern int gensetdyn_ready (gensetdyn_ref, unsigned int) ;
+#define gensetdyn_readyplus(x, n) gensetdyn_ready(x, gensetdyn_n(x) + (n))
+extern void gensetdyn_free (gensetdyn_ref) ;
+
+extern int gensetdyn_new (gensetdyn_ref, unsigned int *) ;
+extern int gensetdyn_delete (gensetdyn_ref, unsigned int) ;
+
+#define gensetdyn_p(g, i) ((g)->storage.s + (i) * (g)->esize)
+#define GENSETDYN_P(type, g, i) ((type *)gensetdyn_p(g, i))
+
+extern unsigned int gensetdyn_iter (gensetdyn_ref, iterfunc_t_ref, void *) ;
+
+#endif
diff --git a/src/include/skalibs/genwrite.h b/src/include/skalibs/genwrite.h
new file mode 100644
index 0000000..9ae0fb9
--- /dev/null
+++ b/src/include/skalibs/genwrite.h
@@ -0,0 +1,35 @@
+/* ISC license. */
+
+#ifndef GENWRITE_H
+#define GENWRITE_H
+
+typedef int genwrite_put_func_t (void *, char const *, unsigned int) ;
+typedef genwrite_put_func_t *genwrite_put_func_t_ref ;
+
+typedef int genwrite_flush_func_t (void *) ;
+typedef genwrite_flush_func_t *genwrite_flush_func_t_ref ;
+
+typedef struct genwrite_s genwrite_t, *genwrite_t_ref ;
+struct genwrite_s
+{
+ genwrite_put_func_t_ref put ;
+ genwrite_flush_func_t_ref flush ;
+ void *target ;
+} ;
+#define GENWRITE_ZERO { .put = 0, .flush = 0, .target = 0 }
+
+extern genwrite_put_func_t genwrite_put_stralloc ;
+extern genwrite_flush_func_t genwrite_flush_stralloc ;
+extern genwrite_put_func_t genwrite_put_buffer ;
+extern genwrite_flush_func_t genwrite_flush_buffer ;
+extern genwrite_put_func_t genwrite_put_bufalloc ;
+extern genwrite_flush_func_t genwrite_flush_bufalloc ;
+
+#define GENWRITE_STRALLOC_INIT(sa) { .put = &genwrite_put_stralloc, .flush = &genwrite_flush_stralloc, .target = (sa) }
+#define GENWRITE_BUFFER_INIT(b) { .put = &genwrite_put_buffer, .flush = &genwrite_flush_buffer, .target = (b) }
+#define GENWRITE_BUFALLOC_INIT(ba) { .put = &genwrite_put_bufalloc, .flush = &genwrite_flush_bufalloc, .target = (ba) }
+
+extern genwrite_t genwrite_stdout ;
+extern genwrite_t genwrite_stderr ;
+
+#endif
diff --git a/src/include/skalibs/getpeereid.h b/src/include/skalibs/getpeereid.h
new file mode 100644
index 0000000..4aa2898
--- /dev/null
+++ b/src/include/skalibs/getpeereid.h
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#ifndef GETPEEREID_H
+#define GETPEEREID_H
+
+#include
+
+extern int getpeereid (int, uid_t *, gid_t *) ;
+
+#endif
diff --git a/src/include/skalibs/iobuffer.h b/src/include/skalibs/iobuffer.h
new file mode 100644
index 0000000..c1864cf
--- /dev/null
+++ b/src/include/skalibs/iobuffer.h
@@ -0,0 +1,117 @@
+/* ISC license. */
+
+#ifndef IOBUFFER_H
+#define IOBUFFER_H
+
+#define IOBUFFER_SIZE 65536U
+
+ /* iobufferu */
+
+#include
+#include
+
+#define IOBUFFERU_SIZE (IOBUFFER_SIZE+1)
+
+typedef struct iobufferu_s iobufferu, *iobufferu_ref ;
+struct iobufferu_s
+{
+ buffer b[2] ;
+ char *buf ;
+} ;
+
+extern int iobufferu_init (iobufferu_ref, int, int) ;
+extern int iobufferu_fill (iobufferu_ref) ;
+extern int iobufferu_flush (iobufferu_ref) ;
+extern void iobufferu_finish (iobufferu_ref) ;
+
+#define iobufferu_len(u) buffer_len(&(u)->b[0])
+#define iobufferu_available(u) buffer_available(&(u)->b[1])
+#define iobufferu_isempty(u) buffer_isempty(&(u)->b[0])
+#define iobufferu_isfull(u) buffer_isfull(&(u)->b[1])
+#define iobufferu_fd(u, h) buffer_fd((u)->b[h])
+#define iobufferu_isreadable(u) iobufferu_available(u)
+#define iobufferu_iswritable(u) iobufferu_len(u)
+#define iobufferu_nonblock(u, h) ndelay_on(iobufferu_fd(u, h))
+#define iobufferu_block(u, h) ndelay_off(iobufferu_fd(u, h))
+#define iobufferu_nbstate(u, h, j) (j ? iobufferu_nonblock(u, h) : iobufferu_block(u, h))
+
+
+ /* iobufferk */
+
+#define IOBUFFERK_SIZE IOBUFFER_SIZE
+
+typedef struct iobufferk_s iobufferk, *iobufferk_ref ;
+struct iobufferk_s
+{
+ int fd[2] ;
+ int p[2] ;
+ unsigned int n ;
+ unsigned int type : 2 ;
+ unsigned int nb : 2 ;
+} ;
+
+typedef int iobufferk_io_func_t (iobufferk_ref) ;
+typedef iobufferk_io_func_t *iobufferk_io_func_t_ref ;
+typedef void iobufferk_finish_func_t (iobufferk_ref) ;
+typedef iobufferk_finish_func_t *iobufferk_finish_func_t_ref ;
+
+extern iobufferk_io_func_t iobufferk_nosys ;
+extern iobufferk_io_func_t iobufferk_isworking ;
+
+extern int iobufferk_init (iobufferk_ref, int, int) ;
+extern iobufferk_io_func_t_ref const iobufferk_fill_f[4] ;
+extern iobufferk_io_func_t_ref const iobufferk_flush_f[4] ;
+extern iobufferk_finish_func_t_ref const iobufferk_finish_f[4] ;
+
+#define iobufferk_fill(k) (*iobufferk_fill_f[(k)->type])(k)
+#define iobufferk_flush(k) (*iobufferk_flush_f[(k)->type])(k)
+#define iobufferk_finish(k) (*iobufferk_finish_f[(k)->type])(k)
+#define iobufferk_len(k) ((k)->n)
+#define iobufferk_available(k) (IOBUFFERK_SIZE - (k)->n)
+#define iobufferk_isempty(k) (!iobufferk_len(k))
+#define iobufferk_isfull(k) (!iobufferk_available(k))
+#define iobufferk_fd(k, h) ((k)->fd[h])
+#define iobufferk_isreadable(k) iobufferk_available(k)
+#define iobufferk_iswritable(k) iobufferk_len(k)
+#define iobufferk_nonblock(k, h) ((k)->nb |= (1 << (h)), 0)
+#define iobufferk_block(k, h) ((k)->nb &= (3 - (1 << (h))), 0)
+#define iobufferk_nbstate(k, h, j) (j ? iobufferk_nonblock(k, h) : iobufferk_block(k, h))
+
+
+ /* iobuffer */
+
+typedef union iobufferku_u iobufferku, *iobufferku_ref ;
+union iobufferku_u
+{
+ iobufferk k ;
+ iobufferu u ;
+} ;
+
+typedef struct iobuffer_s iobuffer, *iobuffer_ref ;
+struct iobuffer_s
+{
+ iobufferku x ;
+ unsigned int isk : 1 ;
+} ;
+
+extern int iobuffer_ufromk (iobufferu_ref, iobufferk_ref) ;
+extern int iobuffer_kfromu (iobufferk_ref, iobufferu_ref) ;
+extern int iobuffer_salvage (iobuffer_ref) ;
+
+extern int iobuffer_init (iobuffer_ref, int, int) ;
+extern int iobuffer_fill (iobuffer_ref) ;
+extern int iobuffer_flush (iobuffer_ref) ;
+
+#define iobuffer_finish(b) ((b)->isk ? iobufferk_finish(&(b)->x.k) : iobufferu_finish(&(b)->x.u))
+#define iobuffer_len(b) ((b)->isk ? iobufferk_len(&(b)->x.k) : iobufferu_len(&(b)->x.u))
+#define iobuffer_available(b) ((b)->isk ? iobufferk_available(&(b)->x.k) : iobufferu_available(&(b)->x.u))
+#define iobuffer_isempty(b) ((b)->isk ? iobufferk_isempty(&(b)->x.k) : iobufferu_isempty(&(b)->x.u))
+#define iobuffer_isfull(b) ((b)->isk ? iobufferk_isfull(&(b)->x.k) : iobufferu_isfull(&(b)->x.u))
+#define iobuffer_fd(b, h) ((b)->isk ? iobufferk_fd(&(b)->x.k, h) : iobufferu_fd(&(b)->x.u, h))
+#define iobuffer_isreadable(b) ((b)->isk ? iobufferk_isreadable(&(b)->x.k) : iobufferu_isreadable(&(b)->x.u))
+#define iobuffer_iswritable(b) ((b)->isk ? iobufferk_iswritable(&(b)->x.k) : iobufferu_iswritable(&(b)->x.u))
+#define iobuffer_nonblock(b, h) ((b)->isk ? iobufferk_nonblock(&(b)->x.k, h) : iobufferu_nonblock(&(b)->x.u, h))
+#define iobuffer_block(b, h) ((b)->isk ? iobufferk_block(&(b)->x.k, h) : iobufferu_block(&(b)->x.u, h))
+#define iobuffer_nbstate(b, h, j) ((b)->isk ? iobufferk_nbstate(&(b)->x.k, h, j) : iobufferu_nbstate(&(b)->x.u, h, j))
+
+#endif
diff --git a/src/include/skalibs/iopause.h b/src/include/skalibs/iopause.h
new file mode 100644
index 0000000..d8f5e1c
--- /dev/null
+++ b/src/include/skalibs/iopause.h
@@ -0,0 +1,32 @@
+/* ISC license. */
+
+#ifndef IOPAUSE_H
+#define IOPAUSE_H
+
+#include
+#include
+#include
+
+typedef struct pollfd iopause_fd, *iopause_fd_ref ;
+
+#define IOPAUSE_READ (POLLIN|POLLHUP)
+#define IOPAUSE_WRITE POLLOUT
+#define IOPAUSE_EXCEPT (POLLERR|POLLHUP|POLLNVAL)
+
+typedef int iopause_func_t (iopause_fd *, unsigned int, tain_t const *, tain_t const *) ;
+typedef iopause_func_t *iopause_func_t_ref ;
+
+extern iopause_func_t iopause_select ;
+extern iopause_func_t iopause_poll ;
+extern iopause_func_t iopause_ppoll ;
+
+extern iopause_func_t_ref const iopause_ ;
+#define iopause (*iopause_)
+
+extern int iopause_stamp (iopause_fd *, unsigned int, tain_t const *, tain_t *) ;
+#define iopause_g(x, n, deadline) iopause_stamp(x, n, (deadline), &STAMP)
+
+extern void deepsleepuntil (tain_t const *, tain_t *) ;
+#define deepsleepuntil_g(deadline) deepsleepuntil((deadline), &STAMP)
+
+#endif
diff --git a/src/include/skalibs/kolbak.h b/src/include/skalibs/kolbak.h
new file mode 100644
index 0000000..86a2170
--- /dev/null
+++ b/src/include/skalibs/kolbak.h
@@ -0,0 +1,32 @@
+/* ISC license. */
+
+#ifndef KOLBAK_H
+#define KOLBAK_H
+
+#include
+
+typedef struct kolbak_closure_s kolbak_closure_t, *kolbak_closure_t_ref ;
+struct kolbak_closure_s
+{
+ unixmessage_handler_func_t_ref f ;
+ void *data ;
+} ;
+#define KOLBAK_CLOSURE_ZERO { .f = 0, .data = 0 }
+
+typedef struct kolbak_queue_s kolbak_queue_t, *kolbak_queue_t_ref ;
+struct kolbak_queue_s
+{
+ kolbak_closure_t *x ;
+ unsigned int n ;
+ unsigned int head ;
+ unsigned int tail ;
+} ;
+#define KOLBAK_QUEUE_ZERO { .x = 0, .n = 0, .head = 0, .tail = 0 }
+#define KOLBAK_QUEUE_INIT(s, len) { .x = (s), .n = (len), .head = 0, .tail = 0 }
+
+extern int kolbak_queue_init (kolbak_queue_t *, kolbak_closure_t *, unsigned int) ;
+extern int kolbak_enqueue (kolbak_queue_t *, unixmessage_handler_func_t_ref, void *) ;
+extern int kolbak_unenqueue (kolbak_queue_t *) ;
+extern int kolbak_call (unixmessage_t const *, kolbak_queue_t *) ;
+
+#endif
diff --git a/src/include/skalibs/lolstdio.h b/src/include/skalibs/lolstdio.h
new file mode 100644
index 0000000..ec66da2
--- /dev/null
+++ b/src/include/skalibs/lolstdio.h
@@ -0,0 +1,30 @@
+/* ISC license. */
+
+#ifndef LOLSTDIO_H
+#define LOLSTDIO_H
+
+#include
+#include
+#include
+#include
+
+#ifdef DEBUG
+# define LOLDEBUG(...) do \
+ { \
+ buffer_puts(buffer_2, PROG) ; \
+ buffer_puts(buffer_2, ": debug: ") ; \
+ bprintf(buffer_2, __VA_ARGS__) ; \
+ buffer_putflush(buffer_2, "\n", 1) ; \
+ } while (0)
+#else
+# define LOLDEBUG(...)
+#endif
+
+extern int vbprintf (buffer *, char const *, va_list) ;
+extern int bprintf (buffer *, char const *, ...) ;
+extern int lolprintf (char const *, ...) ;
+
+extern int vbaprintf (bufalloc *, char const *, va_list) ;
+extern int baprintf (bufalloc *, char const *, ...) ;
+
+#endif
diff --git a/src/include/skalibs/md5.h b/src/include/skalibs/md5.h
new file mode 100644
index 0000000..00e43cc
--- /dev/null
+++ b/src/include/skalibs/md5.h
@@ -0,0 +1,21 @@
+/* ISC license. */
+
+#ifndef MD5_H
+#define MD5_H
+
+#include
+
+typedef struct MD5Schedule MD5Schedule, *MD5Schedule_ref ;
+struct MD5Schedule
+{
+ uint32 buf[4] ;
+ uint32 bits[2] ;
+ unsigned char in[64] ;
+} ;
+
+#define MD5_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL }, .bits = { 0, 0 }, .in = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" }
+extern void md5_init (MD5Schedule_ref) ;
+extern void md5_update (MD5Schedule_ref, char const *, unsigned int) ;
+extern void md5_final (MD5Schedule_ref, char * /* 16 chars */) ;
+
+#endif
diff --git a/src/include/skalibs/mininetstring.h b/src/include/skalibs/mininetstring.h
new file mode 100644
index 0000000..c275fb2
--- /dev/null
+++ b/src/include/skalibs/mininetstring.h
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#ifndef MININETSTRING_H
+#define MININETSTRING_H
+
+#include
+#include
+#include
+
+extern int mininetstring_read (int, stralloc *, uint32 *) ;
+extern int mininetstring_write (int, char const *, uint16, uint32 *) ;
+
+#endif
diff --git a/src/include/skalibs/netstring.h b/src/include/skalibs/netstring.h
new file mode 100644
index 0000000..ee5cd85
--- /dev/null
+++ b/src/include/skalibs/netstring.h
@@ -0,0 +1,24 @@
+/* ISC license. */
+
+#ifndef NETSTRING_H
+#define NETSTRING_H
+
+#include
+#include
+#include
+
+extern int netstring_appendb (stralloc *, char const *, unsigned int) ;
+#define netstring_appends(sa, s) netstring_appendb((sa), (s), str_len(s))
+#define netstring_append(to, from) netstring_appendb((to), (from)->s, (from)->len)
+extern int netstring_appendv (stralloc *, siovec_t const *, unsigned int) ;
+
+extern int netstring_encode (stralloc *, char const *, unsigned int) ;
+extern int netstring_decode (stralloc *, char const *, unsigned int) ;
+
+extern int netstring_okeof (buffer *, unsigned int) ;
+extern int netstring_get (buffer *, stralloc *, unsigned int *) ;
+extern int netstring_put (buffer *, char const *, unsigned int, unsigned int *) ;
+#define netstring_putba(ba, s, n) netstring_appendb(&(ba)->x, s, n)
+#define netstring_putbav(ba, v, n) netstring_appendv(&(ba)->x, v, n)
+
+#endif
diff --git a/src/include/skalibs/nonposix.h b/src/include/skalibs/nonposix.h
new file mode 100644
index 0000000..26af211
--- /dev/null
+++ b/src/include/skalibs/nonposix.h
@@ -0,0 +1,58 @@
+/* ISC license. */
+
+#ifndef NONPOSIX_H
+#define NONPOSIX_H
+
+
+ /* Drop all pretense of standardness: some libc headers are *more*
+ broken when you define standard feature test macros than when
+ you don't (I'm looking at you, FreeBSD). */
+
+#undef _POSIX_C_SOURCE
+#undef _XOPEN_SOURCE
+
+
+ /* Solaris: the socket API is not POSIX unless you enable this */
+
+#ifndef _XPG4_2
+#define _XPG4_2
+#endif
+#ifndef _XPG6
+#define _XPG6
+#endif
+
+
+ /* Solaris: for settimeofday() and similar. Notice how you
+ have to define by hand a macro with double underscores. */
+
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__
+#endif
+
+
+ /* GNU: most extensions are unavailable unless you enable this */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#ifndef _BSD_SOURCE
+#define _BSD_SOURCE
+#endif
+
+
+ /* NetBSD: of course they had to have their own macros. */
+
+#ifndef _NETBSD_SOURCE
+#define _NETBSD_SOURCE
+#endif
+#ifndef _INCOMPLETE_XOPEN_C063
+#define _INCOMPLETE_XOPEN_C063
+#endif
+
+
+ /* old versions of BSD: system headers are not self-contained,
+ starting with sys/types.h is the usual workaround */
+
+#include
+
+#endif
diff --git a/src/include/skalibs/nsig.h b/src/include/skalibs/nsig.h
new file mode 100644
index 0000000..f6bd240
--- /dev/null
+++ b/src/include/skalibs/nsig.h
@@ -0,0 +1,13 @@
+/* ISC license. */
+
+#ifndef NSIG_H
+
+#include
+
+#define SKALIBS_NSIG 64
+
+#ifndef NSIG
+# define NSIG SKALIBS_NSIG
+#endif
+
+#endif
diff --git a/src/include/skalibs/random.h b/src/include/skalibs/random.h
new file mode 100644
index 0000000..90aa0c0
--- /dev/null
+++ b/src/include/skalibs/random.h
@@ -0,0 +1,33 @@
+/* ISC license. */
+
+/* MT-unsafe functions only. Use rrandom for MT-safety. */
+
+#ifndef RANDOM_H
+#define RANDOM_H
+
+#include
+#include
+
+extern int badrandom_init (void) ;
+extern unsigned char badrandom_char (void) ;
+extern unsigned int badrandom_int (unsigned int) ;
+extern unsigned int badrandom_string (char *, unsigned int) ;
+extern void badrandom_finish (void) ;
+
+extern int goodrandom_init (void) ;
+extern unsigned char goodrandom_char (void) ;
+extern unsigned int goodrandom_int (unsigned int) ;
+extern unsigned int goodrandom_string (char *, unsigned int) ;
+extern void goodrandom_finish (void) ;
+
+#define random_init badrandom_init
+#define random_char badrandom_char
+#define random_int badrandom_int
+#define random_string badrandom_string
+#define random_finish badrandom_finish
+
+extern int random_name (char *, unsigned int) ;
+extern int random_sauniquename (stralloc *, unsigned int) ;
+extern void random_unsort (char *, unsigned int, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/randomegd.h b/src/include/skalibs/randomegd.h
new file mode 100644
index 0000000..28d4faa
--- /dev/null
+++ b/src/include/skalibs/randomegd.h
@@ -0,0 +1,10 @@
+/* ISC license. */
+
+#ifndef RANDOMEGD_H
+#define RANDOMEGD_H
+
+extern int randomegd_open (char const *) ;
+extern unsigned int randomegd_readb (int, char *, unsigned int) ;
+extern unsigned int randomegd_readnb (int, char *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/rc4.h b/src/include/skalibs/rc4.h
new file mode 100644
index 0000000..16683ce
--- /dev/null
+++ b/src/include/skalibs/rc4.h
@@ -0,0 +1,19 @@
+/* ISC license. */
+
+#ifndef RC4_H
+#define RC4_H
+
+#define RC4_THROWAWAY 128
+
+typedef struct RC4Schedule RC4Schedule, *RC4Schedule_ref ;
+
+struct RC4Schedule
+{
+ unsigned char tab[256] ;
+ unsigned char x, y ;
+} ;
+
+extern void rc4_init (RC4Schedule_ref, char const *, unsigned int) ;
+extern void rc4 (RC4Schedule_ref, char const *, char *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/rrandom.h b/src/include/skalibs/rrandom.h
new file mode 100644
index 0000000..7f6a2aa
--- /dev/null
+++ b/src/include/skalibs/rrandom.h
@@ -0,0 +1,36 @@
+/* ISC license. */
+
+#ifndef RRANDOM_H
+#define RRANDOM_H
+
+#include
+
+typedef struct rrandominfo rrandominfo, *rrandominfo_ref, **rrandominfo_ref_ref ;
+struct rrandominfo
+{
+ unirandom it ;
+ unsigned int ok ;
+} ;
+
+#define RRANDOMINFO_ZERO { .it = UNIRANDOM_ZERO, .ok = 3 }
+
+typedef struct rrandom rrandom, *rrandom_ref, **rrandom_ref_ref ;
+struct rrandom
+{
+ rrandominfo tries[3] ;
+ unsigned int n ;
+} ;
+
+#define RRANDOM_ZERO { .tries = { RRANDOMINFO_ZERO, RRANDOMINFO_ZERO, RRANDOMINFO_ZERO }, .n = 0 }
+
+extern int rrandom_add (rrandom_ref, int (*) (unirandom_ref)) ;
+extern int rrandom_finish (rrandom_ref) ;
+
+extern unsigned int rrandom_read (rrandom_ref, char *, unsigned int, unsigned int (*) (unirandom_ref, char *, unsigned int)) ;
+extern unsigned int rrandom_readint (rrandom_ref, unsigned int, unsigned int (*) (unirandom_ref, char *, unsigned int)) ;
+#define rrandom_readb(z, s, n) rrandom_read((z), (s), (n), &unirandom_readb)
+#define rrandom_readnb(z, s, n) rrandom_read((z), (s), (n), &unirandom_readnb)
+
+extern unsigned int rrandom_name (rrandom_ref, char *, unsigned int, int) ;
+
+#endif
diff --git a/src/include/skalibs/segfault.h b/src/include/skalibs/segfault.h
new file mode 100644
index 0000000..732ad4f
--- /dev/null
+++ b/src/include/skalibs/segfault.h
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#ifndef SEGFAULT_H
+#define SEGFAULT_H
+
+extern int sigsegv (void) ;
+extern int sigfpe (void) ;
+
+#define segfault() sigsegv()
+
+#endif
diff --git a/src/include/skalibs/selfpipe.h b/src/include/skalibs/selfpipe.h
new file mode 100644
index 0000000..c587f93
--- /dev/null
+++ b/src/include/skalibs/selfpipe.h
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+/* MT-unsafe */
+
+#ifndef SELFPIPE_H
+#define SELFPIPE_H
+
+#include
+
+extern int selfpipe_init (void) ;
+extern int selfpipe_trap (int) ;
+extern int selfpipe_untrap (int) ;
+extern int selfpipe_trapset (sigset_t const *) ;
+extern int selfpipe_read (void) ;
+extern void selfpipe_finish (void) ;
+
+#endif
diff --git a/src/include/skalibs/sgetopt.h b/src/include/skalibs/sgetopt.h
new file mode 100644
index 0000000..367edf3
--- /dev/null
+++ b/src/include/skalibs/sgetopt.h
@@ -0,0 +1,46 @@
+/* ISC license. */
+
+#ifndef SGETOPT_H
+#define SGETOPT_H
+
+
+ /* reentrant */
+
+typedef struct subgetopt_s subgetopt_t, *subgetopt_t_ref ;
+struct subgetopt_s
+{
+ int ind ;
+ int err ;
+ int problem ;
+ char const *arg ;
+ unsigned int pos ;
+ char const *prog ;
+} ;
+
+#define SUBGETOPT_ZERO { .ind = 1, .err = 1, .problem = 0, .arg = 0, .pos = 0, .prog = 0 }
+
+extern int subgetopt_r (int, char const *const *, char const *, subgetopt_t_ref) ;
+
+
+ /* non-reentrant */
+
+extern int sgetopt_r (int, char const *const *, char const *, subgetopt_t_ref) ;
+
+extern subgetopt_t subgetopt_here ;
+
+#define subgetopt(argc, argv, opts) subgetopt_r((argc), (argv), (opts), &subgetopt_here)
+#define sgetopt(argc, argv, opts) sgetopt_r((argc), (argv), (opts), &subgetopt_here)
+#define sgetopt_prog() (subgetopt_here.prog = PROG)
+
+/* define SUBGETOPT_SHORT if you don't mind potential name conflicts */
+
+#ifdef SUBGETOPT_SHORT
+# define getopt sgetopt
+# define optarg subgetopt_here.arg
+# define optind subgetopt_here.ind
+# define opterr subgetopt_here.err
+# define optopt subgetopt_here.problem
+# define opteof (-1)
+#endif
+
+#endif
diff --git a/src/include/skalibs/sha1.h b/src/include/skalibs/sha1.h
new file mode 100644
index 0000000..03cdaf0
--- /dev/null
+++ b/src/include/skalibs/sha1.h
@@ -0,0 +1,22 @@
+/* ISC license. */
+
+#ifndef SHA1_H
+#define SHA1_H
+
+#include
+
+typedef struct SHA1Schedule SHA1Schedule, *SHA1Schedule_ref ;
+struct SHA1Schedule
+{
+ uint32 buf[5] ;
+ uint32 bits[2] ;
+ uint32 in[16] ;
+ unsigned int b ;
+} ;
+
+#define SHA1_INIT() { .buf = { 0x67452301UL, 0xefcdab89UL, 0x98badcfeUL, 0x10325476UL, 0xc3d2e1f0UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
+extern void sha1_init (SHA1Schedule_ref) ;
+extern void sha1_update (SHA1Schedule_ref, char const *, unsigned int) ;
+extern void sha1_final (SHA1Schedule_ref, char * /* 20 chars */) ;
+
+#endif
diff --git a/src/include/skalibs/sha256.h b/src/include/skalibs/sha256.h
new file mode 100644
index 0000000..8f28c38
--- /dev/null
+++ b/src/include/skalibs/sha256.h
@@ -0,0 +1,29 @@
+/* ISC license. */
+
+/* SHA256 routines */
+/* Written by David Madore () */
+/* Adapted by Laurent Bercot. */
+/* This version last modified 2010-01-08 */
+
+/* Note: these routines do not depend on endianness. */
+
+#ifndef SHA256_H
+#define SHA256_H
+
+#include
+
+typedef struct SHA256Schedule_s SHA256Schedule, *SHA256Schedule_ref ;
+struct SHA256Schedule_s
+{
+ uint32 buf[8] ; /* The eight chaining variables */
+ uint32 bits[2] ; /* Count number of message bits */
+ uint32 in[16] ; /* Data being fed in */
+ unsigned int b ; /* Our position within the 512 bits (always between 0 and 63) */
+} ;
+
+#define SHA256_INIT() { .buf = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }, .bits = { 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .b = 0 }
+extern void sha256_init (SHA256Schedule_ref) ;
+extern void sha256_update (SHA256Schedule_ref, char const *, unsigned int) ;
+extern void sha256_final (SHA256Schedule_ref, char *digest) ;
+
+#endif
diff --git a/src/include/skalibs/sig.h b/src/include/skalibs/sig.h
new file mode 100644
index 0000000..a463b63
--- /dev/null
+++ b/src/include/skalibs/sig.h
@@ -0,0 +1,61 @@
+/* ISC license. */
+
+#ifndef SIG_H
+#define SIG_H
+
+#include
+#include
+
+extern int sig_alarm gccattr_deprecated ;
+extern int sig_child gccattr_deprecated ;
+extern int sig_stop gccattr_deprecated ;
+extern int sig_cont gccattr_deprecated ;
+extern int sig_hangup gccattr_deprecated ;
+extern int sig_int gccattr_deprecated ;
+extern int sig_kill gccattr_deprecated ;
+extern int sig_pipe gccattr_deprecated ;
+extern int sig_term gccattr_deprecated ;
+extern int sig_usr1 gccattr_deprecated ;
+extern int sig_usr2 gccattr_deprecated ;
+extern int sig_quit gccattr_deprecated ;
+extern int sig_abort gccattr_deprecated ;
+
+
+typedef void skasighandler_t (int) ;
+typedef skasighandler_t *skasighandler_t_ref ;
+
+struct skasigaction
+{
+ skasighandler_t_ref handler ;
+ unsigned int flags : 2 ;
+} ;
+
+#define SKASA_MASKALL 0x01
+#define SKASA_NOCLDSTOP 0x02
+
+extern struct skasigaction const SKASIG_DFL ;
+extern struct skasigaction const SKASIG_IGN ;
+extern int skasigaction (int, struct skasigaction const *, struct skasigaction *) ;
+
+#define sig_catcha(sig, ac) skasigaction(sig, (ac), 0)
+#define sig_restore(sig) skasigaction((sig), &SKASIG_DFL, 0)
+
+extern void sig_restoreto (sigset_t const *, unsigned int) ;
+extern int sig_catch (int, skasighandler_t_ref) ;
+#define sig_ignore(sig) sig_catcha((sig), &SKASIG_IGN)
+#define sig_uncatch(sig) sig_restore(sig)
+
+#define SIGSTACKSIZE 16
+extern int sig_pusha (int, struct skasigaction const *) ;
+extern int sig_pop (int) ;
+extern int sig_push (int, skasighandler_t_ref) ;
+
+extern void sig_block (int) ;
+extern void sig_blockset (sigset_t const *) ;
+extern void sig_unblock (int) ;
+extern void sig_blocknone (void) ;
+extern void sig_pause (void) ;
+extern void sig_shield (void) ;
+extern void sig_unshield (void) ;
+
+#endif
diff --git a/src/include/skalibs/siovec.h b/src/include/skalibs/siovec.h
new file mode 100644
index 0000000..8c8161f
--- /dev/null
+++ b/src/include/skalibs/siovec.h
@@ -0,0 +1,29 @@
+/* ISC license. */
+
+#ifndef SIOVEC_H
+#define SIOVEC_H
+
+#include
+#include
+#include
+
+typedef struct siovec_s siovec_t, *siovec_t_ref ;
+struct siovec_s
+{
+ char *s ;
+ unsigned int len ;
+} ;
+
+extern unsigned int siovec_len (siovec_t const *, unsigned int) gccattr_pure ;
+extern unsigned int siovec_gather (siovec_t const *, unsigned int, char *, unsigned int) ;
+extern unsigned int siovec_scatter (siovec_t const *, unsigned int, char const *, unsigned int) ;
+extern unsigned int siovec_deal (siovec_t const *, unsigned int, siovec_t const *, unsigned int) ;
+extern unsigned int siovec_seek (siovec_t *, unsigned int, unsigned int) ;
+
+extern void siovec_from_iovec (siovec_t *, struct iovec const *, unsigned int) ;
+extern void iovec_from_siovec (struct iovec *, siovec_t const *, unsigned int) ;
+
+extern unsigned int siovec_bytechr (siovec_t const *, unsigned int, char) ;
+extern unsigned int siovec_bytein (siovec_t const *, unsigned int, char const *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/skaclient.h b/src/include/skalibs/skaclient.h
new file mode 100644
index 0000000..a057d50
--- /dev/null
+++ b/src/include/skalibs/skaclient.h
@@ -0,0 +1,115 @@
+/* ISC license. */
+
+#ifndef SKACLIENT_H
+#define SKACLIENT_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+ /* Server part */
+
+extern int skaclient_server_ack (unixmessage_t const *, unixmessage_sender_t *, unixmessage_sender_t *, char const *, unsigned int, char const *, unsigned int) ;
+extern int skaclient_server_bidi_ack (unixmessage_t const *, unixmessage_sender_t *, unixmessage_sender_t *, unixmessage_receiver_t *, char *, unsigned int, char *, unsigned int, char const *, unsigned int, char const *, unsigned int) ;
+extern int skaclient_server_init (unixmessage_receiver_t *, char *, unsigned int, char *, unsigned int, unixmessage_sender_t *, unixmessage_sender_t *, char const *, unsigned int, char const *, unsigned int, tain_t const *, tain_t *) ;
+#define skaclient_server_init_g(in, mainbuf, mainlen, auxbuf, auxlen, out, asyncout, before, beforelen, after, afterlen, deadline) skaclient_server_init(in, mainbuf, mainlen, auxbuf, auxlen, out, asyncout, before, beforelen, after, afterlen, (deadline), &STAMP)
+
+
+ /* Client part: the rest of this file */
+
+#define SKACLIENT_KOLBAK_SIZE 64
+#define SKACLIENT_OPTION_WAITPID 0x00000001U
+
+#define skaclient_buffer_type(bufsn, auxbufsn, bufan, auxbufan, qlen) struct { char bufs[bufsn] ; char auxbufs[auxbufsn] ; char bufa[bufan] ; char auxbufa[auxbufan] ; kolbak_closure_t q[qlen] ; }
+typedef skaclient_buffer_type(UNIXMESSAGE_BUFSIZE, UNIXMESSAGE_AUXBUFSIZE, UNIXMESSAGE_BUFSIZE, UNIXMESSAGE_AUXBUFSIZE, SKACLIENT_KOLBAK_SIZE) skaclient_buffer_t, *skaclient_buffer_t_ref ;
+
+
+ /* Callback data for init */
+
+typedef struct skaclient_cbdata_s skaclient_cbdata_t, *skaclient_cbdata_t_ref ;
+struct skaclient_cbdata_s
+{
+ unixmessage_receiver_t *asyncin ;
+ unixmessage_sender_t *asyncout ;
+ char const *after ;
+ unsigned int afterlen ;
+} ;
+
+
+ /* User structure */
+
+typedef struct skaclient_s skaclient_t, *skaclient_t_ref ;
+struct skaclient_s
+{
+ unixmessage_receiver_t syncin ;
+ unixmessage_sender_t syncout ;
+ kolbak_queue_t kq ;
+ unixmessage_receiver_t asyncin ;
+ unixmessage_sender_t asyncout ;
+ pid_t pid ;
+ uint32 options ;
+} ;
+#define SKACLIENT_ZERO { .syncin = UNIXMESSAGE_RECEIVER_ZERO, .syncout = UNIXMESSAGE_SENDER_ZERO, .kq = KOLBAK_QUEUE_ZERO, .asyncin = UNIXMESSAGE_RECEIVER_ZERO, .asyncout = UNIXMESSAGE_SENDER_ZERO, .pid = 0, .options = 0 }
+extern skaclient_t const skaclient_zero ;
+
+extern void skaclient_end (skaclient_t *) ;
+
+extern int skaclient_start_async (skaclient_t *, char *, unsigned int, char *, unsigned int, char *, unsigned int, char *, unsigned int, kolbak_closure_t *, unsigned int, char const *, char const *, unsigned int, char const *, unsigned int, skaclient_cbdata_t *) ;
+#define skaclient_start_async_b(a, sb, path, before, beforelen, after, afterlen, blah) skaclient_start_async(a, (sb)->bufs, sizeof((sb)->bufs), (sb)->auxbufs, sizeof((sb)->auxbufs), (sb)->bufa, sizeof((sb)->bufa), (sb)->auxbufa, sizeof((sb)->auxbufa), (sb)->q, sizeof((sb)->q), path, before, beforelen, after, afterlen, blah)
+extern int skaclient_startf_async (skaclient_t *, char *, unsigned int, char *, unsigned int, char *, unsigned int, char *, unsigned int, kolbak_closure_t *, unsigned int, char const *, char const *const *, char const *const *, uint32, char const *, unsigned int, char const *, unsigned int, skaclient_cbdata_t *) ;
+#define skaclient_startf_async_b(a, sb, prog, argv, envp, options, before, beforelen, after, afterlen, blah) skaclient_startf_async(a, (sb)->bufs, sizeof((sb)->bufs), (sb)->auxbufs, sizeof((sb)->auxbufs), (sb)->bufa, sizeof((sb)->bufa), (sb)->auxbufa, sizeof((sb)->auxbufa), (sb)->q, sizeof((sb)->q), prog, argv, envp, options, before, beforelen, after, afterlen, blah)
+
+extern int skaclient_start (skaclient_t *, char *, unsigned int, char *, unsigned int, char *, unsigned int, char *, unsigned int, kolbak_closure_t *, unsigned int, char const *, char const *, unsigned int, char const *, unsigned int, tain_t const *, tain_t *) ;
+#define skaclient_start_b(a, sb, path, before, beforelen, after, afterlen, deadline, stamp) skaclient_start((a, (sb)->bufs, sizeof((sb)->bufs), (sb)->auxbufs, sizeof((sb)->auxbufs), (sb)->bufa, sizeof((sb)->bufa), (sb)->auxbufa, sizeof((sb)->auxbufa), (sb)->q, sizeof((sb)->q), path, before, beforelen, after, afterlen, deadline, stamp)
+#define skaclient_start_g(a, bufs, bufsn, auxbufs, auxbufsn, bufa, bufan, auxbufa, auxbufan, q, qlen, path, before, beforelen, after, afterlen, deadline) skaclient_start(a, bufs, bufsn, auxbufs, auxbufsn, bufa, bufan, auxbufa, auxbufan, q, qlen, path, before, beforelen, after, afterlen, (deadline), &STAMP)
+#define skaclient_start_b_g(a, sb, path, before, beforelen, after, afterlen, deadline) skaclient_start_b(a, sb, path, before, beforelen, after, afterlen, (deadline), &STAMP)
+
+extern int skaclient_startf (skaclient_t *, char *, unsigned int, char *, unsigned int, char *, unsigned int, char *, unsigned int, kolbak_closure_t *, unsigned int, char const *, char const *const *, char const *const *, uint32, char const *, unsigned int, char const *, unsigned int, tain_t const *, tain_t *) ;
+#define skaclient_startf_b(a, sb, prog, argv, envp, before, beforelen, after, afterlen, deadline, stamp) skaclient_start((a, (sb)->bufs, sizeof((sb)->bufs), (sb)->auxbufs, sizeof((sb)->auxbufs), (sb)->bufa, sizeof((sb)->bufa), (sb)->auxbufa, sizeof((sb)->auxbufa), (sb)->q, sizeof((sb)->q), prog, argv, envp, before, beforelen, after, afterlen, deadline, stamp)
+#define skaclient_startf_g(a, bufs, bufsn, auxbufs, auxbufsn, bufa, bufan, auxbufa, auxbufan, q, qlen, prog, argv, envp, options, before, beforelen, after, afterlen, deadline) skaclient_startf(a, bufs, bufsn, auxbufs, auxbufsn, bufa, bufan, auxbufa, auxbufan, q, qlen, prog, argv, envp, options, before, beforelen, after, afterlen, (deadline), &STAMP)
+#define skaclient_startf_b_g(a, sb, prog, argv, envp, options, before, beforelen, after, afterlen, deadline) skaclient_startf_b(a, sb, prog, argv, envp, options, before, beforelen, after, afterlen, (deadline), &STAMP)
+
+extern int skaclient_putmsg_and_close (skaclient_t *, unixmessage_t const *, unsigned char const *, unixmessage_handler_func_t *, void *) ;
+#define skaclient_putmsg(a, m, cb, result) skaclient_putmsg_and_close(a, m, unixmessage_bits_closenone, cb, result)
+extern int skaclient_putmsgv_and_close (skaclient_t *, unixmessage_v_t const *, unsigned char const *, unixmessage_handler_func_t *, void *) ;
+#define skaclient_putmsgv(a, m, cb, result) skaclient_putmsgv_and_close(a, m, unixmessage_bits_closenone, cb, result)
+
+extern int skaclient_put (skaclient_t *, char const *, unsigned int, unixmessage_handler_func_t *, void *) ;
+extern int skaclient_putv (skaclient_t *, siovec_t const *, unsigned int, unixmessage_handler_func_t *, void *) ;
+
+extern int skaclient_sendmsg_and_close (skaclient_t *, unixmessage_t const *, unsigned char const *, unixmessage_handler_func_t *, void *, tain_t const *, tain_t *) ;
+#define skaclient_sendmsg_and_close_g(a, m, bits, cb, result, deadline) skaclient_sendmsg_and_close(a, m, bits, cb, result, (deadline), &STAMP)
+#define skaclient_sendmsg(a, m, cb, result, deadline, stamp) skaclient_sendmsg_and_close(a, m, unixmessage_bits_closenone, cb, result, deadline, stamp)
+#define skaclient_sendmsg_g(a, m, cb, result, deadline) skaclient_sendmsg(a, m, cb, result, (deadline), &STAMP)
+
+extern int skaclient_sendmsgv_and_close (skaclient_t *, unixmessage_v_t const *, unsigned char const *, unixmessage_handler_func_t *, void *, tain_t const *, tain_t *) ;
+#define skaclient_sendmsgv_and_close_g(a, m, bits, cb, result, deadline) skaclient_sendmsgv_and_close(a, m, bits, cb, result, (deadline), &STAMP)
+#define skaclient_sendmsgv(a, m, cb, result, deadline, stamp) skaclient_sendmsgv_and_close(a, m, unixmessage_bits_closenone, cb, result, deadline, stamp)
+#define skaclient_sendmsgv_g(a, m, cb, result, deadline) skaclient_sendmsgv(a, m, cb, result, (deadline), &STAMP)
+
+extern int skaclient_send (skaclient_t *, char const *, unsigned int, unixmessage_handler_func_t *, void *, tain_t const *, tain_t *) ;
+#define skaclient_send_g(a, s, len, cb, result, deadline) skaclient_send(a, s, len, cb, result, (deadline), &STAMP)
+extern int skaclient_sendv (skaclient_t *, siovec_t const *, unsigned int, unixmessage_handler_func_t *, void *, tain_t const *, tain_t *) ;
+#define skaclient_sendv_g(a, v, vlen, cb, result, deadline) skaclient_sendv(a, v, vlen, cb, result, (deadline), &STAMP)
+
+#define skaclient_sfd(a) unixmessage_receiver_fd(&(a)->syncin)
+#define skaclient_flush(a) unixmessage_sender_flush(&(a)->syncout)
+#define skaclient_timed_flush(a, deadline, stamp) unixmessage_sender_timed_flush(&(a)->syncout, deadline, stamp)
+#define skaclient_timed_flush_g(a, deadline) skaclient_timed_flush(a, (deadline), &STAMP)
+
+#define skaclient_supdate(a) unixmessage_handle(&(a)->syncin, (unixmessage_handler_func_t *)&kolbak_call, &(a)->kq)
+#define skaclient_timed_supdate(a, deadline, stamp) unixmessage_timed_handle(&(a)->syncin, (unixmessage_handler_func_t *)&kolbak_call, &(a)->kq, deadline, stamp)
+#define skaclient_timed_supdate_g(a, deadline) skaclient_timed_supdate(a, (deadline), &STAMP)
+
+#define skaclient_fd(a) skaclient_afd(a)
+#define skaclient_afd(a) unixmessage_receiver_fd(&(a)->asyncin)
+#define skaclient_update(a, f, p) skaclient_aupdate(a, f, p)
+#define skaclient_aupdate(a, f, p) unixmessage_handle(&(a)->asyncin, f, p)
+
+extern unixmessage_handler_func_t skaclient_default_cb ;
+
+#endif
diff --git a/src/include/skalibs/skalibs.h b/src/include/skalibs/skalibs.h
new file mode 100644
index 0000000..e889461
--- /dev/null
+++ b/src/include/skalibs/skalibs.h
@@ -0,0 +1,19 @@
+/* ISC license. */
+
+#ifndef SKALIBS_H
+#define SKALIBS_H
+
+/*
+ This header includes everything in skalibs,
+ except skalibs/config.h and skalibs/sysdeps.h
+ It's heavy!
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/src/include/skalibs/skamisc.h b/src/include/skalibs/skamisc.h
new file mode 100644
index 0000000..bdc4869
--- /dev/null
+++ b/src/include/skalibs/skamisc.h
@@ -0,0 +1,29 @@
+/* ISC license. */
+
+#ifndef SKAMISC_H
+#define SKAMISC_H
+
+#include
+#include
+
+extern stralloc satmp ;
+
+extern int skagetln (buffer *, stralloc *, char) ;
+extern int skagetlnsep (buffer *, stralloc *, char const *, unsigned int) ;
+extern int getlnmax (buffer *, char *, unsigned int, unsigned int *, char) ;
+extern int getlnmaxsep (buffer *, char *, unsigned int, unsigned int *, char const *, unsigned int) ;
+
+extern int sauniquename (stralloc *) ;
+
+extern int string_quote (stralloc *, char const *, unsigned int) ;
+extern int string_quote_nodelim (stralloc *, char const *, unsigned int) ;
+extern int string_quote_nodelim_mustquote (stralloc *, char const *, unsigned int, char const *, unsigned int) ;
+extern int string_unquote (char *, unsigned int *, char const *, unsigned int, unsigned int *) ;
+extern int string_unquote_nodelim (char *, char const *, unsigned int) ;
+extern int string_unquote_withdelim (char *, unsigned int *, char const *, unsigned int, unsigned int *, char const *, unsigned int) ;
+
+extern int string_format (stralloc *, char const *, char const *, char const *const *) ;
+
+#define skaoffsetof(n, s, field) do { s sofoftmp ; *(n) = (unsigned char *)&sofoftmp->field - (unsigned char *)&sofoftmp ; } while (0)
+
+#endif
diff --git a/src/include/skalibs/socket.h b/src/include/skalibs/socket.h
new file mode 100644
index 0000000..91be2f5
--- /dev/null
+++ b/src/include/skalibs/socket.h
@@ -0,0 +1,122 @@
+/* ISC license. */
+
+#ifndef SOCKET_H
+#define SOCKET_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+typedef int socket_io_func_t (int, char *, unsigned int, char *, uint16 *) ;
+typedef socket_io_func_t *socket_io_func_t_ref ;
+
+
+ /* INET and INET6 domain socket operations */
+
+#define socket_tcp() socket_tcp4()
+#define socket_tcp_b() socket_tcp4_b()
+#define socket_tcp_nb() socket_tcp4_nb()
+#define socket_tcp_coe() socket_tcp4_coe()
+#define socket_tcp_nbcoe() socket_tcp4_nbcoe()
+
+#define socket_tcp4() socket_tcp4_nb()
+#define socket_tcp4_b() socket_tcp4_internal(0)
+#define socket_tcp4_nb() socket_tcp4_internal(DJBUNIX_FLAG_NB)
+#define socket_tcp4_coe() socket_tcp4_internal(DJBUNIX_FLAG_COE)
+#define socket_tcp4_nbcoe() socket_tcp4_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_tcp4_internal (unsigned int) ;
+
+#define socket_tcp6() socket_tcp6_nb()
+#define socket_tcp6_b() socket_tcp6_internal(0)
+#define socket_tcp6_nb() socket_tcp6_internal(DJBUNIX_FLAG_NB)
+#define socket_tcp6_coe() socket_tcp6_internal(DJBUNIX_FLAG_COE)
+#define socket_tcp6_nbcoe() socket_tcp6_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_tcp6_internal (unsigned int) ;
+
+#define socket_udp() socket_udp4()
+#define socket_udp_b() socket_udp4_b()
+#define socket_udp_nb() socket_udp4_nb()
+#define socket_udp_coe() socket_udp4_coe()
+#define socket_udp_nbcoe() socket_udp4_nbcoe()
+
+#define socket_udp4() socket_udp4_nb()
+#define socket_udp4_b() socket_udp4_internal(0)
+#define socket_udp4_nb() socket_udp4_internal(DJBUNIX_FLAG_NB)
+#define socket_udp4_coe() socket_udp4_internal(DJBUNIX_FLAG_COE)
+#define socket_udp4_nbcoe() socket_udp4_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_udp4_internal (unsigned int) ;
+
+#define socket_udp6() socket_udp6_nb()
+#define socket_udp6_b() socket_udp6_internal(0)
+#define socket_udp6_nb() socket_udp6_internal(DJBUNIX_FLAG_NB)
+#define socket_udp6_coe() socket_udp6_internal(DJBUNIX_FLAG_COE)
+#define socket_udp6_nbcoe() socket_udp6_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_udp6_internal (unsigned int) ;
+
+extern int socket_waitconn (int, tain_t const *, tain_t *) ;
+#define socket_waitconn_g(fd, deadline) socket_waitconn(fd, (deadline), &STAMP)
+extern int socket_deadlineconnstamp4 (int, char const *, uint16, tain_t const *, tain_t *) ;
+#define socket_deadlineconnstamp(s, ip, port, deadline, stamp) socket_deadlineconnstamp4(s, ip, port, deadline, stamp)
+#define socket_deadlineconnstamp4_g(fd, ip, port, deadline) socket_deadlineconnstamp4(fd, ip, port, (deadline), &STAMP)
+extern int socket_deadlineconnstamp4_u32 (int, uint32, uint16, tain_t const *, tain_t *) ;
+#define socket_deadlineconnstamp4_u32_g(fd, ip, port, deadline) socket_deadlineconnstamp4_u32(fd, ip, port, (deadline), &STAMP)
+
+extern int socket_timeoutconn (int, char const *, uint16, unsigned int) ;
+extern int socket_connect4 (int, char const *, uint16) ;
+extern int socket_connect4_u32 (int, uint32, uint16) ;
+extern int socket_connected (int) gccattr_const ;
+extern int socket_bind4 (int, char const *, uint16) ;
+extern int socket_bind4_reuse (int, char const *, uint16) ;
+#define socket_listen(fd, b) ipc_listen(fd, b)
+
+extern int socket_connect6 (int, char const *, uint16) ;
+extern int socket_deadlineconnstamp6 (int, char const *, uint16, tain_t const *, tain_t *) ;
+#define socket_deadlineconnstamp6_g(fd, ip6, port, deadline) socket_deadlineconnstamp6(fd, ip6, port, (deadline), &STAMP)
+extern int socket_bind6 (int, char const *, uint16) ;
+extern int socket_bind6_reuse (int, char const *, uint16) ;
+
+#define socket_accept4(s, ip, port) socket_accept4_internal(s, ip, (port), 0)
+#define socket_accept4_nb(s, ip, port) socket_accept4_internal(s, ip, (port), DJBUNIX_FLAG_NB)
+#define socket_accept4_coe(s, ip, port) socket_accept4_internal(s, ip, (port), DJBUNIX_FLAG_COE)
+#define socket_accept4_nbcoe(s, ip, port) socket_accept4_internal(s, ip, (port), DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_accept4_internal (int, char *, uint16 *, unsigned int) ;
+extern socket_io_func_t socket_recv4 ;
+extern int socket_send4 (int, char const *, unsigned int, char const *, uint16) ;
+extern socket_io_func_t socket_ioloop_send4 ;
+extern int socket_local4 (int, char *, uint16 *) ;
+extern int socket_remote4 (int, char *, uint16 *) ;
+
+#define socket_accept6(s, ip6, port) socket_accept6_internal(s, ip6, (port), 0)
+#define socket_accept6_nb(s, ip6, port) socket_accept6_internal(s, ip6, (port), DJBUNIX_FLAG_NB)
+#define socket_accept6_coe(s, ip6, port) socket_accept6_internal(s, ip6, (port), DJBUNIX_FLAG_COE)
+#define socket_accept6_nbcoe(s, ip6, port) socket_accept6_internal(s, ip6, (port), DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int socket_accept6_internal (int, char *, uint16 *, unsigned int) ;
+extern socket_io_func_t socket_recv6 ;
+extern int socket_send6 (int, char const *, unsigned int, char const *, uint16) ;
+extern socket_io_func_t socket_ioloop_send6 ;
+extern int socket_local6 (int, char *, uint16 *) ;
+extern int socket_remote6 (int, char *, uint16 *) ;
+
+extern int socket_ipoptionskill (int) ;
+extern int socket_tcpnodelay (int) ;
+extern void socket_tryreservein (int, unsigned int) ;
+
+
+ /* Timed send and recv operations (for dgram sockets) */
+
+extern int socket_ioloop (int, char *, unsigned int, char *, uint16 *, socket_io_func_t_ref, int, tain_t const *, tain_t *) ;
+
+#define socket_sendnb4(fd, buf, len, ip4, port, deadline, stamp) socket_ioloop(fd, buf, len, (char *)ip4, &(port), &socket_ioloop_send4, 1, deadline, stamp)
+#define socket_sendnb4_g(fd, buf, len, ip4, port, deadline) socket_sendnb4(fd, buf, len, ip4, port, (deadline), &STAMP)
+#define socket_recvnb4(fd, buf, len, ip4, port, deadline, stamp) socket_ioloop(fd, buf, len, ip4, port, &socket_recv4, 0, deadline, stamp)
+#define socket_recvnb4_g(fd, buf, len, ip4, port, deadline) socket_recvnb4(fd, buf, len, ip4, port, (deadline), &STAMP)
+
+#define socket_sendnb6(fd, buf, len, ip6, port, deadline, stamp) socket_ioloop(fd, buf, len, (char *)ip6, &(port), &socket_ioloop_send6, 1, deadline, stamp)
+#define socket_sendnb6_g(fd, buf, len, ip6, port, deadline) socket_sendnb6(fd, buf, len, ip6, port, (deadline), &STAMP)
+#define socket_recvnb6(fd, buf, len, ip6, port, deadline, stamp) socket_ioloop(fd, buf, len, ip6, port, &socket_recv6, 0, deadline, stamp)
+#define socket_recvnb6_g(fd, buf, len, ip6, port, deadline) socket_recvnb6(fd, buf, len, ip6, port, (deadline), &STAMP)
+
+#endif
diff --git a/src/include/skalibs/stdcrypto.h b/src/include/skalibs/stdcrypto.h
new file mode 100644
index 0000000..bd6751b
--- /dev/null
+++ b/src/include/skalibs/stdcrypto.h
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#ifndef STDCRYPTO_H
+#define STDCRYPTO_H
+
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/src/include/skalibs/stddjb.h b/src/include/skalibs/stddjb.h
new file mode 100644
index 0000000..e265003
--- /dev/null
+++ b/src/include/skalibs/stddjb.h
@@ -0,0 +1,60 @@
+/* ISC license. */
+
+#ifndef STDDJB_H
+#define STDDJB_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/src/include/skalibs/stralloc.h b/src/include/skalibs/stralloc.h
new file mode 100644
index 0000000..2d762d4
--- /dev/null
+++ b/src/include/skalibs/stralloc.h
@@ -0,0 +1,40 @@
+/* ISC license. */
+
+#ifndef STRALLOC_H
+#define STRALLOC_H
+
+#include
+#include
+
+typedef struct stralloc_s stralloc, *stralloc_ref ;
+struct stralloc_s
+{
+ char *s ;
+ unsigned int len ;
+ unsigned int a ;
+} ;
+
+#define STRALLOC_ZERO { .s = 0, .len = 0, .a = 0 }
+extern stralloc const stralloc_zero ;
+
+extern int stralloc_ready_tuned (stralloc *, unsigned int, unsigned int, unsigned int, unsigned int) ;
+#define stralloc_ready(sa, n) stralloc_ready_tuned(sa, (n), 8, 1, 8)
+#define stralloc_readyplus(sa, n) stralloc_ready(sa, (sa)->len + (n))
+extern void stralloc_free (stralloc *) ;
+extern int stralloc_shrink (stralloc *) ;
+extern int stralloc_copyb (stralloc *, char const *, unsigned int) ;
+extern int stralloc_catb (stralloc *, char const *, unsigned int) ;
+extern int stralloc_catv (stralloc *, siovec_t const *, unsigned int) ;
+#define stralloc_copys(sa, s) stralloc_copyb(sa, (s), str_len(s))
+#define stralloc_cats(sa, s) stralloc_catb(sa, (s), str_len(s))
+#define stralloc_copy(sa1, sa2) stralloc_copyb(sa1, (sa2)->s, (sa2)->len)
+#define stralloc_cat(sa1, sa2) stralloc_catb(sa1, (sa2)->s, (sa2)->len)
+extern int stralloc_append (stralloc *, char) ;
+extern void stralloc_reverse (stralloc *) ;
+extern void stralloc_reverse_blocks (stralloc *, unsigned int) ;
+#define stralloc_0(sa) stralloc_catb(sa, "", 1)
+extern int stralloc_insertb (stralloc *, unsigned int, char const *, unsigned int) ;
+#define stralloc_inserts(sa, offset, s) stralloc_insertb(sa, offset, (s), str_len(s))
+#define stralloc_insert(sa1, offset, sa2) stralloc_insertb(sa1, offset, (sa2)->s, (sa2)->len)
+
+#endif
diff --git a/src/include/skalibs/strerr.h b/src/include/skalibs/strerr.h
new file mode 100644
index 0000000..64665b5
--- /dev/null
+++ b/src/include/skalibs/strerr.h
@@ -0,0 +1,139 @@
+/* ISC license. */
+
+#ifndef STRERR_H
+#define STRERR_H
+
+#include
+
+extern void strerr_warn (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ;
+extern void strerr_die (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ;
+extern void strerr_warnsys (char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) ;
+extern void strerr_diesys (int, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *, char const *) gccattr_noreturn ;
+
+#define strerr_warn10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se)
+#define strerr_warn9(x1, x2, x3, x4, x5, x6, x7, x8, x9, se) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, 0, se)
+#define strerr_warn8(x1, x2, x3, x4, x5, x6, x7, x8, se) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, 0, 0, se)
+#define strerr_warn7(x1, x2, x3, x4, x5, x6, x7, se) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, 0, 0, 0, se)
+#define strerr_warn6(x1, x2, x3, x4, x5, x6, se) \
+strerr_warn(x1, x2, x3, x4, x5, x6, 0, 0, 0, 0, se)
+#define strerr_warn5(x1, x2, x3, x4, x5, se) \
+strerr_warn(x1, x2, x3, x4, x5, 0, 0, 0, 0, 0, se)
+#define strerr_warn4(x1, x2, x3, x4, se) \
+strerr_warn(x1, x2, x3, x4, 0, 0, 0, 0, 0, 0, se)
+#define strerr_warn3(x1, x2, x3, se) \
+strerr_warn(x1, x2, x3, 0, 0, 0, 0, 0, 0, 0, se)
+#define strerr_warn2(x1, x2, se) \
+strerr_warn(x1, x2, 0, 0, 0, 0, 0, 0, 0, 0, se)
+#define strerr_warn1(x1, se) \
+strerr_warn(x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, se)
+
+#define strerr_warn10sys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \
+strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)
+#define strerr_warn9sys(x1, x2, x3, x4, x5, x6, x7, x8, x9) \
+strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0)
+#define strerr_warn8sys(x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_warnsys(x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0)
+#define strerr_warn7sys(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warnsys(x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0)
+#define strerr_warn6sys(x1, x2, x3, x4, x5, x6) \
+strerr_warnsys(x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0)
+#define strerr_warn5sys(x1, x2, x3, x4, x5) \
+strerr_warnsys(x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0)
+#define strerr_warn4sys(x1, x2, x3, x4) \
+strerr_warnsys(x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0)
+#define strerr_warn3sys(x1, x2, x3) \
+strerr_warnsys(x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0)
+#define strerr_warn2sys(x1, x2) \
+strerr_warnsys(x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_warn1sys(x1) \
+strerr_warnsys((x1), 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+#define strerr_warn10x(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, x9, (x10), 0)
+#define strerr_warn9x(x1, x2, x3, x4, x5, x6, x7, x8, x9) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0, 0)
+#define strerr_warn8x(x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_warn(x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0, 0)
+#define strerr_warn7x(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn(x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0, 0)
+#define strerr_warn6x(x1, x2, x3, x4, x5, x6) \
+strerr_warn(x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0, 0)
+#define strerr_warn5x(x1, x2, x3, x4, x5) \
+strerr_warn(x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0, 0)
+#define strerr_warn4x(x1, x2, x3, x4) \
+strerr_warn(x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0, 0)
+#define strerr_warn3x(x1, x2, x3) \
+strerr_warn(x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_warn2x(x1, x2) \
+strerr_warn(x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_warn1x(x1) \
+strerr_warn((x1), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+#define strerr_die10(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, se) \
+strerr_die(e, x1, x2, x3, x4, x5 , x6, x7, x8, x9, x10, se)
+#define strerr_die9(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, se) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, 0, se)
+#define strerr_die8(e, x1, x2, x3, x4, x5, x6, x7, x8, se) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, 0, 0, se)
+#define strerr_die7(e, x1, x2, x3, x4, x5, x6, x7, se) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, 0, 0, 0, se)
+#define strerr_die6(e, x1, x2, x3, x4, x5, x6, se) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, 0, 0, 0, 0, se)
+#define strerr_die5(e, x1, x2, x3, x4, x5, se) \
+strerr_die(e, x1, x2, x3, x4, x5, 0, 0, 0, 0, 0, se)
+#define strerr_die4(e, x1, x2, x3, x4, se) \
+strerr_die(e, x1, x2, x3, x4, 0, 0, 0, 0, 0, 0, se)
+#define strerr_die3(e, x1, x2, x3, se) \
+strerr_die(e, x1, x2, x3, 0, 0, 0, 0, 0, 0, 0, se)
+#define strerr_die2(e, x1, x2, se) \
+strerr_die(e, x1, x2, 0, 0, 0, 0, 0, 0, 0, 0, se)
+#define strerr_die1(e, x1, se) \
+strerr_die(e, x1, 0, 0, 0, 0, 0, 0, 0, 0, 0, se)
+
+#define strerr_die10sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \
+strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10)
+#define strerr_die9sys(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \
+strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0)
+#define strerr_die8sys(e, x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_diesys(e, x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0)
+#define strerr_die7sys(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_diesys(e, x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0)
+#define strerr_die6sys(e, x1, x2, x3, x4, x5, x6) \
+strerr_diesys(e, x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0)
+#define strerr_die5sys(e, x1, x2, x3, x4, x5) \
+strerr_diesys(e, x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0)
+#define strerr_die4sys(e, x1, x2, x3, x4) \
+strerr_diesys(e, x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0)
+#define strerr_die3sys(e, x1, x2, x3) \
+strerr_diesys(e, x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0)
+#define strerr_die2sys(e, x1, x2) \
+strerr_diesys(e, x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_die1sys(e, x1) \
+strerr_diesys(e, (x1), 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+#define strerr_die10x(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, x9, (x10), 0)
+#define strerr_die9x(e, x1, x2, x3, x4, x5, x6, x7, x8, x9) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, x8, (x9), 0, 0)
+#define strerr_die8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, x7, (x8), 0, 0, 0)
+#define strerr_die7x(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die(e, x1, x2, x3, x4, x5, x6, (x7), 0, 0, 0, 0)
+#define strerr_die6x(e, x1, x2, x3, x4, x5, x6) \
+strerr_die(e, x1, x2, x3, x4, x5, (x6), 0, 0, 0, 0, 0)
+#define strerr_die5x(e, x1, x2, x3, x4, x5) \
+strerr_die(e, x1, x2, x3, x4, (x5), 0, 0, 0, 0, 0, 0)
+#define strerr_die4x(e, x1, x2, x3, x4) \
+strerr_die(e, x1, x2, x3, (x4), 0, 0, 0, 0, 0, 0, 0)
+#define strerr_die3x(e, x1, x2, x3) \
+strerr_die(e, x1, x2, (x3), 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_die2x(e, x1, x2) \
+strerr_die(e, x1, (x2), 0, 0, 0, 0, 0, 0, 0, 0, 0)
+#define strerr_die1x(e, x1) \
+strerr_die(e, (x1), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
+
+#endif
diff --git a/src/include/skalibs/strerr2.h b/src/include/skalibs/strerr2.h
new file mode 100644
index 0000000..fa7cc02
--- /dev/null
+++ b/src/include/skalibs/strerr2.h
@@ -0,0 +1,267 @@
+/* ISC license. */
+
+#ifndef STRERR2_H
+#define STRERR2_H
+
+#include
+
+extern char const *PROG ;
+
+
+#define strerr_warnw1x(x1) \
+strerr_warn3x(PROG, ": warning: ", (x1))
+#define strerr_warnw2x(x1, x2) \
+strerr_warn4x(PROG, ": warning: ", (x1), x2)
+#define strerr_warnw3x(x1, x2, x3) \
+strerr_warn5x(PROG, ": warning: ", (x1), x2, x3)
+#define strerr_warnw4x(x1, x2, x3, x4) \
+strerr_warn6x(PROG, ": warning: ", (x1), x2, x3, x4)
+#define strerr_warnw5x(x1, x2, x3, x4, x5) \
+strerr_warn7x(PROG, ": warning: ", (x1), x2, x3, x4, x5)
+#define strerr_warnw6x(x1, x2, x3, x4, x5, x6) \
+strerr_warn8x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6)
+#define strerr_warnw7x(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn9x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7)
+#define strerr_warnw8x(x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_warn10x(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, x7, x8)
+
+#define strerr_warnw1sys(x1) \
+strerr_warn4sys(PROG, ": warning: ", (x1), ": ")
+#define strerr_warnw2sys(x1, x2) \
+strerr_warn5sys(PROG, ": warning: ", (x1), (x2), ": ")
+#define strerr_warnw3sys(x1, x2, x3) \
+strerr_warn6sys(PROG, ": warning: ", (x1), x2, (x3), ": ")
+#define strerr_warnw4sys(x1, x2, x3, x4) \
+strerr_warn7sys(PROG, ": warning: ", (x1), x2, x3, (x4), ": ")
+#define strerr_warnw5sys(x1, x2, x3, x4, x5) \
+strerr_warn8sys(PROG, ": warning: ", (x1), x2, x3, x4, (x5), ": ")
+#define strerr_warnw6sys(x1, x2, x3, x4, x5, x6) \
+strerr_warn9sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, (x6), ": ")
+#define strerr_warnw7sys(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn10sys(PROG, ": warning: ", (x1), x2, x3, x4, x5, x6, (x7), ": ")
+
+#define strerr_diew1x(e, x1) \
+strerr_die3x(e, PROG, ": warning: ", x1)
+#define strerr_diew2x(e, x1, x2) \
+strerr_die4x(e, PROG, ": warning: ", x1, x2)
+#define strerr_diew3x(e, x1, x2, x3) \
+strerr_die5x(e, PROG, ": warning: ", x1, x2, x3)
+#define strerr_diew4x(e, x1, x2, x3, x4) \
+strerr_die6x(e, PROG, ": warning: ", x1, x2, x3, x4)
+#define strerr_diew5x(e, x1, x2, x3, x4, x5) \
+strerr_die7x(e, PROG, ": warning: ", x1, x2, x3, x4, x5)
+#define strerr_diew6x(e, x1, x2, x3, x4, x5, x6) \
+strerr_die8x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6)
+#define strerr_diew7x(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die9x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7)
+#define strerr_diew8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_die10x(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, x7, x8)
+
+#define strerr_diew1sys(e, x1) \
+strerr_die4sys(e, PROG, ": warning: ", (x1), ": ")
+#define strerr_diew2sys(e, x1, x2) \
+strerr_die5sys(e, PROG, ": warning: ", x1, (x2), ": ")
+#define strerr_diew3sys(e, x1, x2, x3) \
+strerr_die6sys(e, PROG, ": warning: ", x1, x2, (x3), ": ")
+#define strerr_diew4sys(e, x1, x2, x3, x4) \
+strerr_die7sys(e, PROG, ": warning: ", x1, x2, x3, (x4), ": ")
+#define strerr_diew5sys(e, x1, x2, x3, x4, x5) \
+strerr_die8sys(e, PROG, ": warning: ", x1, x2, x3, x4, (x5), ": ")
+#define strerr_diew6sys(e, x1, x2, x3, x4, x5, x6) \
+strerr_die9sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, (x6), ": ")
+#define strerr_diew7sys(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die10sys(e, PROG, ": warning: ", x1, x2, x3, x4, x5, x6, (x7), ": ")
+
+#define strerr_dief1x(e, x1) \
+strerr_die3x(e, PROG, ": fatal: ", x1)
+#define strerr_dief2x(e, x1, x2) \
+strerr_die4x(e, PROG, ": fatal: ", x1, x2)
+#define strerr_dief3x(e, x1, x2, x3) \
+strerr_die5x(e, PROG, ": fatal: ", x1, x2, x3)
+#define strerr_dief4x(e, x1, x2, x3, x4) \
+strerr_die6x(e, PROG, ": fatal: ", x1, x2, x3, x4)
+#define strerr_dief5x(e, x1, x2, x3, x4, x5) \
+strerr_die7x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5)
+#define strerr_dief6x(e, x1, x2, x3, x4, x5, x6) \
+strerr_die8x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6)
+#define strerr_dief7x(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die9x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7)
+#define strerr_dief8x(e, x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_die10x(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, x7, x8)
+
+#define strerr_dief1sys(e, x1) \
+strerr_die4sys(e, PROG, ": fatal: ", (x1), ": ")
+#define strerr_dief2sys(e, x1, x2) \
+strerr_die5sys(e, PROG, ": fatal: ", x1, (x2), ": ")
+#define strerr_dief3sys(e, x1, x2, x3) \
+strerr_die6sys(e, PROG, ": fatal: ", x1, x2, (x3), ": ")
+#define strerr_dief4sys(e, x1, x2, x3, x4) \
+strerr_die7sys(e, PROG, ": fatal: ", x1, x2, x3, (x4), ": ")
+#define strerr_dief5sys(e, x1, x2, x3, x4, x5) \
+strerr_die8sys(e, PROG, ": fatal: ", x1, x2, x3, x4, (x5), ": ")
+#define strerr_dief6sys(e, x1, x2, x3, x4, x5, x6) \
+strerr_die9sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, (x6), ": ")
+#define strerr_dief7sys(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die10sys(e, PROG, ": fatal: ", x1, x2, x3, x4, x5, x6, (x7), ": ")
+
+#define strerr_diefu1x(e, x1) \
+strerr_die4x(e, PROG, ": fatal: ", "unable to ", x1)
+#define strerr_diefu2x(e, x1, x2) \
+strerr_die5x(e, PROG, ": fatal: ", "unable to ", x1, x2)
+#define strerr_diefu3x(e, x1, x2, x3) \
+strerr_die6x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3)
+#define strerr_diefu4x(e, x1, x2, x3, x4) \
+strerr_die7x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4)
+#define strerr_diefu5x(e, x1, x2, x3, x4, x5) \
+strerr_die8x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5)
+#define strerr_diefu6x(e, x1, x2, x3, x4, x5, x6) \
+strerr_die9x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6)
+#define strerr_diefu7x(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die10x(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, x6, x7)
+
+#define strerr_diefu1sys(e, x1) \
+strerr_die5sys(e, PROG, ": fatal: ", "unable to ", (x1), ": ")
+#define strerr_diefu2sys(e, x1, x2) \
+strerr_die6sys(e, PROG, ": fatal: ", "unable to ", x1, (x2), ": ")
+#define strerr_diefu3sys(e, x1, x2, x3) \
+strerr_die7sys(e, PROG, ": fatal: ", "unable to ", x1, x2, (x3), ": ")
+#define strerr_diefu4sys(e, x1, x2, x3, x4) \
+strerr_die8sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, (x4), ": ")
+#define strerr_diefu5sys(e, x1, x2, x3, x4, x5) \
+strerr_die9sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, (x5), ": ")
+#define strerr_diefu6sys(e, x1, x2, x3, x4, x5, x6) \
+strerr_die10sys(e, PROG, ": fatal: ", "unable to ", x1, x2, x3, x4, x5, (x6), ": ")
+
+#define strerr_warnwu1x(x1) \
+strerr_warn4x(PROG, ": warning: ", "unable to ", (x1))
+#define strerr_warnwu2x(x1, x2) \
+strerr_warn5x(PROG, ": warning: ", "unable to ", (x1), x2)
+#define strerr_warnwu3x(x1, x2, x3) \
+strerr_warn6x(PROG, ": warning: ", "unable to ", (x1), x2, x3)
+#define strerr_warnwu4x(x1, x2, x3, x4) \
+strerr_warn7x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4)
+#define strerr_warnwu5x(x1, x2, x3, x4, x5) \
+strerr_warn8x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5)
+#define strerr_warnwu6x(x1, x2, x3, x4, x5, x6) \
+strerr_warn9x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6)
+#define strerr_warnwu7x(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn10x(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, x6, x7)
+
+#define strerr_warnwu1sys(x1) \
+strerr_warn5sys(PROG, ": warning: ", "unable to ", (x1), ": ")
+#define strerr_warnwu2sys(x1, x2) \
+strerr_warn6sys(PROG, ": warning: ", "unable to ", (x1), (x2), ": ")
+#define strerr_warnwu3sys(x1, x2, x3) \
+strerr_warn7sys(PROG, ": warning: ", "unable to ", (x1), x2, (x3), ": ")
+#define strerr_warnwu4sys(x1, x2, x3, x4) \
+strerr_warn8sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, (x4), ": ")
+#define strerr_warnwu5sys(x1, x2, x3, x4, x5) \
+strerr_warn9sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, (x5), ": ")
+#define strerr_warnwu6sys(x1, x2, x3, x4, x5, x6) \
+strerr_warn10sys(PROG, ": warning: ", "unable to ", (x1), x2, x3, x4, x5, (x6), ": ")
+
+#define strerr_diewu1x(e, x1) \
+strerr_die4x(e, PROG, ": warning: ", "unable to ", x1)
+#define strerr_diewu2x(e, x1, x2) \
+strerr_die5x(e, PROG, ": warning: ", "unable to ", x1, x2)
+#define strerr_diewu3x(e, x1, x2, x3) \
+strerr_die6x(e, PROG, ": warning: ", "unable to ", x1, x2, x3)
+#define strerr_diewu4x(e, x1, x2, x3, x4) \
+strerr_die7x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4)
+#define strerr_diewu5x(e, x1, x2, x3, x4, x5) \
+strerr_die8x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5)
+#define strerr_diewu6x(e, x1, x2, x3, x4, x5, x6) \
+strerr_die9x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6)
+#define strerr_diewu7x(e, x1, x2, x3, x4, x5, x6, x7) \
+strerr_die10x(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, x6, x7)
+
+#define strerr_diewu1sys(e, x1) \
+strerr_die5sys(e, PROG, ": warning: ", "unable to ", (x1), ": ")
+#define strerr_diewu2sys(e, x1, x2) \
+strerr_die6sys(e, PROG, ": warning: ", "unable to ", x1, (x2), ": ")
+#define strerr_diewu3sys(e, x1, x2, x3) \
+strerr_die7sys(e, PROG, ": warning: ", "unable to ", x1, x2, (x3), ": ")
+#define strerr_diewu4sys(e, x1, x2, x3, x4) \
+strerr_die8sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, (x4), ": ")
+#define strerr_diewu5sys(e, x1, x2, x3, x4, x5) \
+strerr_die9sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, (x5), ": ")
+#define strerr_diewu6sys(e, x1, x2, x3, x4, x5, x6) \
+strerr_die10sys(e, PROG, ": warning: ", "unable to ", x1, x2, x3, x4, x5, (x6), ": ")
+
+#define strerr_dieusage(e, u) \
+strerr_die3x(e, PROG, ": usage: ", u)
+
+#define strerr_dienotset(e, x) \
+strerr_dief2x(e, (x), " not set")
+
+#define strerr_dieinvalid(e, x) \
+strerr_dief2x(e, "invalid $", x)
+
+#define strerr_dieexec(e, x) \
+strerr_diefu2sys(e, "exec ", x)
+
+#define strerr_warni1x(x1) \
+strerr_warn3x(PROG, ": info: ", (x1))
+#define strerr_warni2x(x1, x2) \
+strerr_warn4x(PROG, ": info: ", (x1), x2)
+#define strerr_warni3x(x1, x2, x3) \
+strerr_warn5x(PROG, ": info: ", (x1), x2, x3)
+#define strerr_warni4x(x1, x2, x3, x4) \
+strerr_warn6x(PROG, ": info: ", (x1), x2, x3, x4)
+#define strerr_warni5x(x1, x2, x3, x4, x5) \
+strerr_warn7x(PROG, ": info: ", (x1), x2, x3, x4, x5)
+#define strerr_warni6x(x1, x2, x3, x4, x5, x6) \
+strerr_warn8x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6)
+#define strerr_warni7x(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn9x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7)
+#define strerr_warni8x(x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_warn10x(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, x7, x8)
+
+#define strerr_warni1sys(x1) \
+strerr_warn4sys(PROG, ": info: ", (x1), ": ")
+#define strerr_warni2sys(x1, x2) \
+strerr_warn5sys(PROG, ": info: ", (x1), (x2), ": ")
+#define strerr_warni3sys(x1, x2, x3) \
+strerr_warn6sys(PROG, ": info: ", (x1), x2, (x3), ": ")
+#define strerr_warni4sys(x1, x2, x3, x4) \
+strerr_warn7sys(PROG, ": info: ", (x1), x2, x3, (x4), ": ")
+#define strerr_warni5sys(x1, x2, x3, x4, x5) \
+strerr_warn8sys(PROG, ": info: ", (x1), x2, x3, x4, (x5), ": ")
+#define strerr_warni6sys(x1, x2, x3, x4, x5, x6) \
+strerr_warn9sys(PROG, ": info: ", (x1), x2, x3, x4, x5, (x6), ": ")
+#define strerr_warni7sys(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn10sys(PROG, ": info: ", (x1), x2, x3, x4, x5, x6, (x7), ": ")
+
+#define strerr_warnt1x(x1) \
+strerr_warn3x(PROG, ": tracing: ", (x1))
+#define strerr_warnt2x(x1, x2) \
+strerr_warn4x(PROG, ": tracing: ", (x1), x2)
+#define strerr_warnt3x(x1, x2, x3) \
+strerr_warn5x(PROG, ": tracing: ", (x1), x2, x3)
+#define strerr_warnt4x(x1, x2, x3, x4) \
+strerr_warn6x(PROG, ": tracing: ", (x1), x2, x3, x4)
+#define strerr_warnt5x(x1, x2, x3, x4, x5) \
+strerr_warn7x(PROG, ": tracing: ", (x1), x2, x3, x4, x5)
+#define strerr_warnt6x(x1, x2, x3, x4, x5, x6) \
+strerr_warn8x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6)
+#define strerr_warnt7x(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn9x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7)
+#define strerr_warnt8x(x1, x2, x3, x4, x5, x6, x7, x8) \
+strerr_warn10x(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, x7, x8)
+
+#define strerr_warnt1sys(x1) \
+strerr_warn4sys(PROG, ": tracing: ", (x1), ": ")
+#define strerr_warnt2sys(x1, x2) \
+strerr_warn5sys(PROG, ": tracing: ", (x1), (x2), ": ")
+#define strerr_warnt3sys(x1, x2, x3) \
+strerr_warn6sys(PROG, ": tracing: ", (x1), x2, (x3), ": ")
+#define strerr_warnt4sys(x1, x2, x3, x4) \
+strerr_warn7sys(PROG, ": tracing: ", (x1), x2, x3, (x4), ": ")
+#define strerr_warnt5sys(x1, x2, x3, x4, x5) \
+strerr_warn8sys(PROG, ": tracing: ", (x1), x2, x3, x4, (x5), ": ")
+#define strerr_warnt6sys(x1, x2, x3, x4, x5, x6) \
+strerr_warn9sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, (x6), ": ")
+#define strerr_warnt7sys(x1, x2, x3, x4, x5, x6, x7) \
+strerr_warn10sys(PROG, ": tracing: ", (x1), x2, x3, x4, x5, x6, (x7), ": ")
+
+#endif
diff --git a/src/include/skalibs/surf.h b/src/include/skalibs/surf.h
new file mode 100644
index 0000000..6422903
--- /dev/null
+++ b/src/include/skalibs/surf.h
@@ -0,0 +1,29 @@
+/* ISC license. */
+
+#ifndef SKALIBS_SURF_H
+#define SKALIBS_SURF_H
+
+#include
+
+typedef struct SURFSchedule SURFSchedule, *SURFSchedule_ref, **SURFSchedule_ref_ref ;
+struct SURFSchedule
+{
+ uint32 seed[32] ;
+ uint32 in[12] ;
+ char out[32] ;
+ unsigned int pos ;
+} ;
+
+#define SURFSCHEDULE_ZERO { .seed = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .in = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, .out = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", .pos = 32 }
+
+extern void surf_sinit (SURFSchedule_ref, char const *) ; /* 160 chars */
+extern void surf (SURFSchedule_ref, char *, unsigned int) ;
+
+
+ /* The following functions need libstdcrypto.a */
+
+extern void surf_makeseed (char *) ; /* fills 160 chars */
+extern void surf_init (SURFSchedule_ref) ;
+extern void surf_autoinit (SURFSchedule_ref, char *, unsigned int) ;
+
+#endif
diff --git a/src/include/skalibs/tai.h b/src/include/skalibs/tai.h
new file mode 100644
index 0000000..cce5670
--- /dev/null
+++ b/src/include/skalibs/tai.h
@@ -0,0 +1,140 @@
+/* ISC license. */
+
+#ifndef TAI_H
+#define TAI_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+typedef struct tai_s tai_t, *tai_t_ref ;
+struct tai_s
+{
+ uint64 x ;
+} ;
+
+
+#define TAI_ZERO { .x = 0 }
+#define TAI_MAGIC ((uint64)4611686018427387904ULL)
+#define TAI_EPOCH { .x = TAI_MAGIC + 10UL }
+#define TAI_INFINITE_RELATIVE { .x = ((uint64)1 << 60) }
+#define TAI_INFINITE { .x = TAI_MAGIC + ((uint64)1 << 61) }
+
+#define tai_sec(t) ((t)->x)
+#define tai_u64(t, u) ((void)((t)->x = (u)))
+#define tai_unix(t, u) tai_u64(t, (TAI_MAGIC + (u)))
+#define tai_uint(t, u) tai_u64(t, (uint64)(u))
+
+extern int tai_relative_from_timeval (tai_t *, struct timeval const *) ;
+extern int tai_from_timeval (tai_t *, struct timeval const *) ;
+extern int timeval_from_tai_relative (struct timeval *, tai_t const *) ;
+extern int timeval_from_tai (struct timeval *, tai_t const *) ;
+
+extern int tai_relative_from_timespec (tai_t *, struct timespec const *) ;
+extern int tai_from_timespec (tai_t *, struct timespec const *) ;
+extern int timespec_from_tai_relative (struct timespec *, tai_t const *) ;
+extern int timespec_from_tai (struct timespec *, tai_t const *) ;
+
+extern int tai_now (tai_t *) ;
+extern int tai_from_sysclock (tai_t *, uint64) ;
+extern int sysclock_from_tai (uint64 *, tai_t const *) ;
+
+#define tai_approx(t) ((double)(tai_sec(t)))
+
+extern void tai_add (tai_t *, tai_t const *, tai_t const *) ;
+extern void tai_sub (tai_t *, tai_t const *, tai_t const *) ;
+#define tai_less(t,u) (tai_sec(t) < tai_sec(u))
+
+#define TAI_PACK 8
+extern void tai_pack (char *, tai_t const *) ;
+extern void tai_unpack (char const *, tai_t *) ;
+extern void tai_pack_little (char *, tai_t const *) ;
+extern void tai_unpack_little (char const *, tai_t *) ;
+
+typedef struct tain_s tain_t, *tain_t_ref ;
+struct tain_s
+{
+ tai_t sec ;
+ uint32 nano ; /* 0..999999999U */
+} ;
+
+#define TAIN_ZERO { .sec = TAI_ZERO, .nano = 0 }
+#define TAIN_EPOCH { .sec = TAI_EPOCH, .nano = 0 }
+#define TAIN_INFINITE { .sec = TAI_INFINITE, .nano = 0 }
+#define TAIN_INFINITE_RELATIVE { .sec = TAI_INFINITE_RELATIVE, .nano = 0 }
+#define TAIN_NANO500 { .sec = TAI_ZERO, .nano = 500 }
+
+extern tain_t STAMP ; /* the global process wallclock */
+extern tain_t const tain_infinite_relative ;
+extern tain_t const tain_nano500 ;
+
+#define tain_sec(a) ((a)->sec)
+#define tain_secp(a) (&(a)->sec)
+#define tain_nano(a) ((a)->nano)
+
+extern int tain_relative_from_timeval (tain_t *, struct timeval const *) ;
+extern int tain_from_timeval (tain_t *, struct timeval const *) ;
+extern int timeval_from_tain_relative (struct timeval *, tain_t const *) ;
+extern int timeval_from_tain (struct timeval *, tain_t const *) ;
+
+extern int tain_relative_from_timespec (tain_t *, struct timespec const *) ;
+extern int tain_from_timespec (tain_t *, struct timespec const *) ;
+extern int timespec_from_tain_relative (struct timespec *, tain_t const *) ;
+extern int timespec_from_tain (struct timespec *, tain_t const *) ;
+
+extern int sysclock_get (tain_t *) ;
+extern int tain_sysclock (tain_t *) ;
+#define tain_sysclock_g() tain_sysclock(&STAMP)
+extern int tain_clockmon_init (tain_t *) ;
+extern int tain_clockmon (tain_t *, tain_t const *) ;
+#define tain_clockmon_g(offset) tain_clockmon(&STAMP, (offset))
+extern int tain_init (void) ;
+extern int tain_now (tain_t *) ;
+#define tain_now_g() tain_now(&STAMP)
+#define tain_copynow(t) (*(t) = STAMP)
+
+extern int sysclock_set (tain_t const *) ;
+extern int tain_setnow (tain_t const *) ;
+
+extern double tain_approx (tain_t const *) gccattr_pure ;
+extern double tain_frac (tain_t const *) gccattr_pure ;
+
+extern int tain_from_millisecs (tain_t *, int) ;
+extern int tain_to_millisecs (tain_t const *) gccattr_pure ;
+
+extern void tain_add (tain_t *, tain_t const *, tain_t const *) ;
+#define tain_add_g(deadline, tto) tain_add(deadline, &STAMP, tto)
+extern void tain_addsec (tain_t *, tain_t const *, int) ;
+#define tain_addsec_g(deadline, n) tain_addsec(deadline, &STAMP, n)
+extern void tain_sub (tain_t *, tain_t const *, tain_t const *) ;
+extern void tain_half (tain_t *, tain_t const *) ;
+extern int tain_less (tain_t const *, tain_t const *) gccattr_pure ;
+#define tain_future(deadline) tain_less(&STAMP, (deadline))
+
+#define TAIN_PACK 12
+extern void tain_pack (char *, tain_t const *) ;
+extern void tain_unpack (char const *, tain_t *) ;
+extern void tain_pack_little (char *, tain_t const *) ;
+extern void tain_unpack_little (char const *, tain_t *) ;
+
+#define TAIN_FMT 25
+extern unsigned int tain_fmt (char *, tain_t const *) ;
+extern unsigned int tain_scan (char const *, tain_t *) ;
+
+#define TAIN_FMTFRAC 19
+extern unsigned int tain_fmtfrac (char *, tain_t const *) ;
+
+#define tain_uint(a, u) tain_ulong(a, u)
+extern void tain_ulong (tain_t *, unsigned long) ;
+
+#define TIMESTAMP (1 + (TAIN_PACK << 1))
+extern unsigned int timestamp_fmt (char *, tain_t const *) ;
+extern unsigned int timestamp_scan (char const *, tain_t *) ;
+extern int timestamp_r (char *, tain_t *) ;
+extern int timestamp (char *) ;
+#define timestamp_g(s) timestamp_fmt((s), &STAMP)
+
+#endif
diff --git a/src/include/skalibs/unirandom.h b/src/include/skalibs/unirandom.h
new file mode 100644
index 0000000..fc87886
--- /dev/null
+++ b/src/include/skalibs/unirandom.h
@@ -0,0 +1,57 @@
+/* ISC license. */
+
+#ifndef UNIRANDOM_H
+#define UNIRANDOM_H
+
+#include
+#include
+
+#define RANDOMBUF_BUFSIZE 257
+
+struct randombuf_s
+{
+ char buf[RANDOMBUF_BUFSIZE] ;
+ buffer b ;
+ unsigned int nb : 1 ;
+} ;
+#define RANDOMBUF_ZERO { .buf = "", .b = BUFFER_INIT(0, -1, 0, 0), .nb = 0 }
+
+struct randomegd_s
+{
+ int fd ;
+} ;
+
+union unirandominfo
+{
+ SURFSchedule surf_ctx ;
+ struct randombuf_s device ;
+ struct randomegd_s egd ;
+} ;
+
+#define UNIRANDOMINFO_ZERO { .surf_ctx = SURFSCHEDULE_ZERO }
+
+typedef struct unirandom unirandom, *unirandom_ref, **unirandom_ref_ref ;
+struct unirandom
+{
+ unsigned int (*readb) (union unirandominfo *, char *, unsigned int) ;
+ unsigned int (*readnb) (union unirandominfo *, char *, unsigned int) ;
+ int (*init) (union unirandominfo *) ;
+ int (*finish) (union unirandominfo *) ;
+ union unirandominfo data ;
+ unsigned int initted : 1 ;
+} ;
+
+#define UNIRANDOM_ZERO { .readb = 0, .readnb = 0, .init = 0, .finish = 0, .data = UNIRANDOMINFO_ZERO, .initted = 0 }
+
+extern int unirandom_register_devrandom (unirandom_ref) ;
+extern int unirandom_register_devurandom (unirandom_ref) ;
+extern int unirandom_register_hasegd (unirandom_ref) ;
+extern int unirandom_register_surf (unirandom_ref) ;
+
+extern int unirandom_init (unirandom_ref) ;
+extern unsigned int unirandom_readb (unirandom_ref, char *, unsigned int) ;
+extern unsigned int unirandom_readnb (unirandom_ref, char *, unsigned int) ;
+extern int unirandom_finish (unirandom_ref) ;
+
+
+#endif
diff --git a/src/include/skalibs/unirandomdev.h b/src/include/skalibs/unirandomdev.h
new file mode 100644
index 0000000..589a1c1
--- /dev/null
+++ b/src/include/skalibs/unirandomdev.h
@@ -0,0 +1,19 @@
+/* ISC license. */
+
+#ifndef UNIRANDOMDEV_H
+#define UNIRANDOMDEV_H
+
+#include
+
+extern int unirandomdev_sinit (union unirandominfo *, char const *) ;
+extern unsigned int unirandomdev_readb (union unirandominfo *, char *, unsigned int) ;
+extern unsigned int unirandomdev_readnb (union unirandominfo *, char *, unsigned int) ;
+extern int unirandomdev_finish (union unirandominfo *) ;
+
+extern int unidevrandom_init (union unirandominfo *) ;
+extern int unidevurandom_init (union unirandominfo *) ;
+
+#define UNIRANDOM_REGISTER_DEVRANDOM() { .readb = &unirandomdev_readb, .readnb = &unirandomdev_readnb, .init = &unidevrandom_init, .finish = &unirandomdev_finish, .data = UNIRANDOMINFO_ZERO, .initted = 0 }
+#define UNIRANDOM_REGISTER_DEVURANDOM() { .readb = &unirandomdev_readb, .readnb = &unirandomdev_readnb, .init = &unidevurandom_init, .finish = &unirandomdev_finish, .data = UNIRANDOMINFO_ZERO, .initted = 0 }
+
+#endif
diff --git a/src/include/skalibs/unirandomegd.h b/src/include/skalibs/unirandomegd.h
new file mode 100644
index 0000000..11bb464
--- /dev/null
+++ b/src/include/skalibs/unirandomegd.h
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+#ifndef UNIRANDOMEGD_H
+#define UNIRANDOMEGD_H
+
+#include
+
+extern int unirandomegd_sinit (union unirandominfo *, char const *) ;
+extern unsigned int unirandomegd_readb (union unirandominfo *, char *, unsigned int) ;
+extern unsigned int unirandomegd_readnb (union unirandominfo *, char *, unsigned int) ;
+extern int unirandomegd_finish (union unirandominfo *) ;
+
+extern int unihasegd_init (union unirandominfo *) ;
+
+#define UNIRANDOM_REGISTER_HASEGD() { .readb = &unirandomegd_readb, .readnb = &unirandomegd_readnb, .init = &unihasegd_init, .finish = &unirandomegd_finish, .data = UNIRANDOMINFO_ZERO, .initted = 0 }
+
+#endif
diff --git a/src/include/skalibs/unisurf.h b/src/include/skalibs/unisurf.h
new file mode 100644
index 0000000..5c95c82
--- /dev/null
+++ b/src/include/skalibs/unisurf.h
@@ -0,0 +1,16 @@
+/* ISC license. */
+
+#ifndef UNISURF_H
+#define UNISURF_H
+
+#include
+
+extern int unisurf_sinit (union unirandominfo *, char const *) ;
+extern unsigned int unisurf_read (union unirandominfo *, char *, unsigned int) ;
+extern int unisurf_finish (union unirandominfo *) ;
+
+extern int unisurf_init (union unirandominfo *) ;
+
+#define UNIRANDOM_REGISTER_SURF() { .readb = &unisurf_read, .readnb = &unisurf_read, .init = &unisurf_init, .finish = &unisurf_finish, .data = UNIRANDOMINFO_ZERO, .initted = 0 }
+
+#endif
diff --git a/src/include/skalibs/unix-timed.h b/src/include/skalibs/unix-timed.h
new file mode 100644
index 0000000..f5a25b6
--- /dev/null
+++ b/src/include/skalibs/unix-timed.h
@@ -0,0 +1,36 @@
+/* ISC license. */
+
+#ifndef UNIX_TIMED_H
+#define UNIX_TIMED_H
+
+#include
+#include
+#include
+#include
+#include
+
+ /* Timed "blocking" operations (the fd must still be non-blocking) */
+
+
+extern int timed_flush (void *, initfunc_t_ref, initfunc_t_ref, initfunc_t_ref, tain_t const *, tain_t *) ;
+#define timed_flush_g(b, getfd, isnonempty, flush, deadline) timed_flush(b, getfd, isnonempty, flush, (deadline_), &STAMP)
+extern int timed_get (void *, initfunc_t_ref, initfunc_t_ref, tain_t const *, tain_t *) ;
+#define timed_get_g (b, getfd, get, deadline) timed_get(b, getfd, get, (deadline), &STAMP)
+
+extern int buffer_timed_fill (buffer *, tain_t const *, tain_t *) ;
+#define buffer_timed_fill_g(b, deadline) buffer_timed_fill(b, (deadline), &STAMP)
+extern int bufalloc_timed_flush (bufalloc *, tain_t const *, tain_t *) ;
+#define bufalloc_timed_flush_g(ba, deadline) bufalloc_timed_flush(ba, (deadline), &STAMP)
+extern int buffer_timed_flush (buffer *, tain_t const *, tain_t *) ;
+#define buffer_timed_flush_g(b, deadline) buffer_timed_flush(b, (deadline), &STAMP)
+extern unsigned int buffer_timed_get (buffer *, char *, unsigned int, tain_t const *, tain_t *) ;
+#define buffer_timed_get_g(b, buf, buflen, deadline) buffer_timed_get(b, buf, buflen, (deadline), &STAMP)
+
+extern int timed_getln (buffer_ref, stralloc *, char, tain_t const *, tain_t *) ;
+#define timed_getln_g(b, sa, sep, deadline) timed_getln(b, sa, sep, (deadline), &STAMP)
+extern int timed_getlnmax (buffer_ref, char *, unsigned int, unsigned int *, char, tain_t const *, tain_t *) ;
+#define timed_getlnmax_g(b, max, maxlen, len, sep, deadline) timed_getlnmax(b, max, maxlen, len, sep, (deadline), &STAMP)
+extern int netstring_timed_get (buffer *, stralloc *, tain_t const *, tain_t *) ;
+#define netstring_timed_get_g(b, sa, deadline) netstring_timed_get(b, sa, (deadline), &STAMP)
+
+#endif
diff --git a/src/include/skalibs/unix-transactional.h b/src/include/skalibs/unix-transactional.h
new file mode 100644
index 0000000..e1545e0
--- /dev/null
+++ b/src/include/skalibs/unix-transactional.h
@@ -0,0 +1,59 @@
+/* ISC license. */
+
+#ifndef UNIX_TRANSACTIONAL_H
+#define UNIX_TRANSACTIONAL_H
+
+#include
+#include
+
+ /* Transactional/reliable filesystem operations */
+
+extern int open2_at (int, char const *, int) ;
+extern int open3_at (int, char const *, int, unsigned int) ;
+
+extern int opengetlnclose (char const *, stralloc *, int) ;
+
+extern int open_readat (int, char const *) ;
+extern int open_readatb (int, char const *) ;
+extern int open_writeat (int, char const *) ;
+extern int open_writeatb (int, char const *) ;
+extern int open_truncat (int, char const *) ;
+extern int open_truncatb (int, char const *) ;
+extern int open_appendat (int, char const *) ;
+extern int open_appendatb (int, char const *) ;
+
+extern unsigned int openreadnclose_at (int, char const *, char *, unsigned int) ;
+extern int openslurpclose_at (int, char const *, stralloc *) ;
+extern int opengetlnclose_at (int, char const *, stralloc *, int) ;
+
+extern int openwritenclose (char const *, char const *, unsigned int) ;
+extern int openwritenclose_devino (char const *, char const *, unsigned int, uint64 *, uint64 *) ;
+extern int openwritenclose_tmp (char const *, char const *, unsigned int, stralloc *) ;
+extern int openwritenclose_devino_tmp (char const *, char const *, unsigned int, uint64 *, uint64 *, stralloc *) ;
+extern unsigned int openwritenclose_at (int, char const *, char const *, unsigned int) ;
+
+extern int mkdir_unique (stralloc *, char const *, unsigned int) ;
+
+typedef struct dirdescriptor_s dirdescriptor_t, *dirdescriptor_t_ref ;
+struct dirdescriptor_s
+{
+ int fd ;
+ char const *lnkfn ;
+ stralloc new ;
+} ;
+
+#define DIRDESCRIPTOR_ZERO { .fd = 0, .lnkfn = 0, .new = STRALLOC_ZERO }
+
+extern int dd_open_read (dirdescriptor_t_ref, char const *) ;
+extern int dd_open_write (dirdescriptor_t_ref, char const *, unsigned int) ;
+extern int dd_close (dirdescriptor_t_ref) ; /* after dd_open_read */
+extern void dd_cancel (dirdescriptor_t_ref) ; /* after dd_open_write */
+extern int dd_commit (dirdescriptor_t_ref) ; /* after dd_open_write */
+extern int dd_commit_devino (dirdescriptor_t_ref, uint64 *, uint64 *) ; /* after dd_open_write */
+
+#define dd_openreadnclose(blah, file, s, len) openreadnclose_at((blah)->fd, file, s, len)
+#define dd_openslurpclose(blah, file, sa) openslurpclose_at((blah)->fd, file, sa)
+#define dd_opengetlnclose(blah, file, sa, sep) opengetlnclose_at((blah)->fd, file, sa, sep)
+#define dd_openwritenclose(blah, file, s, len) openwritenclose_at((blah)->fd, file, s, len)
+
+#endif
diff --git a/src/include/skalibs/unixmessage.h b/src/include/skalibs/unixmessage.h
new file mode 100644
index 0000000..69d6717
--- /dev/null
+++ b/src/include/skalibs/unixmessage.h
@@ -0,0 +1,103 @@
+/* ISC license. */
+
+#ifndef UNIXMESSAGE_H
+#define UNIXMESSAGE_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+typedef struct unixmessage_s unixmessage_t, *unixmessage_t_ref ;
+struct unixmessage_s
+{
+ char *s ;
+ unsigned int len ;
+ int *fds ;
+ unsigned int nfds ;
+} ;
+#define UNIXMESSAGE_ZERO { .s = 0, .len = 0, .fds = 0, .nfds = 0 }
+extern unixmessage_t const unixmessage_zero ;
+
+typedef struct unixmessage_v_s unixmessage_v_t, *unixmessage_v_t_ref ;
+struct unixmessage_v_s
+{
+ siovec_t *v ;
+ unsigned int vlen ;
+ int *fds ;
+ unsigned int nfds ;
+} ;
+#define UNIXMESSAGE_V_ZERO { .v = 0, .vlen = 0, .fds = 0, .nfds = 0 }
+extern unixmessage_v_t const unixmessage_v_zero ;
+
+
+#define UNIXMESSAGE_BUFSIZE 2049
+#define UNIXMESSAGE_AUXBUFSIZE 2049
+#define UNIXMESSAGE_MAXFDS 256
+#define UNIXMESSAGE_MAXREADS 32
+
+typedef struct unixmessage_sender_s unixmessage_sender_t, *unixmessage_sender_t_ref ;
+struct unixmessage_sender_s
+{
+ int fd ;
+ stralloc data ;
+ genalloc fds ; /* int */
+ genalloc offsets ; /* diuint */
+ unsigned int head ;
+} ;
+#define UNIXMESSAGE_SENDER_ZERO UNIXMESSAGE_SENDER_INIT(-1)
+#define UNIXMESSAGE_SENDER_INIT(s) { .fd = (s), .data = STRALLOC_ZERO, .fds = GENALLOC_ZERO, .offsets = GENALLOC_ZERO, .head = 0 }
+
+extern unixmessage_sender_t const unixmessage_sender_zero ;
+extern void unixmessage_sender_init (unixmessage_sender_t *, int) ;
+extern void unixmessage_sender_free (unixmessage_sender_t *) ;
+#define unixmessage_sender_fd(b) ((b)->fd)
+extern int unixmessage_sender_getfd (unixmessage_sender_t const *) gccattr_pure ;
+
+extern int unixmessage_put_and_close (unixmessage_sender_t *, unixmessage_t const *, unsigned char const *) ;
+#define unixmessage_put(b, m) unixmessage_put_and_close(b, m, unixmessage_bits_closenone)
+extern int unixmessage_putv_and_close (unixmessage_sender_t *, unixmessage_v_t const *, unsigned char const *) ;
+#define unixmessage_putv(b, m) unixmessage_putv_and_close(b, m, unixmessage_bits_closenone)
+
+extern unsigned char const *const unixmessage_bits_closenone ;
+extern unsigned char const *const unixmessage_bits_closeall ;
+
+extern int unixmessage_sender_flush (unixmessage_sender_t *) ;
+extern int unixmessage_sender_timed_flush (unixmessage_sender_t *, tain_t const *, tain_t *) ;
+#define unixmessage_sender_timed_flush_g(sender, deadline) unixmessage_sender_timed_flush(sender, (deadline), &STAMP)
+
+
+typedef struct unixmessage_receiver_s unixmessage_receiver_t, *unixmessage_receiver_t_ref ;
+struct unixmessage_receiver_s
+{
+ buffer mainb ;
+ cbuffer_t auxb ;
+ unsigned int mainlen ;
+ unsigned int auxlen ;
+ stralloc data ;
+ int fds[UNIXMESSAGE_MAXFDS] ;
+ unsigned int auxw ;
+} ;
+#define UNIXMESSAGE_RECEIVER_ZERO { .mainb = BUFFER_ZERO, .auxb = CBUFFER_ZERO, .mainlen = 0, .auxlen = 0, .data = STRALLOC_ZERO, .fds = { -1 }, .auxw = 0 }
+
+extern int unixmessage_receiver_init (unixmessage_receiver_t *, int, char *, unsigned int, char *, unsigned int) ;
+extern void unixmessage_receiver_free (unixmessage_receiver_t *) ;
+#define unixmessage_receiver_fd(b) buffer_fd(&(b)->mainb)
+
+extern int unixmessage_receive (unixmessage_receiver_t *, unixmessage_t *) ;
+extern int unixmessage_timed_receive (unixmessage_receiver_t *, unixmessage_t *, tain_t const *, tain_t *) ;
+#define unixmessage_timed_receive_g(receiver, msg, deadline) unixmessage_timed_receive(receiver, msg, (deadline), &STAMP)
+
+extern buffer_io_func_t unixmessage_read ;
+
+typedef int unixmessage_handler_func_t (unixmessage_t const *, void *) ;
+typedef unixmessage_handler_func_t *unixmessage_handler_func_t_ref ;
+
+extern int unixmessage_handle (unixmessage_receiver_t *, unixmessage_handler_func_t *, void *) ;
+extern int unixmessage_timed_handle (unixmessage_receiver_t *, unixmessage_handler_func_t *, void *, tain_t const *, tain_t *) ;
+#define unixmessage_timed_handle_g(b, f, p, deadline) unixmessage_timed_handle(b, f, p, (deadline), &STAMP)
+
+#endif
diff --git a/src/include/skalibs/unixonacid.h b/src/include/skalibs/unixonacid.h
new file mode 100644
index 0000000..a150e39
--- /dev/null
+++ b/src/include/skalibs/unixonacid.h
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#ifndef UNIXONACID_H
+#define UNIXONACID_H
+
+#include
+#include
+#include
+#include
+#include
+
+#endif
diff --git a/src/include/skalibs/webipc.h b/src/include/skalibs/webipc.h
new file mode 100644
index 0000000..6b2c1fe
--- /dev/null
+++ b/src/include/skalibs/webipc.h
@@ -0,0 +1,60 @@
+/* ISC license. */
+
+#ifndef WEBIPC_H
+#define WEBIPC_H
+
+ /*
+ UNIX domain socket functions.
+ "web" stands for William E. Baxter, the original author, who kindly
+ permitted me to modify and release his code as a part of skalibs.
+ It has nothing to do with the World Wide Web.
+ */
+
+#define IPCPATH_MAX 107
+
+#include
+#include
+
+#define ipc_stream() ipc_stream_nb()
+#define ipc_stream_b() ipc_stream_internal(0)
+#define ipc_stream_nb() ipc_stream_internal(DJBUNIX_FLAG_NB)
+#define ipc_stream_coe() ipc_stream_internal(DJBUNIX_FLAG_COE)
+#define ipc_stream_nbcoe() ipc_stream_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int ipc_stream_internal (unsigned int) ;
+
+#define ipc_datagram() ipc_datagram_nb()
+#define ipc_datagram_b() ipc_datagram_internal(0)
+#define ipc_datagram_nb() ipc_datagram_internal(DJBUNIX_FLAG_NB)
+#define ipc_datagram_coe() ipc_datagram_internal(DJBUNIX_FLAG_COE)
+#define ipc_datagram_nbcoe() ipc_datagram_internal(DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int ipc_datagram_internal (unsigned int) ;
+
+#define ipc_pair(sv) ipc_pair_nb(sv)
+#define ipc_pair_b(sv) ipc_pair_internal((sv), 0)
+#define ipc_pair_nb(sv) ipc_pair_internal((sv), DJBUNIX_FLAG_NB)
+#define ipc_pair_coe(sv) ipc_pair_internal((sv), DJBUNIX_FLAG_COE)
+#define ipc_pair_nbcoe(sv) ipc_pair_internal((sv), DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int ipc_pair_internal (int *, unsigned int) ;
+
+extern int ipc_bind (int, char const *) ;
+extern int ipc_bind_reuse (int, char const *) ;
+extern int ipc_listen (int, int) ;
+
+#define ipc_accept(s, path, len, trunc) ipc_accept_internal(s, path, len, (trunc), 0)
+#define ipc_accept_nb(s, path, len, trunc) ipc_accept_internal(s, path, len, (trunc), DJBUNIX_FLAG_NB)
+#define ipc_accept_coe(s, path, len, trunc) ipc_accept_internal(s, path, len, (trunc), DJBUNIX_FLAG_COE)
+#define ipc_accept_nbcoe(s, path, len, trunc) ipc_accept_internal(s, path, len, (trunc), DJBUNIX_FLAG_NB|DJBUNIX_FLAG_COE)
+extern int ipc_accept_internal (int, char *, unsigned int, int *, unsigned int) ;
+
+extern int ipc_eid (int, unsigned int *, unsigned int *) ;
+extern int ipc_local (int, char *, unsigned int, int *) ;
+
+extern int ipc_connect (int, char const *) ;
+extern int ipc_connected (int) ;
+extern int ipc_timed_connect (int, char const *, tain_t const *, tain_t *) ;
+#define ipc_timed_connect_g(fd, path, deadline) ipc_timed_connect(fd, path, (deadline), &STAMP)
+
+extern int ipc_send (int, char const *, unsigned int, char const *) ;
+extern int ipc_recv (int, char *, unsigned int, char *) ;
+
+#endif
diff --git a/src/libbiguint/bu_addc.c b/src/libbiguint/bu_addc.c
new file mode 100644
index 0000000..0a57531
--- /dev/null
+++ b/src/libbiguint/bu_addc.c
@@ -0,0 +1,22 @@
+/* ISC license. */
+
+/* OpenBSD needs that for EOVERFLOW. wtfbsdseriously */
+#define _BSD_SOURCE
+
+#include
+#include
+#include
+
+int bu_addc (uint32 *c, unsigned int cn, uint32 const *a, unsigned int an, uint32 const *b, unsigned int bn, register int carry)
+{
+ register unsigned int i = 0 ;
+ for (; i < cn ; i++)
+ {
+ register uint32 ai = (i < an) ? a[i] : 0 ;
+ register uint32 bi = (i < bn) ? b[i] : 0 ;
+ register uint32 ci = ai + bi + carry ;
+ carry = (carry || bi) && (ci < ai) ;
+ c[i] = ci ;
+ }
+ return carry ? (errno = EOVERFLOW, 0) : 1 ;
+}
diff --git a/src/libbiguint/bu_addmod.c b/src/libbiguint/bu_addmod.c
new file mode 100644
index 0000000..c997897
--- /dev/null
+++ b/src/libbiguint/bu_addmod.c
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#include
+#include
+
+int bu_addmod (uint32 *c, unsigned int cn, uint32 const *a, unsigned int an, uint32 const *b, unsigned int bn, uint32 const *m, unsigned int mn)
+{
+ if (!bu_add(c, cn, a, an, b, bn)) return 0 ;
+ if (bu_cmp(c, cn, m, mn) >= 0) bu_sub(c, cn, c, cn, m, mn) ;
+ return 1 ;
+}
diff --git a/src/libbiguint/bu_cmp.c b/src/libbiguint/bu_cmp.c
new file mode 100644
index 0000000..a6bfaeb
--- /dev/null
+++ b/src/libbiguint/bu_cmp.c
@@ -0,0 +1,18 @@
+/* ISC license. */
+
+#include
+#include
+
+int bu_cmp (register uint32 const *a, register unsigned int an, register uint32 const *b, register unsigned int bn)
+{
+ an = bu_len(a, an) ;
+ bn = bu_len(b, bn) ;
+ if (an < bn) return -1 ;
+ if (an > bn) return 1 ;
+ while (bn--)
+ {
+ if (a[bn] < b[bn]) return -1 ;
+ if (a[bn] > b[bn]) return 1 ;
+ }
+ return 0 ;
+}
diff --git a/src/libbiguint/bu_copy.c b/src/libbiguint/bu_copy.c
new file mode 100644
index 0000000..1358aca
--- /dev/null
+++ b/src/libbiguint/bu_copy.c
@@ -0,0 +1,21 @@
+/* ISC license. */
+
+/* OpenBSD needs that for EOVERFLOW. wtfbsdseriously */
+#define _BSD_SOURCE
+
+#include
+#include
+#include
+
+int bu_copy (uint32 *b, unsigned int bn, uint32 const *a, unsigned int an)
+{
+ register unsigned int alen = bu_len(a, an) ;
+ if (bn < alen)
+ {
+ bu_copy_internal(b, a, bn) ;
+ return (errno = EOVERFLOW, 0) ;
+ }
+ bu_copy_internal(b, a, alen) ;
+ bu_zero(b + alen, bn - alen) ;
+ return 1 ;
+}
diff --git a/src/libbiguint/bu_copy_internal.c b/src/libbiguint/bu_copy_internal.c
new file mode 100644
index 0000000..919929b
--- /dev/null
+++ b/src/libbiguint/bu_copy_internal.c
@@ -0,0 +1,9 @@
+/* ISC license. */
+
+#include
+#include
+
+void bu_copy_internal (register uint32 *b, register uint32 const *a, register unsigned int n)
+{
+ while (n--) b[n] = a[n] ;
+}
diff --git a/src/libbiguint/bu_div.c b/src/libbiguint/bu_div.c
new file mode 100644
index 0000000..c7718e2
--- /dev/null
+++ b/src/libbiguint/bu_div.c
@@ -0,0 +1,23 @@
+/* ISC license. */
+
+#include