Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual C++
Reference
Libraries Reference
Run-Time Library
 _setmaxstdio
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Run-Time Library Reference 
_setmaxstdio 

Sets a maximum for the number of simultaneously open files at the stdio level.

int _setmaxstdio(
   int newmax 
);

Parameters

newmax

New maximum for the number of simultaneously open files at the stdio level.

Returns newmax if successful; –1 otherwise.

If newmax is less than _IOB_ENTRIES or greater then 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 _doserrno, errno, _sys_errlist, and _sys_nerr.

The _setmaxstdio function changes the maximum value for the number of files that might be simultaneously open at the stdio level.

C run-time I/O now supports many more open files on Win32 platforms than in previous versions. Up to 2,048 files can be open simultaneously at the lowio level (that is, opened and accessed by means of the _open, _read, _write, and so forth family of I/O functions). Up to 512 files can be open simultaneously at the stdio level (that is, opened and accessed by means of the fopen, fgetc, fputc, and so forth family of functions). The limit of 512 open files at the stdio level can be increased to a maximum of 2,048 by means of the _setmaxstdio function.

Because stdio-level functions, such as fopen, are built on top of the lowio functions, the maximum of 2,048 is a hard upper limit for the number of simultaneously open files accessed through the C run-time library.

NoteNote

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

Routine Required header Compatibility

_setmaxstdio

<stdio.h>

ANSI, Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003

For more compatibility information, see Compatibility in the Introduction.

See _getmaxstdio for an example of using _setmaxstdio.

Not applicable. To call the standard C function, use PInvoke. For more information, see Platform Invoke Examples.

Reference

Stream I/O

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker