Expand description
Raw FFI bindings to libbsd.
This crate provides extern "C" declarations for the functions and types
exported by libbsd, a library that
provides commonly-used BSD functions on GNU/Linux systems.
§Platform support
On macOS, FreeBSD, OpenBSD, and NetBSD, most of these functions are already part of the system C library, so no additional library is needed.
On Linux, the crate uses pkg-config at build time to locate libbsd.
On Debian/Ubuntu, install the development headers with:
apt install libbsd-dev§Conditional compilation
Functions that only exist in libbsd (not on any BSD natively) are gated
behind #[cfg(target_os = "linux")]. Functions available on the BSDs but
not macOS are gated behind #[cfg(not(target_os = "macos"))].
The strnvis and strnunvis functions have different parameter orders
depending on whether the platform follows the NetBSD convention (macOS,
NetBSD, OpenBSD) or the FreeBSD convention (FreeBSD, Linux/libbsd).
Structs§
Enums§
Constants§
- FPARSELN_
UNESCALL - FPARSELN_
UNESCCOMM - FPARSELN_
UNESCCONT - FPARSELN_
UNESCESC - FPARSELN_
UNESCREST - HN_
AUTOSCALE - HN_B
- HN_
DECIMAL - HN_
DIVISOR_ 1000 - HN_
GETSCALE - HN_
IEC_ PREFIXES - HN_
NOSPACE - N_ABS
- N_BSS
- N_COMM
- N_DATA
- N_EXT
- N_FN
- N_INDR
- N_SETA
- N_SETB
- N_SETD
- N_SETT
- N_SETV
- N_SIZE
- N_STAB
- N_TEXT
- N_TYPE
- N_UNDF
- N_WARN
- RPP_
ECHO_ OFF - RPP_
ECHO_ ON - RPP_
FORCELOWER - RPP_
FORCEUPPER - RPP_
REQUIRE_ TTY - RPP_
SEVENBIT - RPP_
STDIN - UNVIS_
END - UNVIS_
ERROR - UNVIS_
NOCHAR - UNVIS_
SYNBAD - UNVIS_
VALID - UNVIS_
VALIDPUSH - VIS_
CSTYLE - VIS_DQ
- VIS_
GLOB - VIS_
HTTP1808 - VIS_
HTTP1866 - VIS_
HTTPSTYLE - VIS_
META - VIS_
MIMESTYLE - VIS_NL
- VIS_
NOESCAPE - VIS_
NOLOCALE - VIS_
NOSLASH - VIS_
OCTAL - VIS_
SAFE - VIS_
SHELL - VIS_SP
- VIS_TAB
- VIS_
WHITE
Statics§
Functions§
- arc4random⚠
- arc4random_
addrandom ⚠ - arc4random_
buf ⚠ - arc4random_
stir ⚠ - arc4random_
uniform ⚠ - bsd_
getopt ⚠ - closefrom⚠
- dehumanize_
number ⚠ - errc⚠
- expand_
number ⚠ - explicit_
bzero ⚠ - fgetln⚠
- fgetwln⚠
- flopen⚠
- flopenat⚠
- fmtcheck⚠
- fparseln⚠
- fpurge⚠
- freezero⚠
- funopen⚠
- getbsize⚠
- getmode⚠
- getpeereid⚠
- getprogname⚠
- gid_
from_ ⚠group - group_
from_ ⚠gid - heapsort⚠
- humanize_
number ⚠ - inet_
net_ ⚠pton - int_
to_ ⚠time - long_
to_ ⚠time - mergesort⚠
- nlist⚠
- nvis⚠
- pidfile_
close ⚠ - pidfile_
fileno ⚠ - pidfile_
open ⚠ - pidfile_
remove ⚠ - pidfile_
write ⚠ - radixsort⚠
- readpassphrase⚠
- reallocarray⚠
- reallocf⚠
- recallocarray⚠
- setmode⚠
- setproctitle⚠
- setproctitle_
init ⚠ - setprogname⚠
- sl_add⚠
- sl_
delete ⚠ - sl_find⚠
- sl_free⚠
- sl_init⚠
- snvis⚠
- sradixsort⚠
- stravis⚠
- strenvisx⚠
- strlcat⚠
- strlcpy⚠
- strmode⚠
- strnstr⚠
- strnunvis⚠
- strnunvisx⚠
- strnvis⚠
- strnvisx⚠
- strsenvisx⚠
- strsnvis⚠
- strsnvisx⚠
- strsvis⚠
- strsvisx⚠
- strtonum⚠
- strunvis⚠
- strunvisx⚠
- strvis⚠
- strvisx⚠
- svis⚠
- time32_
to_ ⚠time - time64_
to_ ⚠time - time_
to_ ⚠int - time_
to_ ⚠long - time_
to_ ⚠time32 - time_
to_ ⚠time64 - uid_
from_ ⚠user - unvis⚠
- user_
from_ ⚠uid - vis⚠
- warnc⚠
- wcslcat⚠
- wcslcpy⚠