sys_close_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

Bestie, meet sys_close_range πŸ’– β€” the call that closes all file descriptors in a given range. This page is straight from the Kernel API Manual, and it's here to explain the whole sys_close_range(9) situation with zero gatekeeping 🫢.

πŸ¦‹ SYNOPSIS πŸ¦‹

long sys_close_range (unsigned int fd , unsigned int max_fd , unsigned int flags );

πŸŽ€ ARGUMENTS πŸŽ€

  • fd β€” starting file descriptor to close. That's where the range begins, periodt πŸ’….
  • max_fd β€” last file descriptor to close. That's the end of the range, iykyk.
  • flags β€” CLOSE_RANGE flags. Yep, that's the flag situation ✨.

πŸ’… DESCRIPTION πŸ’…

Okay so here's the tea β˜•: this closes a range of file descriptors. All file descriptors from fd up to and including max_fd are closed β€” yes, max_fd is included, bestie, don't forget it πŸ”₯.

Currently, errors to close a given file descriptor are ignored πŸ™ˆ. That's the documented behaviour: ignored.

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/file.c β€” go peek if you're nosy πŸ‘€ β€” and the related pages are:


That's the whole page, bestie πŸŽ€ source/version: ./fs, date: October 2026. sys_close_range(9) out πŸ’…βœ¨

πŸ“¦ where this page comes from