[SunHELP] Solaris 7 and FOPEN_MAX

Jarrett Carver sunhelp at sunhelp.org
Fri Jan 4 17:36:03 CST 2002


We are having trouble with Remedy. I beleive it has to do with:

Remedy has learned that the OS call we use to open files has a
limitation. The call used is fopen or fdopen. Sun has indicated that
these calls will work incorrectly if the file descriptor number is
.255. If the file descriptor number is > 255 the ARERR 316 willoccur.
This can be directly correlated to the Solaris limitation

This appears to be the problem, because when I truss I get:

#truss -o /tmp/remedy.truss -f -p 440
[ Do some qureies that fail ]
^C
#more /tmp/remedy.truss
440:    getpid()                                        = 440 [437]
440:    lstat64("/var/tmp/ARpenQSBi9fa3a", 0xFFBEF310)  Err#2 ENOENT
440:    open("/var/tmp/ARpenQSBi9fa3a", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 
299
440:    close(299)

This seemed to be the answere, but then I read on the Solaris IAQ:

d. API limits (ref:Solaris Internals)
       2. Solaris >= 7
          a. stdio(3s) - 256 (32-bit) / 65536 (64-bit)
          b. select(3c) - 1024 (32-bit) / 65536 (64-bit)
             1. 65536 limit is attainable on 32-bit Solaris 7
             2. #define FD_SETSIZE 65536   ; prior to includes

We are running Solaris 7 in 64 bit:

#optisa `isalist`
sparcv9+vis
#

So I looked at the stdio(3S):

     The integer constant FOPEN_MAX specifies the minimum  number
     of  files  that  the  implementation  guarantees can be open
     simultaneously. Note that no more  than  255  files  may  be
     opened  using  fopen(),  and only file descriptors 0 through
     255 can be used in a stream.

My question is on Solaris 7 running 64-bit which is the limit 255 or 65536, 
is there a way around this. Could it be a problem with the 32-bit remedy 
calling the 32-bit fopen instead of the 64-bit fopen, if that is even 
possible? Any help appreciated. Thanks.



Jarrett Carver           http://www.geocities.com/solarboyz1
solarboyz1 at hotmail.com   Unix/NT Systems Administrator
___________________________________________________________
"When people sigh 'Life is hard', I am always tempted to
ask 'compared to what?'".man fop
               - Sydney Harris
____________________________________________________________


_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail. 
http://www.hotmail.com



More information about the SunHELP mailing list