Summary: How to set max # of open files per process?

From: Stella Yan (
Date: Fri Oct 07 1994 - 11:55:17 CDT

On Oct 3, 1994, I posted the following question:

: How do I set the maximum number of open files per process on Solaris 2.3?
: Is there some variable in /etc/system for setting this limit?

Thanks to all those who responded. The responses are as follows:

The default is 64. You can set the per process limit for file descriptors
by using ulimit descriptors xxx under /bin/sh or /bin/ksh, or limit
descriptors xxx under /bin/csh. The limit is 1024 for user processes.
If you want to do this inside a C program, use the set/getrlimit system
calls to get and set the values. I'm not aware of any way to set it
globally. Perhaps someone else out there knows.

BTW, ulimit descriptors does not work in /bin/sh under SunOS.
What I've found out since is that the limits are imposed by the shell,
not the kernel.

To set the limit in Korn shell: ulimit -n #files

In C shell: limit descriptors #files.

These values have a high limit which can be changed by SU

The values can also be changed with a C program.
see 'man setrlimit'


Stella Yan                      email:
Informix Software, Inc.	        voice:  (415)926-6775
4100 Bohannon Drive, Menlo Park, CA 94025

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:11 CDT