ref: bb5007143abfc22d947c422bfade941e2a741c8c ctools/README.md -rw-r--r-- 2.0 KiB
bb500714Drew DeVault link: add conformance test 2 years ago


A collection of core tools for a POSIX-compatible operating system.


  1. Each program is self-contained, with no external dependencies even among other parts of ctools.
  2. All programs presume the locale is UTF-8.
  3. Each program is C99 and compatible with its POSIX.1-2017 specification and may be built in an environment which provides POSIX.1-2017 system interfaces.
  4. Where the specification is ambiguous, implementation-defined, or unspecified, the programs choose their behavior at random, to discourage relying on these behaviors.


Each "one-shot" tool is a single C file under src/ and can be compiled with the following:

c99 -o $tool -D_POSIX_C_SOURCE=200809L src/$tool.c

More complex tools may have several files under one directory:

c99 -o $tool -D_POSIX_C_SOURCE=200809L -Isrc/$tool/ src/$tool/*.c

To enable optional XSI support, use -D_XOPEN_SOURCE=700 instead of -D_POSIX_C_SOURCE.

Alternatively, you can compile all of the tools with meson:

meson . build
ninja -C build

This is recommended for distro packagers. Various options are available when building with meson via meson_options.txt.

#Conformance tests

Build with meson and run ninja -C build test to run POSIX conformance tests against ctools.


ctools includes POSIX.1-2017 base utilities, but does not support any POSIX.1-2017 option groups, with the exception of XSI support where relevant to POSIX base utilities (optional). See the STATUS file for a summary of utilities defined by POSIX and their status for inclusion in ctools.

A shell is not provided. mrsh is recommended for this purpose.


Mail patches, bugs, etc, to the mailing list: ~sircmpwn/ctools@lists.sr.ht

Consult https://git-send-email.io for information on preparing patches.