Re: feature request: O_DIRECTIO could be used on Tru64

2006-02-07 Thread Jim Meyering
"Lemley James - jlemle" <[EMAIL PROTECTED]> wrote:
> Hi coreutils fans, while attempting to use direct I/O with dd on Tru64
> 5.1B, I discovered that Tru64 doesn't define O_DIRECT as coreutils 5.93
> is expecting, but does define O_DIRECTIO which seems to act as I expect
> direct I/O to act.
>
> The open(2) man page states:  O_DIRECTIO [Tru64 UNIX]
>   Enables direct I/O on a file.
>
> Making this change to src/system.h allows the flag "direct" to be used
> with dd on Tru64, and also appears to affect how the coreutil "shred"
> opens a file.

Thanks for the patch.
I've applied one that's equivalent:

2006-02-07  Jim Meyering  <[EMAIL PROTECTED]>

* src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
is on Tru64), define O_DIRECT to that.  Patch From James Lemley.

Index: src/system.h
===
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -p -u -r1.141 -r1.142
--- src/system.h11 Jan 2006 08:22:34 -  1.141
+++ src/system.h7 Feb 2006 22:32:50 -   1.142
@@ -156,6 +156,11 @@ initialize_exit_failure (int status)
 # define R_OK 4
 #endif
 
+#if !defined O_DIRECT && defined O_DIRECTIO
+/* Tru64 spells it `O_DIRECTIO'.  */
+# define O_DIRECT O_DIRECTIO
+#endif
+
 #if !defined O_DIRECT
 # define O_DIRECT 0
 #endif


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


feature request: O_DIRECTIO could be used on Tru64

2006-02-07 Thread Lemley James - jlemle
Hi coreutils fans, while attempting to use direct I/O with dd on Tru64
5.1B, I discovered that Tru64 doesn't define O_DIRECT as coreutils 5.93
is expecting, but does define O_DIRECTIO which seems to act as I expect
direct I/O to act. 

The open(2) man page states:  O_DIRECTIO [Tru64 UNIX]
  Enables direct I/O on a file.

Making this change to src/system.h allows the flag "direct" to be used
with dd on Tru64, and also appears to affect how the coreutil "shred"
opens a file.

Simple change follows; you may wish to implement differently.  
--

--- system.h.origWed Sep 28 17:11:06 2005
+++ system.hTue Feb  7 16:04:32 2006
@@ -157,7 +157,12 @@
 #endif
 
 #if !defined O_DIRECT
+/* Tru64 has this defined as O_DIRECTIO */
+#if !defined O_DIRECTIO
 # define O_DIRECT 0
+#else 
+# define O_DIRECT O_DIRECTIO
+#endif
 #endif
 
 #if !defined O_DSYNC

--
Thanks, 
James Lemley
***
The information contained in this communication is confidential, is
intended only for the use of the recipient named above, and may be legally
privileged.

If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.

If you have received this communication in error, please resend this
communication to the sender and delete the original message or any copy
of it from your computer system.

Thank You.



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils