In these cases, it is often useful to know how many files are currently open by a process. The number of files currently opened by a certain process can be examined by:. The pfiles command displays the current limit of the number of open files for the process and more information about all currently open files of that process. This limit results from the data type used in the FILE structure for the actual file descriptor.
An unsigned 8-bit data type, which has a range of values of , is used. Thus, the maximum number of file descriptors is limited to for bit stdio 3S -based programs. For bit systems and bit processes , the stdio 3S limit is 64 Kbytes. In bit Solaris 7, select 3C can poll up to Kbyte file descriptors.
Note that in Solaris, there is no maximum open file descriptors setting. They are allocated on demand as long as there is free RAM available. When the number of allocated file descriptors reaches the limit for the system, the following error message is displayed in the system console when you try to open a file:. This is a serious problem, indicating that the system is unable to open any more files.
To avoid this problem, consider increasing the file descriptor limit to a reasonable number. To change the number of file descriptors in Linux, do the following as the root user:. Overriding this limit requires superuser privilege. Both streams display as terminal output:. We're getting errors because find is trying to search a few system directories that we don't have permission to read.
All the lines that say "Permission denied" were written to stderr, and the other lines were written to stdout. Understanding the difference between stdout and stderr is important when you want to work with a program's output. For example, if you try to grep the output of the find command, you'll notice the error messages are not filtered, because only the standard output is piped to grep. However, you can redirect standard error to standard output, and then grep will process the text of both:.
0コメント