Skip to main content

Module common

Module common 

Source

Modules§

io

Functions§

gnu_name
Get the GNU-compatible tool name by stripping the ‘f’ prefix. e.g., “fmd5sum” -> “md5sum”, “fcut” -> “cut”
io_error_msg
Format an IO error message without the “(os error N)” suffix. GNU coreutils prints e.g. “No such file or directory” while Rust’s Display impl adds “ (os error 2)“. This strips the suffix for compat.
reset_sigpipe
Reset SIGPIPE to default behavior (SIG_DFL) for GNU coreutils compatibility. Rust sets SIGPIPE to SIG_IGN by default, but GNU tools are killed by SIGPIPE (exit code 141 = 128 + 13). This must be called at the start of main().