Subject: Re: BUG: open() O_ flags one bit too high
From: "Victor Szel" <[email-masked]>
To: <[email-masked]>
Date: Sun, 5 Sep 1999 10:23:29 +0200

Chris,

> >#ifdef __CYGWIN__
> >/* TODO: Get Cygwin fixed so that this bug fix won't be needed */
> >static inline int FixCygwinIOflags( int flags )
> >{
> >   /* Starting with O_CREAT, the Cygwin I/O flags are 1 bit too high */
> >   return ( ( flags & 0x1FF00 ) >> 1 ) | ( flags & 0xFF );
> >}
> >#endif
> 
> System O_CREAT (octal) O_CREAT (hex)
> ----------------------------------------------------
> Cygwin 01000 0x200
> Digital UNIX 01000 0x200
> FreeBSD 01000 0x200
> Irix 00400 0x100
> Linux 00100 0x040
> SCO UNIX 3.2 00400 0x100
> Solaris 00400 0x100
> Ultrix 01000 0x200
> 
> What was the bug again?

It could be that it's some sort of feature/bug in WinNT and not in Cygwin then, 
since the O_CREAT flag passed to open() was 0x200, but open always 
returned -1 in this case. WinNT 4.0 SP5 and Win2000 Build 2072 is the 
same in this respect. If this is the case, a workaround in Cygwin could be 
worth considering.

Victor Szel

--
Want to unsubscribe from this list?
Send a message to [email-masked]