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/HRESULT conventions — different model; this skill covers CRT _read/_write and POSIX, not CreateFile/ReadFile.
  • C++ exceptions/RAII — cpp-object-lifecycle.
  • Inside signal handlers — c-signal-handler-safety (requires this skill).

What the agent often gets wrong

Installs
1
GitHub Stars
2
First Seen
Oct 3, 2026