Hi all!
Does anyone know the C language UNIX system call under SUN OS 4.1.3,
to set the maximum number of open files per process?
It seems that a default number is 61 ????
Thanks in advance!
Steinar Karlsen.
Hi all!
Does anyone know the C language UNIX system call under SUN OS 4.1.3,
to set the maximum number of open files per process?
It seems that a default number is 61 ????
Thanks in advance!
Steinar Karlsen.
64. But remember that your process starts out with stdin, stdout,Quote:>It seems that a default number is 61 ????
--Ken Pizzini
-----BEGIN PGP SIGNED MESSAGE-----
>Does anyone know the C language UNIX system call under SUN OS 4.1.3,
>to set the maximum number of open files per process?
>It seems that a default number is 61 ????
To change that you must recompile the kernel. There's no such
system call to do that.
Hope this helps,
- --
********** http://jupiter.di.uminho.pt/~rui ***************
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
iQCVAwUBMhjYNFCBIPblTRelAQHQSQP/dBoe+GP1Qifg+41TUHKsgrCMwe99MwWT
p5hS0OHAOKyvNRTxrGwYl37Tal8zCsZZOsz0r/EzEjTAlNgKXTiBZ9ho+4aJICxv
JaMCn8XLXV/48aGhn7ZWgJcR2syAjZBO3U+5/YgxafJpnIkkyANuHILCinJACYny
z/3jxlTqmC8=
=ox2q
-----END PGP SIGNATURE-----
: -----BEGIN PGP SIGNED MESSAGE-----
: >Hi all!
: >
: >Does anyone know the C language UNIX system call under SUN OS 4.1.3,
: >to set the maximum number of open files per process?
: >
: >It seems that a default number is 61 ????
: Probably the limit is 64 ... the 61 + 0 (stdin) + 1 (stdout)
: and 2 (stderr).
: To change that you must recompile the kernel. There's no such
: system call to do that.
No offense intended, but you need to read your man pages more often.
There most certainly is a system call for this. getrlimit() and setrlimit().
The 64 process limit is only a soft limit. To find out the hard limits,
an easy way is to invoke csh, type limit (to print out the soft limits),
unlimit (to remove the soft limits), and then limit again to print out
the new values.
Usually, I'll do something like the example below:
#include <sys/types.h>
#include <time.h>
#include <sys/resource.h>
/*
* int setlimits(void)
* set system resource limits
*/
int
setlimits(void)
{
struct rlimit rlp;
/* We need more than POSIX OPEN_MAX open file descriptors */
if (getrlimit(RLIMIT_NOFILE, &rlp) != 0) {
fprintf(stderr, "Can't get limits\n");
return -1;
/* set the current value as high as allowed */Quote:}
if (setrlimit(RLIMIT_NOFILE, &rlp) != 0) {
fprintf(stderr, "Can't set limits\n");
return -1;
/* All okay */Quote:}
Quote:}
*However*, it's a "setrlimit()"-controllable resource limit; the soft
limit is 64, but the hard limit is 256 (or 1024 if you have the SunDBE
product, I think), and a process can crank its soft limit up to the hard
limit. See the GETRLIMIT(2) man page, which describes "getrlimit()" and
"setrlimit()".
(Some other UNIXes also have an RLIMIT_NOFILE resource limit, e.g.
SVR4-flavored UNIXes such as SunOS 5.x.)
Cranking the *hard* limit up would probably require you to be root and,
at least in SunOS 4.1[.x], I don't think you can crank it up even if
you're root.
>To find out the hard limits,
>an easy way is to invoke csh, type limit (to print out the soft limits),
>unlimit (to remove the soft limits), and then limit again to print out
>the new values.
An easier way to find out the hard limits is to invoke "csh" (if you're
not already running it), and then type "limit -h".
(In SVR4-flavored systems such as SunOS 5.x, you can set and print the
limits in the Bourne and Korn shells with the "ulimit" command, but the
SunOS 4.x Bourne shell doesn't let you do that.)
1. How to set max # of open files per process?
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.
Stella
--
===========================================================================
Informix Software, Inc. voice: (415)926-6775
4100 Bohannon Drive, Menlo Park, CA 94025
2. GNOME 2.x; Why so many libs/tarballs?
3. Summary: How to set max # of open files per process?
4. WINDOWS BEATS LINUX ALL THE TIME!!!
5. How can I tuning Max process number and open file number on Sun Solaris 7(Intel)???
6. Redhat 7.1 + Ximian 1.4 Installer woes
7. Setting max number of per user processes.
8. possible SYN flood on <my IP address>:80 from 130.244.157.50
9. max file descriptor number per process in solaris2.7
10. max # of open files per process
11. Increasing maximum number of open files per process?
12. Maximum number of open files per process
13. How do I change the maximum number of open files per process?