Check open file descriptors solaris 10




















Each process has a table of open files, starting at file descriptor 0 and progressing upward as more files are opened. A file descriptor can be obtained with the open system call, which opens a file named by a path name and returns a file descriptor identifying the open file. A file descriptor is eventually closed by the close 2 system call or by the process' exit. By default, file descriptors 0, 1, and 2 are opened automatically by the C runtime library and represent the standard input, standard output, and standard error streams for a process.

The kernel establishes default hard and soft limits for the number of files a process can have opened at any one time. The following commands can be used to check the value for the limit of the maximum number of open files of a running process Again, in all examples, is used for the process id :. Skip to primary navigation Skip to main content Skip to primary sidebar Skip to footer navigation.

Note: There is no limit for the number of open files per Solaris system. The number of files which can be opened on Solaris 10 and above is only limited by the amount of available memory.

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. See the following example. Run the sleep seconds command in background and then run pfiles command on the PID of the sleep command.

Added detail to answer above. Added hack using ps and pfiles. Works better than trying to use find to count fd links in proc dir. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta.



0コメント

  • 1000 / 1000