Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
CLOSEFROM(2)		  FreeBSD System Calls Manual		  CLOSEFROM(2)

NAME
     closefrom,	close_range -- delete open file	descriptors

LIBRARY
     Standard C	Library	(libc, -lc)

SYNOPSIS
     #include <unistd.h>

     void
     closefrom(int lowfd);

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

DESCRIPTION
     The closefrom() 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 close_range() system call deletes all open file descriptors between
     lowfd and highfd inclusive, clamped to the	range of open file descrip-
     tors.  Any	errors encountered while closing file descriptors are ignored.
     There are currently no defined flags.

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

ERRORS
     The close_range() system call will	fail if:

     [EINVAL]		The highfd argument is lower than the lowfd argument.

     [EINVAL]		An invalid flag	was set.

SEE ALSO
     close(2)

HISTORY
     The closefrom() function first appeared in	FreeBSD	8.0.

FreeBSD	13.0			April 12, 2020			  FreeBSD 13.0

NAME | LIBRARY | SYNOPSIS | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=closefrom&sektion=2&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help