Problems with fopen and many open files

Mattias.Gronlund Mattias.Gronlund at
Wed Sep 15 20:54:23 GMT 1999


We are running Samba on a Solaris 2.5.1-system. 

We have seen messages like this in the log from time to time:

[1999/09/15 12:57:43.093672, 0, 24356, e(0, 0), r(0, 0)]
  trust_password_lock: cannot open file
c - Error was No such file or directory.
[1999/09/15 12:57:43.095309, 0, 24356, e(0, 0), r(0, 0)]
  domain_client_validate: unable to open the machine account password
file for machine SCC
001 in domain ERISOFT_SA.

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) =
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
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 have run my test-program on Solaris 2.6 and Redhat Linux 6.0 too, and
the same limit on Solaris 2.6, but no such limit under Redhat Linux 6.0.

I can't say that I am a friend of the fopen. So I wounder why do Samba
to use fopen? Couldn't we convert the code to use open insted of fopen?


More information about the samba-technical mailing list