[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Ammount of file descriptors per process



Frank Naumann napisał(a):
RLIMIT_NOFILE

    This is a number one greater than the maximum value that the system
    may assign to a newly-created descriptor. If this limit is exceeded,
    functions that allocate new file descriptors may fail with errno set
    to [EMFILE]. This limit constrains the number of file descriptors
    that a process may allocate.

Ok, it looks that KR "Ansi C" is not a reliable source when it comes to std library.

3. Opening (creating) files using system call Fcreate(), the maximum ammount of files it tries to open is taken from Sysconf(SYS_MAXFILES) system call.


 * Sysconf(which): returns information about system configuration.
 *       2      max. number of open files per process   {OPEN_MAX}

Ad 3. Sysconf(SYS_MAXFILES) returns 32. Test fails after opening 26 files.


This is not the number of files you can open, this is the maximum number of files a process can have open. Under Unix every process have at least 3 open file descriptors at start (stdin, stdout, stderr). Under FreeMiNT it's more due to TOS emulation.

My bad english, that was what I meant.

Or, if I'm wrong please correct me.


Except the FOPEN_MAX constant I don't see any problem or violation of the standards.

Thanks.

Btw. How can i hesk how many fd a procces have already opened? /kern/*/fd?

--
Semper Fidelis

Adam Klobukowski
atari@gabo.pl