h3>File Descriptors
A file descriptor is a handle created by a process when a file is
opened. A new descriptor is created each time the file is opened.
It is associated with a file object which includes information such
as the mode in which the file was opened and the offset pointer
where the next operation will begin. This information is called the
context of the file.
File descriptors are retired when the file is closed or the process
terminates. Opens always choose the lowest-numbered file descriptor
available. Available file descriptors are allocated as follows:
- rlim_fd_cur: It is dangerous to set this value higher
than 256 due to limitations with the
stdio library.
If programs require more file descriptors, they should use
setrlimit directly.
- rlim_fd_max: It is dangerous to set this value higher
than 1024 due to limitations with
select.
If programs require more file descriptors, they should use
setrlimit directly.