Last Comment Bug 126937 - PR_GetSysfdTableMax incorrectly implemented on OS/2, PR_SetSysfdTableSize not implemented
: PR_GetSysfdTableMax incorrectly implemented on OS/2, PR_SetSysfdTableSize not...
Status: RESOLVED FIXED
:
Product: NSPR
Classification: Components
Component: NSPR (show other bugs)
: other
: x86 OS/2
: P3 normal (vote)
: 4.4.1
Assigned To: Wan-Teh Chang
: Wan-Teh Chang
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-21 00:27 PST by Julien Pierre
Modified: 2003-07-08 21:59 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Fix (3.03 KB, patch)
2003-03-06 07:37 PST, Mike Kaply [:mkaply]
jhpedemonte: review-
Details | Diff | Splinter Review
The right fix :) (2.81 KB, patch)
2003-07-08 10:11 PDT, Mike Kaply [:mkaply]
jhpedemonte: review+
Details | Diff | Splinter Review

Description Julien Pierre 2002-02-21 00:27:58 PST
On OS/2 this function assumes there is a max of 16K file handles open in the system.

The OS/2 control program doc says the maximum default is 50 for a process.
It can be queried with
APIRET rc = DosSetRelMaxFH(PLONG pcbReqCount, PULONG pcb CurMaxFH);

pcbReqCount is the signed number to be added or subtracted to the current max
file handle count for the process. Use 0 to query.
PULONG is a pointer to a ULONG where the current max for the process is returned.

The max can also be set in an absolute manner using 
APIRET rc = DosSetMaxFH(ULONG count);
Comment 1 Julien Pierre 2002-02-21 00:28:46 PST
FYI this is in mozilla/nsprpub/pr/src/io/prfile.c
Comment 2 Mike Kaply [:mkaply] 2003-03-06 07:37:09 PST
Created attachment 116430 [details] [diff] [review]
Fix

Here's an implementation of PR_GetSysfdTableMax and PR_SetSysfdTableSize for
OS/2
Comment 3 jhp (no longer active) 2003-07-08 10:01:55 PDT
Comment on attachment 116430 [details] [diff] [review]
Fix

Dude, you are returning NO_ERROR on success rather than the number of file
handles.
Comment 4 Mike Kaply [:mkaply] 2003-07-08 10:11:54 PDT
Created attachment 127250 [details] [diff] [review]
The right fix :)

I shouldn't even be checking RC. This API actually can't fail.
Comment 5 Mike Kaply [:mkaply] 2003-07-08 11:46:35 PDT
wtc, could you please check this into NSPR?

Thanks
Comment 6 Wan-Teh Chang 2003-07-08 21:59:44 PDT
Patch checked into the NSPR trunk (NSPR 4.4.1) and
NSPRPUB_PRE_4_2_CLIENT_BRANCH (Mozilla 1.5a).

Note You need to log in before you can comment on or make changes to this bug.