NTHM_STRERROR (3)
NTHM MANUAL
NTHM_STRERROR (3)

NAME

nthm_strerror - translate an error code to a readable message

SYNOPSIS

#include <nthm/nthm.h>

char * nthm_strerror ( int err )

DESCRIPTION

The nthm_strerror function translates a numeric error code err to a terse character string describing the error similarly to the POSIX standard strerror function. It differs from strerror in being able to translate nthm specific error codes in addition to POSIX standard error codes. This function is not thread-safe and should not be used in production code unless its use is restricted to a single thread context.

RETURN VALUE

The string returned by nthm_strerror is statically allocated and should not be modified or freed. The following nthm specific error codes yield the return values shown.

NTHM_UNMANT

"nthm: inapplicable operation in an unmanaged thread"

NTHM_NOTDRN

"nthm: attempt to access a non-locally tethered pipe"

NTHM_NULPIP

"nthm: null pipe"

NTHM_INVPIP

"nthm: corrupted or invalid pipe"

NTHM_KILLED

"nthm: interrupted by a kill notification"

NTHM_UNDFLO

"nthm: scope underflow"

NTHM_XSCOPE

"nthm: [warning] scope not exited"

Any other error code err in the range of -NTHM_MIN_ERR to -NTHM_MAX_ERR yields a return value of the form

"nthm-0.10.14: internal error code err "

displaying the absolute value of the error code in decimal. Internal error codes are version specific and should be accompanied by the version number in bug reports, which may vary from 0.10.14.

Return values for error codes outside this range are either generated by the POSIX standard strerror function or devolve to

"nthm: undiagnosed POSIX error"

if strerror is unsuccessful.

ERRORS

none

SEE ALSO

nthm, nthm_open, nthm_send, nthm_read, nthm_select, nthm_truncate, nthm_truncate_all, nthm_truncated, nthm_enter_scope, nthm_exit_scope, nthm_kill, nthm_kill_all, nthm_killed, nthm_untether, nthm_tether, nthm_blocked, nthm_busy, pthreads (7), errno (3), nthm_sync

AUTHOR

Dennis Furey (milonga@delayinsensitive.com)

PROJECT PAGE

https://github.com/gueststar/nthm

NTHM VERSION 0.10.14
May 17, 2024
NTHM_STRERROR (3)