A Small RAII Wrapper for POSIX File Descriptors in C++17

Status: draft in progress Overview This article explains the design of a small RAII wrapper for POSIX file descriptors in C++17. A file descriptor is only an integer in userspace, but it refers to kernel-managed state. Treating it as a plain integer makes ownership easy to lose track of. The wrapper is meant to make descriptor ownership explicit and harder to misuse. Bugs this tries to avoid The article discusses common descriptor-management bugs: ...

17 June 2026 · 2 min · Mohammed EL Kadiri