[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] MiNTlibs for PureC



On Sun, Sep 12, 1999 at 12:24:36PM +0200, Julian Reschke wrote:
> > The reason for this behaviour is to be found in fcntl.h #87:
> >
> > /* smallest valid gemdos handle */
> > /* note handle is only word (16 bit) negative, not long negative,
> >    and since Fopen etc are declared as returning long in osbind.h
> >    the sign-extension will not happen -- thanks ers
> > */
> > #ifdef __MSHORT__
> > #define __SMALLEST_VALID_HANDLE (-3)
> > #else
> > #define __SMALLEST_VALID_HANDLE (0)
> > #endif
> >
> > So the -1 would have to be rplaced by __SMALLEST_VALID_HANDLE -1
> > whenever a file-handle is returned !?
> >
> > Sure there are devices with negative handles but are they returned by
> > open et al and/or does mintlib have to support this?
> 
> If open() is supposed to support these devices (and I think it is), the only
> clean way to fix this seems to map the special handle -1 to something else.
> This has the drawback that this "other" handle can't be used with the
> standard GEMDOS calls, but maybe one can live with that...

Hm, a few minutes ago I have changed every occurence of 
"return __SMALLEST_VALID_HANDLE -1" by "return -1" in open.c.
Will this break existing code?  Anyway, having open() return 
anything else but either -1 or a non-negative file handle is
a plain bug in my eyes.  So what should I do?

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000/
mailto:gufl0000@stud.uni-sb.de