All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Raymond <cerbere@gmail.com>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/6] Fix incorrect check for fdatasync() in configure
Date: Sun, 29 May 2011 11:46:38 -0400	[thread overview]
Message-ID: <BANLkTikpOwSnNS7Y4B8+ZAO=dT-JimQTAw@mail.gmail.com> (raw)
In-Reply-To: <E3869720-39F6-4B6C-AD9A-E566DEE2005E@web.de>

Hi Andreas,

According to this excerpt from The Open Group Base Specifications
Issue 6 (http://pubs.opengroup.org/onlinepubs/009695399/basedefs/unistd.h.html),
'>0' indeed means that the functionality is implemented and can be
used.
----8<----
The following symbolic constants, if defined in <unistd.h>, shall have
a value of -1, 0, or greater, unless otherwise specified below. If
these are undefined, the fpathconf(), pathconf(), or sysconf()
functions can be used to determine whether the option is provided for
a particular invocation of the application.

If a symbolic constant is defined with the value -1, the option is not
supported. Headers, data types, and function interfaces required only
for the option need not be supplied. An application that attempts to
use anything associated only with the option is considered to be
requiring an extension.

If a symbolic constant is defined with a value greater than zero, the
option shall always be supported when the application is executed. All
headers, data types, and functions shall be present and shall operate
as specified.

If a symbolic constant is defined with the value zero, all headers,
data types, and functions shall be present. The application can check
at runtime to see whether the option is supported by calling
fpathconf(), pathconf(), or sysconf() with the indicated name
parameter.
----8<----

Alexandre

On Sun, May 29, 2011 at 10:50 AM, Andreas Färber <andreas.faerber@web.de> wrote:
> Am 27.05.2011 um 19:22 schrieb Alexandre Raymond:
>
>> For some reason, darwin provides a symbol for fdatasync(), but
>> doesn't officially support it.
>>
>> The manpage for fdatasync on Linux states the following:
>>
>> "On POSIX  systems  on  which fdatasync() is available,
>> _POSIX_SYNCHRONIZED_IO is defined in <unistd.h> to a value greater than
>> 0."
>
> The Open Group Base Specification Issue 7 says this on fdatasync():
>
> "The functionality shall be equivalent to fsync() with the symbol
> _POSIX_SYNCHRONIZED_IO defined, with the exception that all I/O operations
> shall be completed as defined for synchronized I/O data integrity
> completion."
>
> On unistd.h it goes on to say:
>
> "_POSIX_SYNCHRONIZED_IO
> [SIO]
> The implementation supports the Synchronized Input and Output option. If
> this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or
> 200809L."
>
> The change history has nothing on that define and its value -1, so I'm not
> convinced that this really is The Right Way to check.
>
>> In fact, unistd.h defines this value to "-1", at least on OSX 10.6.7.
>>
>> Add this check to the configure file.
>>
>> Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
>
> Andreas
>
>> ---
>> configure |    8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/configure b/configure
>> index a318d37..b21ef75 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2477,7 +2477,13 @@ fi
>> fdatasync=no
>> cat > $TMPC << EOF
>> #include <unistd.h>
>> -int main(void) { return fdatasync(0); }
>> +int main(void) {
>> +#if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0
>> +return fdatasync(0);
>> +#else
>> +#abort Not supported
>> +#endif
>> +}
>> EOF
>> if compile_prog "" "" ; then
>>    fdatasync=yes
>> --
>> 1.7.5
>
>

  reply	other threads:[~2011-05-29 15:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 17:22 [Qemu-devel] [PATCH 0/6] Fix compilation issues under darwin Alexandre Raymond
2011-05-27 17:22 ` [Qemu-devel] [PATCH 1/6] Fix incorrect check for fdatasync() in configure Alexandre Raymond
2011-05-29 14:50   ` Andreas Färber
2011-05-29 15:46     ` Alexandre Raymond [this message]
2011-05-29 17:05       ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 2/6] Cocoa: avoid displaying window when command-line contains '-h' Alexandre Raymond
2011-05-28 15:05   ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 3/6] Fix compilation warning due to incorrectly specified type Alexandre Raymond
2011-05-27 17:42   ` Stefan Weil
2011-05-29 15:02     ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 4/6] Fix missing prototype under cocoa for qemu_main Alexandre Raymond
2011-05-29 15:11   ` Andreas Färber
2011-05-29 19:58     ` [Qemu-devel] [PATCH] cocoa: Provide central qemu_main() prototype Andreas Färber
2011-05-29 23:53       ` Alexandre Raymond
2011-06-02 11:33         ` Andreas Färber
2011-06-09 18:30       ` Andreas Färber
2011-05-27 17:22 ` [Qemu-devel] [PATCH 5/6] Remove warning in printf due to type mismatch Alexandre Raymond
2011-05-27 17:35   ` Stefan Weil
2011-05-27 19:11     ` Markus Armbruster
2011-05-27 20:44       ` Stefan Weil
2011-05-27 22:10         ` Alexandre Raymond
2011-05-28  6:55           ` Paolo Bonzini
2011-05-28  8:19             ` Stefan Weil
2011-05-27 17:22 ` [Qemu-devel] [PATCH 6/6] Avoid compilation warning regarding kvm under darwin Alexandre Raymond
2011-05-27 17:39   ` Stefan Weil
2011-05-28 14:55 ` [Qemu-devel] [PATCH 0/6] Fix compilation issues " Andreas Färber
2011-05-28 19:41   ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTikpOwSnNS7Y4B8+ZAO=dT-JimQTAw@mail.gmail.com' \
    --to=cerbere@gmail.com \
    --cc=andreas.faerber@web.de \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.