man.bsd.lv manual page server

Manual Page Search Parameters

CLOSEFROM(2) System Calls Manual CLOSEFROM(2)

closefrom, close_rangedelete open file descriptors

library “libc”

#include <unistd.h>

void
closefrom(int lowfd);

int
close_range(u_int lowfd, u_int highfd, int flags);

The () system call deletes all open file descriptors greater than or equal to lowfd from the per-process object reference table. Any errors encountered while closing file descriptors are ignored.

The () system call deletes all open file descriptors between lowfd and highfd inclusive, clamped to the range of open file descriptors. Any errors encountered while closing file descriptors are ignored. There are currently no defined flags.

Upon successful completion, close_range() returns a value of 0. Otherwise, a value of -1 is returned and the global variable errno is set to indicate the error.

The close_range() system call will fail if:

[]
The highfd argument is lower than the lowfd argument.
[]
An invalid flag was set.

close(2)

The closefrom() function first appeared in FreeBSD 8.0.

April 12, 2020 FreeBSD-13.0