io_closeonexec(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

okay so bestie, we're in the Library Functions Manual and this page is all about io_closeonexec β€” mark a file descriptor non-inheritable. tiny name, very specific job, we love that for us. πŸ’…

πŸ“œ SYNTAX πŸ“œ

#include <libowfat/io.h>

void io_closeonexec(int64 fd);

πŸ’– DESCRIPTION πŸ’–

io_closeonexec marks a file descriptor non-inheritable. it will be automatically closed if the process executes a different one. so that fd is not tagging along into the new program, periodt. ✨

but lowkey important: the descriptor will not be automatically closed when you fork() a new child process, though. so fork keeps it around, exec yeets it β€” that's the distinction, bestie. πŸ¦‹

πŸ‘€ SEE ALSO πŸ‘€


that's the whole page, babe β€” source: Library Functions Manual, version/date: not shown on this copy, page: io_closeonexec(3). no extra meta tea, just close-on-exec excellence. stay slay and keep those fds in line. πŸ’–βœ¨πŸ«Ά