Skip to content
Create a gist now

Instantly share code, notes, and snippets.

anonymous /

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Snippets from Ubuntu header files relevant to


From Ubuntu 12.10 (more or less), excerpts from header files that meantion OPEN_MAX.


    # ifdef __GNU__
    #  define PATH_MAX 4096
    #  define MAXPATHLEN 4096
    #  define OPEN_MAX 256 /* We define a reasonable limit.  */
    # endif


    /* The kernel header pollutes the namespace with the NR_OPEN symbol
       and defines LINK_MAX although filesystems have different maxima.  A
       similar thing is true for OPEN_MAX: the limit can be changed at
       runtime and therefore the macro must not be defined.  Remove this
       after including the header if necessary.  */
    #ifndef NR_OPEN
    # define __undef_NR_OPEN
    #ifndef LINK_MAX
    # define __undef_LINK_MAX
    #ifndef OPEN_MAX
    # define __undef_OPEN_MAX
    #ifndef ARG_MAX
    # define __undef_ARG_MAX


    /* We do not provide fixed values for

       ARG_MAX      Maximum length of argument to the `exec' function
                    including environment data.

       ATEXIT_MAX   Maximum number of functions that may be registered
                    with `atexit'.

       CHILD_MAX    Maximum number of simultaneous processes per real
                    user ID.

       OPEN_MAX     Maximum number of files that one process can have open
                    at anyone time.

       PAGE_SIZE    Size of bytes of a page.

       PASS_MAX     Maximum number of significant bytes in a password.

       We only provide a fixed limit for

       IOV_MAX      Maximum number of `iovec' structures that one process has
                    available for use with `readv' or writev'.

       if this is indeed fixed by the underlying system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.