Subject: | |
From: | |
Reply To: | |
Date: | Wed, 3 May 2000 19:02:15 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Gavin,
Thanks for your help.
> > I have been given a program to debug which is returning a file
> > error 2 (Illegal capability) from its FOPEN procedure on only one
> > of two files being opened by the function.
> You mean that FOPEN returns zero and CCL, and a subsequent call to FCHECK
> returns the error 2?
Yes, the FOPEN returns a filenum of zero, with Status[0]=CCL. A subsequent
call
to FCHECK returns errCode=2 and Status[0]=CCE.
> > The function (a
> > generic open procedure) is passed the name of the file to open,
> > and a series of options (file attributes, access options, record
> > lengths for build, etc). Two calls to the function (with
> > parameters identical except for file name) are made back to back.
> Things offhand which would result in this error would be specifying a
> negative file code, or the NOWAIT bit in the AOPTIONS, when not running in
> privileged mode.
aoption.as.no_wait was one of seven items in the foption and aoption
struct's
which had been allowed to default. Initializing them to the values
specified in
the Intrinsics Manual as default seems to have solved the problem.
> Just because the program has PM capability doesn't mean
> that it is running in PM at the time of the FOPEN call (which would
require
> a call to GETPRIVMODE, or an "option privileged" code segment or procedure
> (details dependent on the language you're using)).
There is no call to GETPRIVMODE in the program, so the program is running
in user mode.
> But this is almost
> certainly an indication of a program bug rather than a need for even more
> capability. Sounds like some parameter might not be the right size, etc.
Or defaulting to a value other than expected.
> Are you sure that FOPEN is declared as an "INTRINSIC"? What language is
it?
Yes there is a "#pragma intrinsic FOPEN" statement at the top of the
program,
which is written in C.
Thanks again,
Rs~
|
|
|