Added signature for changeset ee2327236830

Signed-off-by: Josef 'Jeff' Sipek <>
Added tag v0.22-rc2 for changeset 136b22000744

Signed-off-by: Josef 'Jeff' Sipek <>
cmake: remove version info from CMakeLists.txt

The version info is always obtained from hg repo history or from
.hg_archival.txt files generated during 'hg archive'.

As a result, new releases will not have "version X.Y" commits anymore, but
they will instead have tag & signature commits.

Signed-off-by: Josef 'Jeff' Sipek <>
cmake: rework version & hg commit getting

hg archive generated tarballs include a .hg_archival.txt file which includes
the commit hash, latest tag, and distance from latest tag.  These values can
be combined to create a string much like the template-based version string.

Signed-off-by: Josef 'Jeff' Sipek <>
thread: use pthread_cleanup_{push,pop}

Each xthr_create wraps the passed in user function in hopes of executing
code after the function returns to clean up some libjeffpc-internal
thread-local state.  This needs to happen even if the thread called

The pthread_cleanup_{push,pop} functions are the POSIX-provided way to run
such cleanup code.

Signed-off-by: Josef 'Jeff' Sipek <>
cmake: bump the minimum required version to 3.12

Even Debian old-old-stable (buster) shipped 3.13.

This is needed because modern cmake (3.28) warns about specifying too old of a
minimum required version:

  CMake Deprecation Warning at .../CMakeLists.txt:23 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of

Instead of bumping the version to 3.11 (the minimum), this change bumps it
to 3.12 to make it past CMake policy CMP0075 change.  The new behavior
(respect CMAKE_REQUIRED_LIBRARIES in check_include_file) is saner, and so
instead of explicitly opting for it in 3.11 we get it implicitly in 3.12.
For completeness, here's the warning:

  CMake Warning (dev) at /usr/local/share/cmake-3.23/Modules/CheckIncludeFile.cmake:82 (message):
    Policy CMP0075 is not set: Include file check macros honor
    CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
    details.  Use the cmake_policy command to set the policy and suppress this



    For compatibility with CMake 3.11 and below this check is ignoring it.
  Call Stack (most recent call first):
    /usr/local/share/cmake-3.23/Modules/CheckTypeSize.cmake:256 (check_include_file)
    cmake/config-datamodel.cmake:25 (check_type_size)
    cmake/config.cmake:36 (include)
    CMakeLists.txt:54 (include)

Signed-off-by: Josef 'Jeff' Sipek <>
tests: ignore the generated str2float test binary

Should have been done by the commit that introduced the test.

Signed-off-by: Josef 'Jeff' Sipek <>
cmake: search for xdr functions in tirpc as well

At some point in the relatively recent past, rpc/rpc.h apparently got moved
from glibc to libtirpc.

Signed-off-by: Josef 'Jeff' Sipek <>
cmake: properly check for xdr function locations

Instead of doing a quick-and-dirty check for xdr_opaque in libnsl, implement
a proper find_package module.

As a result, we can also be more correct and add an include dir for

Signed-off-by: Josef 'Jeff' Sipek <>
json: correctly compare expected and actual test values

The buffer filled by the json packing API are *not* nul-terminated.
Therefore, we cannot use strcmp to compare its contents with the expected

Signed-off-by: Josef 'Jeff' Sipek <>
build: replace clang 10 with clang 18 on FreeBSD

Clang 10 got removed from ports and clang 18 got added.

Signed-off-by: Josef 'Jeff' Sipek <>
socksvc: switch to the newly added xsockaddr

Signed-off-by: Josef 'Jeff' Sipek <>
sock: add sockaddr_{ntop,cmp,copy} helpers and a sockaddr_union

For now, it only supports AF_INET and AF_INET6.  That should be enough for
most things, but it is likely only a matter of time before AF_UNIX crops up.

Signed-off-by: Josef 'Jeff' Sipek <>
build: add newer compilers to the FreeBSD manifest

Adding clang 17 and gcc 13.

Signed-off-by: Josef 'Jeff' Sipek <>
build: bump compiler versions on debian

The build is still broken because rpc/rpc.h got moved from glibc to libtirpc
about a year ago.

Signed-off-by: Josef 'Jeff' Sipek <>
synch: add MXTRYLOCK

There are times when having a try-lock is the best way to solve a problem.

Signed-off-by: Josef 'Jeff' Sipek <>
io: remove an unused variable

Signed-off-by: Josef 'Jeff' Sipek <>
json: add packing tests

It is far from exhaustive, but it is a start.

Signed-off-by: Josef 'Jeff' Sipek <>
slab: implement a custom allocator

This is a very simple allocator based on the ideas from kmem cache allocator
in Solaris.

While functional, there are plenty of performance and debuggability
improvements that could (and probably should) be made.

Signed-off-by: Josef 'Jeff' Sipek <>
int: clarify comment for p2roundup

It read like the code rounded the value up to the next power of 2 rather
than to the next multiple of a power of 2.

Signed-off-by: Josef 'Jeff' Sipek <>