Christian Franke wrote:
Both O_DIRECT and F_NOCACHE are not part of POSIX, so there probably is no portable way without at least one more nasty #ifdef.

Yes, but O_DIRECT seems to be the "de facto standard" among unices, while F_NOCACHE is only used by Apple.


POSIX provides only O_SYNC, I don't know whether this has any effect on raw devices.

Ddrescue uses O_DIRECT only for the input file, so I think O_SYNC has no effect on it.


Interestingly, F_NOCACHE does also not appear in GNU dd (coreutils 6.9). Hmm...

What makes me think if I should contribute to spread the use of F_NOCACHE in detriment of the much more widely used O_DIRECT. I think it would be better that Apple implements O_DIRECT in Darwin, but I don't know what are the chances of this happening.


An alternative patch is attached. It does not require DARWIN defined, but relies on O_DIRECT undefined or defined as 0 in Darwin's includes.

Thanks for this excellent patch. I suppose that if some future Darwin's headers define O_DIRECT it means that Darwin supports O_DIRECT, so your patch should also work in such a future Darwin version. :)


BTW: On Cygwin, 1.6-pre2 builds OOTB and works.

Thanks for the feedback. Perhaps you would like to know that 1.6-pre3 is already released. ;)


Best regards,
Antonio.


_______________________________________________
Bug-ddrescue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-ddrescue

Reply via email to