Problems with fopen and many open files

Frank van Maarseveen fvm at
Thu Sep 16 09:13:44 GMT 1999

On Thu, Sep 16, 1999 at 06:55:47AM +1000, Mattias.Gronlund wrote:
>   trust_password_lock: cannot open file
> /opt/fw/samba/current/private/
> I did run truss on a process and trigged a new message, truss gave:
> open("/opt/fw/samba/current/private/ERISOFT_SA.SCC001.mac", O_RDWR) =
> 320
> close(320)                                      = 0
> As of what I have understood, this is the fopen opening the file but
> rejecting the descriptor. I wrote a test and verified that I get
> an error, "Too many open files" with descriptors over 63. What buggs me
> is
> that the error printed by smbd is "No such file or directory".
> My conclution of this is that libc:s fopen is limited somehow by 
> limits.h:s OPEN_MAX, that is set to 64.
I think Solaris uses sysconf(_SC_OPEN_MAX). On a Solaris 2.7 it says 64
though. File descriptor 320 is quite high with this _SC_OPEN_MAX but
maybe only real files are counted and no network connections.

In <stdio.h> there are other defines which may also be the cause: _NFILE
and FOPEN_MAX but this depends on the compiler & C library being used.


More information about the samba-technical mailing list