Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int _grow_handles( int new_count );

Description:
    The _grow_handles function increases the number of POSIX level files
    that are allowed to be open at one time.  The parameter new_count is the
    new requested number of files that are allowed to be opened.  The return
    value is the number that is allowed to be opened after the call.  This
    may be less than, equal to, or greater than the number requested.  If
    the number is less than, an error has occurred and the errno variable
    should be consulted for the reason.  If the number returned is greater
    than or equal to the number requested, the call was successful.

    Note that even if _grow_handles returns successfully, you still might
    not be able to open the requested number of files due to some system
    limit (e.g.  FILES= in the CONFIG.SYS file under DOS) or because some
    file handles are already in use (stdin, stdout, stderr, etc.).

Returns:
    The _grow_handles function returns the new number of file handles which
    may be open simultaneously.

Errors:
    When an error has occurred,  errno contains a value indicating the type
    of error that has been detected.

See Also:
    fdopen, fopen, open, tmpfile

Example:
    #include <stdio.h>

    FILE *fp[ 50 ];

    void main()
      {
        int hndl_count;
        int i;

        hndl_count = _NFILES;
        if( hndl_count < 50 ) {
            hndl_count = _grow_handles( 50 );
        }
        for( i = 0; i < hndl_count; i++ ) {
          fp[ i ] = tmpfile();
          if( fp[ i ] == NULL ) break;
          printf( "File %d successfully opened\n", i );
        }
        printf( "%d files were successfully opened\n", i );
      }

Classification:
    WATCOM

Systems:
    All

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson