]> mj.ucw.cz Git - libucw.git/commitdiff
Fail when O_DIRECT requested on Darwin
authorMichal Vaner <vorner@ucw.cz>
Fri, 28 Nov 2008 13:13:24 +0000 (14:13 +0100)
committerMichal Vaner <vorner@ucw.cz>
Fri, 28 Nov 2008 13:13:24 +0000 (14:13 +0100)
Darwin does not support direct IO.

ucw/perl/UCW/Configure/C.pm

index 026aef6fe76da55c29a2cba62e9ae0117aa9b09f..4e3fbf90808a6d7f5ac467496f94fc2ac259630e 100644 (file)
@@ -256,7 +256,11 @@ if (IsSet("CONFIG_DARWIN")) {
        Append("COPT" => "-I/sw/include");
        # Fill in some constants not found in the system header files
        Set("SOL_TCP" => 6);            # missing in /usr/include/netinet/tcp.h
-       Set("O_DIRECT" => 0);           # Darwin doesn't support direct IO, so make Sherlock at least compilable
+       if(IsGiven("O_DIRECT") && IsSet("O_DIRECT") && (Get("O_DIRECT") != 0))
+       {
+               Fail("Darwin does not support direct IO");
+       }
+       Set("O_DIRECT" => 0);
 }
 
 ### Writing C headers with configuration ###