closefrom(3bsd)
π closefrom β the manual page bestie edition π
okay so you found yourself on the closefrom(3bsd) page and honestly? iconic of you. this is a libbsd joint, and she's a little one, but she's important. let's get into it π«Ά
β¨ NAME β¨
closefrom β delete open file descriptors. yes bestie, all of them, from a certain point onwards. it's giving spring cleaning πΈ
π LIBRARY π
Utility functions from BSD systems β that's libbsd, and you link her with -lbsd. no cap.
π SYNOPSIS π
#include <unistd.h>
(See libbsd(7) for include usage.)
void
closefrom(int lowfd);
real talk: the include situation is a whole thing, so peep libbsd(7) for how the include usage actually works before you start typing π
π DESCRIPTION π
so the closefrom() system call does one thing and does it flawlessly: it deletes every single open file descriptor that is greater than or equal to lowfd from the per-process object reference table. all of them. gone. not me manifesting a clean fd table β¨
and here's the part you need to know, bestie β any errors encountered while closing file descriptors are ignored. she does not care. she does not stop. she does not report back. she simply closes π
π SEE ALSO π
close(2)β the sibling. the original. go read her too π
π STANDARDS π
closefrom() is a BSD and Solaris extension. so she's not POSIX, she's a whole vibe of her own. iykyk π¦
π°οΈ HISTORY π°οΈ
the closefrom() function first appeared in:
- Solaris 9
- OpenBSD 3.5
- DragonFly 1.2
- NetBSD 3.0
- FreeBSD 8.0
- glibc 2.34
she really said "i'm gonna show up everywhere" and then did exactly that. main character energy fr fr π
and that's the whole page, bestie!! this one shipped out of Debian back on June 12, 2009 β a true vintage icon π close those fds and stay hydrated, ily ππ§
π¦ where this page comes from
- alpine 3.22: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- alpine 3.23: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- alpine 3.24: libbsd-doc 0.12.2-r0 Β· BSD-3-Clause
- arch rolling: libbsd 0.12.2-2 Β· custom
- debian trixie: libbsd-dev 0.12.2-2
- epel 10: libbsd-devel 0.12.2-4.el10_0 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- epel 9: libbsd-devel 0.12.2-1.el9 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libbsd-devel 0.12.2-6.fc43 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 43: libbsd-devel 0.12.2-6.fc43 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libbsd-devel 0.12.2-7.fc44 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- fedora 44: libbsd-devel 0.12.2-7.fc44 Β· Beerware AND BSD-2-Clause AND BSD-3-Clause AND ISC AND libutil-David-Nugent AND MIT AND LicenseRef-Fedora-Public-Domain
- nixos 26.05: libbsd 0.12.2
- nixpkgs unstable: libbsd 0.12.2
- ubuntu noble: libbsd-dev 0.12.1-1build1
- ubuntu noble: libbsd-dev 0.12.1-1build1.1
- ubuntu questing: libbsd-dev 0.12.2-2build1
- ubuntu resolute: libbsd-dev 0.12.2-2build2
- ubuntu stonking: libbsd-dev 0.12.2-3
- Copyright (c) 2009 Advanced Computing Technologies LLC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms