bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ddrescue] Patch to support -d on Darwin and Mac OS X


From: Antonio Diaz Diaz
Subject: Re: [Bug-ddrescue] Patch to support -d on Darwin and Mac OS X
Date: Sat, 01 Sep 2007 13:10:24 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]