Re: OPEN_MAX/FOPEN_MAX is dynamic?

Khimenko Victor (khim@sch57.msk.ru)
Mon, 19 Oct 1998 21:10:16 +0400 (MSD)


19-Oct-98 07:43 you wrote:
> Hi,

> Is OPEN_MAX/FOPEN_MAX dynamic in Linux 2.1.125? At least, it seems
>> 256. If it is true, is there a system call libc can use to get it
> or do we have to use the /proc interface?

> Ulrich, we need to address it in glibc 2. Also it may have impact
> on __fd_set. It should be large enough to cover most if not all
> cases. I am thinking 8192 or even larger. We can do the conversion
> to the kernel fd size at the run-time.

> Thanks.

I'm seen slightly different approach somewhere (AIX, perhaps?). Standard fd_set
size is "small" -- 1024 (but may be 8192 will be better -- it was "big" Unix
but it was long ago when even "big" computers was small :-) and this size is
used for all processes by default. You could raise limit by special system
call if you really need, say, 262144 files opened at the same time but in such
programs you need also #define __FDSET_SIZE (or something) before including
standard headers and you must pay speciall attention on exec call but this
way most programs will use small (256bytes or 1K) fd_set while special ones
could open REALLY big bunch of files (and will use 32K, 64K or even bigger
fd_set :-). Of course such changes in kernel in 100% not 2.2 issue but 2.3
issue (if ever) but changes in libc/glibc should be done (MUST be done IMO)
before this approch will be added to kernel... Or this is completely braindead
idea ?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/