Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 2.72 KB

setmaxstdio.md

File metadata and controls

62 lines (41 loc) · 2.72 KB
description title ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords
Learn more about: _setmaxstdio
_setmaxstdio
05/21/2019
_setmaxstdio
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-stdio-l1-1-0.dll
DLLExport
apiref
setmaxstdio
_setmaxstdio
maximum open files
_setmaxstdio function
setmaxstdio function
open files, maximum

_setmaxstdio

Sets a maximum for the number of simultaneously open files at the stream I/O level.

Syntax

int _setmaxstdio(
   int new_max
);

Parameters

new_max
New maximum for the number of simultaneously open files at the stream I/O level.

Return value

Returns new_max if successful; -1 otherwise.

If new_max is less than _IOB_ENTRIES, or greater than the maximum number of handles available in the operating system, the invalid parameter handler is invoked, as described in Parameter validation. If execution is allowed to continue, this function returns -1 and sets errno to EINVAL.

For information about these and other error codes, see errno, _doserrno, _sys_errlist, and _sys_nerr.

Remarks

The _setmaxstdio function changes the maximum value for the number of files that may be open simultaneously at the stream I/O level.

C run-time I/O now supports up to 8,192 files open simultaneously at the low I/O level. This level includes files opened and accessed using the _open, _read, and _write family of I/O functions. By default, up to 512 files can be open simultaneously at the stream I/O level. This level includes files opened and accessed using the fopen, fgetc, and fputc family of functions. The limit of 512 open files at the stream I/O level can be increased to a maximum of 8,192 by use of the _setmaxstdio function.

Because stream I/O-level functions, such as fopen, are built on top of the low I/O-level functions, the maximum of 8,192 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library.

Note

This upper limit might be beyond what's supported by a particular Win32 platform and configuration.

Requirements

Routine Required header
_setmaxstdio <stdio.h>

For more compatibility information, see Compatibility.

Example

See _getmaxstdio for an example of using _setmaxstdio.

See also

Stream I/O