Forum Stats

  • 3,851,951 Users
  • 2,264,054 Discussions
  • 7,904,915 Comments

Discussions

Maximum value for FOPEN_MAX in stdio.h?

807578
807578 Member Posts: 13,959 Green Ribbon
In the header file /usr/include/stdio.h, what is the maximum value possible for FOPEN_MAX (or _NFILE)? The compiler is actually 32-bit gcc. We are interested in how many file streams we can have open concurrently.

Comments

  • 807578
    807578 Member Posts: 13,959 Green Ribbon
    For 32bit applications, a stdio FILE structure represents the underlying file descriptor as an unsigned char, so the maximum number of open file descriptors is actually 255. It will also be limited by the value set by ulimit -n.

    Regards,
    Ralph

    SUN DTS
This discussion has been closed.