delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/03/30/10:46:57

From: earnie_boyd AT hotmail DOT com (Earnie Boyd)
Subject: BUG: Mingw32: _O_TRUNC
30 Mar 1998 10:46:57 -0800 :
Message-ID: <19980326182829.16068.qmail.cygnus.gnu-win32@hotmail.com>
To: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp, J DOT J DOT vanderHeijden AT student DOT utwente DOT nl,
khan AT xraylith DOT wisc DOT edu, hgfernan AT usp DOT br, bartlee AT hotmail DOT com,
hezekiah AT rahul DOT net, gnu-win32 AT cygnus DOT com, earnie_boyd AT hotmail DOT com

The value defined in fcntl.h for _O_TRUNC is 0x0200 which equates to 512 
decimal.  When used in the open routine it gives an error value 22 which 
equates to "Invalid argument" from perror or defined as 
ERROR_BAD_COMMAND in the Windows32/Errors.h header.

I modified the value of _O_TRUNC to 0x0020 which equates to 32 decimal.  
No error is issued from the open routine.


I know the the SDK/misc/posix/fcntl.h defines it as 0x00000200 which is 
the same as 0x0200.  So, does the open routine in crtdll have a bug, or 
is the _O_TRUNC value actually wrong?

I'll do more testing with the 0x0020 value to see if it actually 
truncates the file.  I haven't looked at that as yet.  BTW, this was 
found with building/debugging RCS.  After changing this value to 0x0020 
I now have a functioning Mingw32 RCS.

-        \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd AT hotmail DOT com-
------ooo0O--O0ooo-------



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019