Jump to content

DosSetMaxFH (OS/2 1.x): Difference between revisions

From EDM2
Ak120 (talk | contribs)
Ak120 (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Description==
This call defines the maximum number of file handles for the current process.
This call defines the maximum number of file handles for the current process.  


==Syntax==
==Syntax==
<PRE>
  DosSetMaxFH (NumberHandles)
  DosSetMaxFH


    (NumberHandles)
</PRE>
==Parameters==
==Parameters==
; NumberHandles (USHORT) - input : Total number of file handles to be provided.
;NumberHandles (USHORT) - input : Total number of file handles to be provided.


==Return Code==
==Return Code==
rc (USHORT) - return
;rc (USHORT) - return:Return code descriptions are:
 
*0 NO_ERROR
Return code descriptions are:
*8 ERROR_NOT_ENOUGH_MEMORY
 
*87 ERROR_INVALID_PARAMETER
* 0         NO_ERROR  
* 8         ERROR_NOT_ENOUGH_MEMORY  
* 87       ERROR_INVALID_PARAMETER


==Remarks==
==Remarks==
OS/2 initially allots 20 file handles to a process, which is the recommended amount for an application. However, if the system limit has not been reached, this amount can be increased with DosSetMaxFH. When this call is made, all open file handles are preserved.  
OS/2 initially allots 20 file handles to a process, which is the recommended amount for an application. However, if the system limit has not been reached, this amount can be increased with DosSetMaxFH. When this call is made, all open file handles are preserved.


==Example Code==
==Bindings==
===C Binding===
===C===
<PRE>
<PRE>
#define INCL_DOSFILEMGR
#define INCL_DOSFILEMGR
Line 30: Line 23:
USHORT  rc = DosSetMaxFH(NumberHandles);
USHORT  rc = DosSetMaxFH(NumberHandles);


USHORT           NumberHandles; /* Number of file handles */
USHORT NumberHandles; /* Number of file handles */
 
USHORT rc;            /* return code */
USHORT           rc;            /* return code */
</PRE>
</PRE>


===MASM Binding===
===MASM===
<PRE>
<PRE>
EXTRN  DosSetMaxFH:FAR
EXTRN  DosSetMaxFH:FAR
Line 45: Line 37:
Returns WORD
Returns WORD
</PRE>
</PRE>
==Related Functions==
*


[[Category:The OS/2 API Project]]
[[Category:Dos16]]

Latest revision as of 07:48, 26 January 2020

This call defines the maximum number of file handles for the current process.

Syntax

DosSetMaxFH (NumberHandles)

Parameters

NumberHandles (USHORT) - input
Total number of file handles to be provided.

Return Code

rc (USHORT) - return
Return code descriptions are:
  • 0 NO_ERROR
  • 8 ERROR_NOT_ENOUGH_MEMORY
  • 87 ERROR_INVALID_PARAMETER

Remarks

OS/2 initially allots 20 file handles to a process, which is the recommended amount for an application. However, if the system limit has not been reached, this amount can be increased with DosSetMaxFH. When this call is made, all open file handles are preserved.

Bindings

C

#define INCL_DOSFILEMGR

USHORT  rc = DosSetMaxFH(NumberHandles);

USHORT  NumberHandles; /* Number of file handles */
USHORT  rc;            /* return code */

MASM

EXTRN  DosSetMaxFH:FAR
INCL_DOSFILEMGR     EQU 1

PUSH   WORD    NumberHandles ;Number of file handles
CALL   DosSetMaxFH

Returns WORD