Discussion:
File Descriptors
(too old to reply)
will
2005-11-25 19:17:48 UTC
Permalink
Can each process have 10 open files, or is it a global system limit of 10
open files?

I assume that if 10 seperate processes open the same file, there will be
10 seperate file descriptors, each referring to the same file instance, and
the attempt to open the 11th file will fail. Is this correct?

-Will
Iulian Neamtiu
2005-11-26 01:16:52 UTC
Permalink
Post by will
Can each process have 10 open files, or is it a global system limit of 10
open files?
The former. The limit is per process, not per system.
Post by will
I assume that if 10 seperate processes open the same file, there will be
10 seperate file descriptors, each referring to the same file instance, and
the attempt to open the 11th file will fail. Is this correct?
Since the limit is not global, this is not an issue. Moreover, as we say
in the description, don't worry about multiple processes opening the same file:
"You do not need to consider situations where two processes have the same
file open. You do not need to consider situations where one process opens
the same file twice without closing it in between."

Iulian

Loading...