Skip to contentSkip to conversation

[5486] Define O_DSYNC as O_SYNC if necessary.

Qemu-devel Anthony Liguori 3 participants 6 messages Oct 14, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5486

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5486
Author:   aliguori
Date:     2008-10-14 18:00:38 +0000 (Tue, 14 Oct 2008)

Log Message:
-----------
Define O_DSYNC as O_SYNC if necessary.

O_DSYNC isn't available on OS X.

Modified Paths:
--------------
trunk/block-raw-posix.c

Modified: trunk/block-raw-posix.c
===================================================================

block-raw-posix.c +5 -0
@@ -73,6 +73,11 @@
 #define DEBUG_BLOCK_PRINT(formatCstr, args...)
 #endif
 
+/* OS X does not have O_DSYNC */
+#ifndef O_DSYNC
+#define O_SYNC
+#endif
+
 /* Approximate O_DIRECT with O_DSYNC if O_DIRECT isn't available */
 #ifndef O_DIRECT
 #define O_DIRECT O_DSYNC
#1 lore raw
Quoted 1 line · Anthony Liguori

Define O_DSYNC as O_SYNC if necessary.

...

block-raw-posix.c line 80

Quoted 5 lines
block-raw-posix.c +5 -0
+/* OS X does not have O_DSYNC */
+#ifndef O_DSYNC
+#define O_SYNC
+#endif
+

Not "+#define O_DSYNC O_SYNC"?

Robert Riebisch

Signature · 2 lines
BTTR Software
http://www.bttr-software.de/
#2 lore raw
Quoted 9 lines · Robert Riebisch
Quoted 2 lines · Anthony Liguori

Define O_DSYNC as O_SYNC if necessary.

...

Quoted 9 lines

block-raw-posix.c line 80

Quoted 6 lines
block-raw-posix.c +5 -0
+/* OS X does not have O_DSYNC */
+#ifndef O_DSYNC
+#define O_SYNC
+#endif
+

Not "+#define O_DSYNC O_SYNC"?

Sigh, sorry about that. Thanks for catching that.

Regards,

Anthony Liguori

Quoted 2 lines

Robert Riebisch

#3 lore raw
In reply to Robert Riebisch
Quoted 6 lines · Robert Riebisch
Quoted 1 line · Anthony Liguori

Define O_DSYNC as O_SYNC if necessary.

...

Quoted 7 lines

block-raw-posix.c line 80

Quoted 5 lines
block-raw-posix.c +5 -0
+/* OS X does not have O_DSYNC */
+#ifndef O_DSYNC
+#define O_SYNC
+#endif
+

Not "+#define O_DSYNC O_SYNC"?

OS X does not have O_SYNC too...

You can use fcntl() with F_NOCACHE to emulate O_DIRECT, I think.

BSD is not POSIX ;-)

Regards,
Laurent

----------------------- Laurent Vivier ---------------------- "The best way to predict the future is to invent it."
- Alan Kay

#4 lore raw
Quoted 17 lines · Laurent Vivier
Quoted 6 lines · Robert Riebisch
Quoted 1 line · Anthony Liguori

Define O_DSYNC as O_SYNC if necessary.

...

Quoted 7 lines

block-raw-posix.c line 80

Quoted 5 lines
block-raw-posix.c +5 -0
+/* OS X does not have O_DSYNC */
+#ifndef O_DSYNC
+#define O_SYNC
+#endif
+

Not "+#define O_DSYNC O_SYNC"?

Quoted 1 line

OS X does not have O_SYNC too...

Sorry, I'm wrong, it has O_SYNC, but "man open" doesn't give it...

Laurent
----------------------- Laurent Vivier ---------------------- "The best way to predict the future is to invent it."
- Alan Kay

#5 lore raw
Quoted 1 line · Laurent Vivier

Sorry, I'm wrong, it has O_SYNC, but "man open" doesn't give it...

Whew. I was worried there for a moment :-)

Regards,

Anthony Liguori

Quoted 11 lines

Laurent
----------------------- Laurent Vivier ---------------------- "The best way to predict the future is to invent it."
- Alan Kay