EMFILE means "too many file descriptors opened" *IN YOUR PROCESS*.
ENFILE means "too many file descriptors opened" system-wide.
>I open one file on disk using fopen and close it with fclose. I
>verified that fclose is called for each file handle opened with fopen.
So how many files did you (try to) have open simultaneously?
>What can generate such error
Anything that opens a file or a file descriptor, including open(),
socket(), dup(), etc.
>and how best to diagnose it? what means
>"file descriptors' or solaris? Disk file handles, sockets?
Yes, and yes. Shared libraries might also occupy a file descriptor,
as might mapped memory.
>Is there
>way to see from shell what file descriptors are opned by a process?
'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.
> >I have a FastCGI app on Soalris 10 and after certain time I start
> >getting EMFILE (errno 24 - "too many file descriptors opened") error.
...
> >Is there
> >way to see from shell what file descriptors are opned by a process?
>
> 'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.
Truss would also be useful, you can see all the opens and closes, and
ensure that they match up.
--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
pfiles is the native Solaris command.
--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]