OPEN_MAX in Linux - Unix

This is a discussion on OPEN_MAX in Linux - Unix ; Greetings ! How do I configure OPEN_MAX, in Linux, such that at runtime my program to have OPEN_MAX > 1024 ? Thank you, Alexandru....

+ Reply to Thread
Results 1 to 2 of 2

Thread: OPEN_MAX in Linux

  1. OPEN_MAX in Linux

    Greetings !

    How do I configure OPEN_MAX, in Linux, such that at runtime my program
    to have OPEN_MAX > 1024 ?

    Thank you,
    Alexandru.

  2. Re: OPEN_MAX in Linux

    On Aug 15, 5:25*pm, alexandrug wrote:

    > How do I configure OPEN_MAX, in Linux, such that at runtime my program
    > to have OPEN_MAX > 1024 ?


    There shouldn't be anything special you need to do in your code,
    except avoid 'select' and standard I/O. Simply setting the 'ulimit -n'/
    RLIMIT_NOFILE file at run time should be sufficient. Your program can
    use 'getdtablesize' or 'getrlimit' at run time to determine the
    imposed limit, which you may be able to raise (to its hard limit).

    Many systems still impose a hard limit of 1,024 on all normal users.
    IMO, this is obsolete. It may still be a rational default/soft limit
    but is an irrational hard limit on systems that have no (practical)
    fixed system open file limit.

    DS

+ Reply to Thread