c-errno-and-syscall-returns
Installation
SKILL.md
C errno & Syscall Return Handling
When to use
- C crossing the OS boundary:
read/write/accept/connect,open/close, and libc functions that report errors via errno (strtol,strtod,fread,fwrite,malloc,fopen). - Flaky I/O: lost or duplicated data, false errors, hangs, failures only under load or after signals.
- Retry/aggregation: read a buffer "until done", write "until all bytes are out".
When not to use
- Pure computation with no libc/OS boundary — see
c-undefined-behavior. - Win32
FALSE/GetLastError/HRESULTconventions — different model; this skill covers CRT_read/_writeand POSIX, notCreateFile/ReadFile. - C++ exceptions/RAII —
cpp-object-lifecycle. - Inside signal handlers —
c-signal-handler-safety(requires this skill).