Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created December 27, 2012 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4385624 to your computer and use it in GitHub Desktop.
Save anonymous/4385624 to your computer and use it in GitHub Desktop.
Snippets from Ubuntu header files relevant to http://stackoverflow.com/q/14042824/827263

Reference: http://stackoverflow.com/q/14042824/827263

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

/usr/include/X11/Xos.h:

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

===

/usr/include/i386-linux-gnu/bits/local_lim.h:

    /* 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
    #endif
    #ifndef LINK_MAX
    # define __undef_LINK_MAX
    #endif
    #ifndef OPEN_MAX
    # define __undef_OPEN_MAX
    #endif
    #ifndef ARG_MAX
    # define __undef_ARG_MAX
    #endif

===

/usr/include/i386-linux-gnu/bits/xopen_lim.h:

    /* 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.

       PAGESIZE
       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