* [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. @ 2009-09-20 0:58 G 3 2009-09-30 19:16 ` Anthony Liguori 0 siblings, 1 reply; 9+ messages in thread From: G 3 @ 2009-09-20 0:58 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 622 bytes --] This patch fixes a problem in the file cutils.c that prevents qemu from being built on Mac OS X. This patch makes sure fsync is used instead. Signed-off-by: John Arbuckle <programmingkidx@gmail.com> --- cutils.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cutils.c b/cutils.c index 7a22346..84eabf2 100644 --- a/cutils.c +++ b/cutils.c @@ -124,7 +124,7 @@ int qemu_fls(int i) */ int qemu_fdatasync(int fd) { -#ifdef _POSIX_SYNCHRONIZED_IO +#if ( defined(_POSIX_SYNCHRONIZED_IO) && !defined(__APPLE__) ) return fdatasync(fd); #else return fsync(fd); -- 1.6.4.2 [-- Attachment #2: Type: text/html, Size: 4225 bytes --] ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-09-20 0:58 [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X G 3 @ 2009-09-30 19:16 ` Anthony Liguori 2009-10-01 15:30 ` G 3 0 siblings, 1 reply; 9+ messages in thread From: Anthony Liguori @ 2009-09-30 19:16 UTC (permalink / raw) To: G 3; +Cc: qemu-devel G 3 wrote: > This patch fixes a problem in the file cutils.c that prevents qemu > from being built on Mac OS X. This patch makes sure fsync is used instead. What is this against? It doesn't apply to git. > Signed-off-by: John Arbuckle <programmingkidx@gmail.com > <mailto:programmingkidx@gmail.com>> > > --- > cutils.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/cutils.c b/cutils.c > index 7a22346..84eabf2 100644 > --- a/cutils.c > +++ b/cutils.c > @@ -124,7 +124,7 @@ int qemu_fls(int i) > */ > int qemu_fdatasync(int fd) > { > -#ifdef _POSIX_SYNCHRONIZED_IO > +#if ( defined(_POSIX_SYNCHRONIZED_IO) && !defined(__APPLE__) ) > return fdatasync(fd); > #else > return fsync(fd); > -- > 1.6.4.2 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-09-30 19:16 ` Anthony Liguori @ 2009-10-01 15:30 ` G 3 2009-10-01 16:13 ` Blue Swirl 0 siblings, 1 reply; 9+ messages in thread From: G 3 @ 2009-10-01 15:30 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 386 bytes --] On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: > G 3 wrote: >> This patch fixes a problem in the file cutils.c that prevents qemu >> from being built on Mac OS X. This patch makes sure fsync is used >> instead. > > What is this against? It doesn't apply to git. This is against the savannah repository: git:// git.savannah.nongnu.org/qemu.git. Is this the wrong repository? [-- Attachment #2: Type: text/html, Size: 1151 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-10-01 15:30 ` G 3 @ 2009-10-01 16:13 ` Blue Swirl 2009-12-08 14:35 ` Pierre Riteau 0 siblings, 1 reply; 9+ messages in thread From: Blue Swirl @ 2009-10-01 16:13 UTC (permalink / raw) To: G 3; +Cc: qemu-devel On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> wrote: > On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: > > G 3 wrote: > > This patch fixes a problem in the file cutils.c that prevents qemu from > being built on Mac OS X. This patch makes sure fsync is used instead. > > What is this against? It doesn't apply to git. > > This is against the savannah > repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong > repository? The patch should not be needed since 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-10-01 16:13 ` Blue Swirl @ 2009-12-08 14:35 ` Pierre Riteau 2009-12-08 18:35 ` Blue Swirl 0 siblings, 1 reply; 9+ messages in thread From: Pierre Riteau @ 2009-12-08 14:35 UTC (permalink / raw) To: Blue Swirl; +Cc: G 3, qemu-devel On 1 oct. 2009, at 18:13, Blue Swirl wrote: > On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> wrote: >> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >> >> G 3 wrote: >> >> This patch fixes a problem in the file cutils.c that prevents qemu from >> being built on Mac OS X. This patch makes sure fsync is used instead. >> >> What is this against? It doesn't apply to git. >> >> This is against the savannah >> repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong >> repository? > > The patch should not be needed since > 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? Sorry to dig up this old thread, but I just tried compiling qemu on my Mac and I see a warning when it compiles: cutils.c: In function ‘qemu_fdatasync’: cutils.c:128: warning: implicit declaration of function ‘fdatasync’ I'm running OS X 10.6.2 with Xcode 3.2.1. Why this behavior? Because the configure check introduced in 5f6b9e finds that fdatasync is available. Although the fdatasync function is not referenced in the standard includes (hence the warning), it is present as a syscall: /usr/include/sys/syscall.h:#define SYS_fdatasync 187 Moreover, a fdatasync symbol is available through libSystem (which is why the linking done by the configure check works). It's not clear what is the best solution here. Googling the issue, some projects add the fdatasync prototype to their headers to avoid warnings. Other assume that fdatasync could be a noop and fall back to fsync. I would go with the second second: the function is not defined, there is no man page, let's assume it doesn't work. To fix the configure check we can simply add -Werror to the compile_prog cflags (I will send a patch if you agree with this). -- Pierre Riteau -- http://perso.univ-rennes1.fr/pierre.riteau/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-12-08 14:35 ` Pierre Riteau @ 2009-12-08 18:35 ` Blue Swirl 2009-12-08 21:02 ` Pierre Riteau 2009-12-08 23:01 ` Alexander Graf 0 siblings, 2 replies; 9+ messages in thread From: Blue Swirl @ 2009-12-08 18:35 UTC (permalink / raw) To: Pierre Riteau; +Cc: G 3, qemu-devel On Tue, Dec 8, 2009 at 4:35 PM, Pierre Riteau <Pierre.Riteau@irisa.fr> wrote: > On 1 oct. 2009, at 18:13, Blue Swirl wrote: > >> On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> wrote: >>> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >>> >>> G 3 wrote: >>> >>> This patch fixes a problem in the file cutils.c that prevents qemu from >>> being built on Mac OS X. This patch makes sure fsync is used instead. >>> >>> What is this against? It doesn't apply to git. >>> >>> This is against the savannah >>> repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong >>> repository? >> >> The patch should not be needed since >> 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? > > Sorry to dig up this old thread, but I just tried compiling qemu on my Mac and I see a warning when it compiles: > cutils.c: In function ‘qemu_fdatasync’: > cutils.c:128: warning: implicit declaration of function ‘fdatasync’ > > I'm running OS X 10.6.2 with Xcode 3.2.1. > > Why this behavior? Because the configure check introduced in 5f6b9e finds that fdatasync is available. > Although the fdatasync function is not referenced in the standard includes (hence the warning), it is present as a syscall: > /usr/include/sys/syscall.h:#define SYS_fdatasync 187 > Moreover, a fdatasync symbol is available through libSystem (which is why the linking done by the configure check works). > > It's not clear what is the best solution here. Googling the issue, some projects add the fdatasync prototype to their headers to avoid warnings. > Other assume that fdatasync could be a noop and fall back to fsync. > > I would go with the second second: the function is not defined, there is no man page, let's assume it doesn't work. > To fix the configure check we can simply add -Werror to the compile_prog cflags (I will send a patch if you agree with this). I'd rather add something like #ifdef __APPLE__ exit(1); #endif (or the shell equivalent for configure) and a comment with your explanation. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-12-08 18:35 ` Blue Swirl @ 2009-12-08 21:02 ` Pierre Riteau 2009-12-08 23:01 ` Alexander Graf 1 sibling, 0 replies; 9+ messages in thread From: Pierre Riteau @ 2009-12-08 21:02 UTC (permalink / raw) To: Blue Swirl; +Cc: G 3, qemu-devel On 8 déc. 2009, at 19:35, Blue Swirl wrote: > On Tue, Dec 8, 2009 at 4:35 PM, Pierre Riteau <Pierre.Riteau@irisa.fr> wrote: >> On 1 oct. 2009, at 18:13, Blue Swirl wrote: >> >>> On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> wrote: >>>> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >>>> >>>> G 3 wrote: >>>> >>>> This patch fixes a problem in the file cutils.c that prevents qemu from >>>> being built on Mac OS X. This patch makes sure fsync is used instead. >>>> >>>> What is this against? It doesn't apply to git. >>>> >>>> This is against the savannah >>>> repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong >>>> repository? >>> >>> The patch should not be needed since >>> 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? >> >> Sorry to dig up this old thread, but I just tried compiling qemu on my Mac and I see a warning when it compiles: >> cutils.c: In function ‘qemu_fdatasync’: >> cutils.c:128: warning: implicit declaration of function ‘fdatasync’ >> >> I'm running OS X 10.6.2 with Xcode 3.2.1. >> >> Why this behavior? Because the configure check introduced in 5f6b9e finds that fdatasync is available. >> Although the fdatasync function is not referenced in the standard includes (hence the warning), it is present as a syscall: >> /usr/include/sys/syscall.h:#define SYS_fdatasync 187 >> Moreover, a fdatasync symbol is available through libSystem (which is why the linking done by the configure check works). >> >> It's not clear what is the best solution here. Googling the issue, some projects add the fdatasync prototype to their headers to avoid warnings. >> Other assume that fdatasync could be a noop and fall back to fsync. >> >> I would go with the second second: the function is not defined, there is no man page, let's assume it doesn't work. >> To fix the configure check we can simply add -Werror to the compile_prog cflags (I will send a patch if you agree with this). > > I'd rather add something like > #ifdef __APPLE__ > exit(1); > #endif > (or the shell equivalent for configure) and a comment with your explanation. I'm fine with that too. -- Pierre Riteau -- http://perso.univ-rennes1.fr/pierre.riteau/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-12-08 18:35 ` Blue Swirl 2009-12-08 21:02 ` Pierre Riteau @ 2009-12-08 23:01 ` Alexander Graf 2009-12-10 16:49 ` Pierre Riteau 1 sibling, 1 reply; 9+ messages in thread From: Alexander Graf @ 2009-12-08 23:01 UTC (permalink / raw) To: Blue Swirl; +Cc: G 3, qemu-devel@nongnu.org, Pierre Riteau Am 08.12.2009 um 19:35 schrieb Blue Swirl <blauwirbel@gmail.com>: > On Tue, Dec 8, 2009 at 4:35 PM, Pierre Riteau > <Pierre.Riteau@irisa.fr> wrote: >> On 1 oct. 2009, at 18:13, Blue Swirl wrote: >> >>> On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> >>> wrote: >>>> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >>>> >>>> G 3 wrote: >>>> >>>> This patch fixes a problem in the file cutils.c that prevents >>>> qemu from >>>> being built on Mac OS X. This patch makes sure fsync is used >>>> instead. >>>> >>>> What is this against? It doesn't apply to git. >>>> >>>> This is against the savannah >>>> repository: git://git.savannah.nongnu.org/qemu.git. Is this the >>>> wrong >>>> repository? >>> >>> The patch should not be needed since >>> 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a >>> problem? >> >> Sorry to dig up this old thread, but I just tried compiling qemu on >> my Mac and I see a warning when it compiles: >> cutils.c: In function ‘qemu_fdatasync’: >> cutils.c:128: warning: implicit declaration of function ‘fdatasync’ >> >> I'm running OS X 10.6.2 with Xcode 3.2.1. >> >> Why this behavior? Because the configure check introduced in 5f6b9e >> finds that fdatasync is available. >> Although the fdatasync function is not referenced in the standard >> includes (hence the warning), it is present as a syscall: >> /usr/include/sys/syscall.h:#define SYS_fdatasync 187 >> Moreover, a fdatasync symbol is available through libSystem (which >> is why the linking done by the configure check works). >> >> It's not clear what is the best solution here. Googling the issue, >> some projects add the fdatasync prototype to their headers to avoid >> warnings. >> Other assume that fdatasync could be a noop and fall back to fsync. >> >> I would go with the second second: the function is not defined, >> there is no man page, let's assume it doesn't work. >> To fix the configure check we can simply add -Werror to the >> compile_prog cflags (I will send a patch if you agree with this). > > I'd rather add something like > #ifdef __APPLE__ > exit(1); > #endif > (or the shell equivalent for configure) and a comment with your > explanation. > > I guess that's wrong. With --disable-werror it compiles just fine. So I think we're rather missing a header include. Alex ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X. 2009-12-08 23:01 ` Alexander Graf @ 2009-12-10 16:49 ` Pierre Riteau 0 siblings, 0 replies; 9+ messages in thread From: Pierre Riteau @ 2009-12-10 16:49 UTC (permalink / raw) To: Alexander Graf; +Cc: Blue Swirl, G 3, qemu-devel@nongnu.org On 9 déc. 2009, at 00:01, Alexander Graf wrote: > > Am 08.12.2009 um 19:35 schrieb Blue Swirl <blauwirbel@gmail.com>: > >> On Tue, Dec 8, 2009 at 4:35 PM, Pierre Riteau <Pierre.Riteau@irisa.fr> wrote: >>> On 1 oct. 2009, at 18:13, Blue Swirl wrote: >>> >>>> On Thu, Oct 1, 2009 at 6:30 PM, G 3 <programmingkidx@gmail.com> wrote: >>>>> On Sep 30, 2009, at 3:16 PM, Anthony Liguori wrote: >>>>> >>>>> G 3 wrote: >>>>> >>>>> This patch fixes a problem in the file cutils.c that prevents qemu from >>>>> being built on Mac OS X. This patch makes sure fsync is used instead. >>>>> >>>>> What is this against? It doesn't apply to git. >>>>> >>>>> This is against the savannah >>>>> repository: git://git.savannah.nongnu.org/qemu.git. Is this the wrong >>>>> repository? >>>> >>>> The patch should not be needed since >>>> 5f6b9e8fd5b9516170e582d9b6c27c98519a8031. Do you still have a problem? >>> >>> Sorry to dig up this old thread, but I just tried compiling qemu on my Mac and I see a warning when it compiles: >>> cutils.c: In function ‘qemu_fdatasync’: >>> cutils.c:128: warning: implicit declaration of function ‘fdatasync’ >>> >>> I'm running OS X 10.6.2 with Xcode 3.2.1. >>> >>> Why this behavior? Because the configure check introduced in 5f6b9e finds that fdatasync is available. >>> Although the fdatasync function is not referenced in the standard includes (hence the warning), it is present as a syscall: >>> /usr/include/sys/syscall.h:#define SYS_fdatasync 187 >>> Moreover, a fdatasync symbol is available through libSystem (which is why the linking done by the configure check works). >>> >>> It's not clear what is the best solution here. Googling the issue, some projects add the fdatasync prototype to their headers to avoid warnings. >>> Other assume that fdatasync could be a noop and fall back to fsync. >>> >>> I would go with the second second: the function is not defined, there is no man page, let's assume it doesn't work. >>> To fix the configure check we can simply add -Werror to the compile_prog cflags (I will send a patch if you agree with this). >> >> I'd rather add something like >> #ifdef __APPLE__ >> exit(1); >> #endif >> (or the shell equivalent for configure) and a comment with your explanation. >> >> > > > I guess that's wrong. With --disable-werror it compiles just fine. So I think we're rather missing a header include. > > Alex Compiling just fine doesn't necessarily mean thatt qemu will run fine and do what we want it to do. But in this case it may: i took a look at the XNU sources (I didn't think about this solution first, I forgot it was open source...) and fdatasync appears to be implemented. So I guess that we can probably add the missing prototype in one of our header? -- Pierre Riteau -- http://perso.univ-rennes1.fr/pierre.riteau/ ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-12-10 16:49 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-09-20 0:58 [Qemu-devel] [PATCH] Fixes a bug that tries to use the unimplemented function fdatasync on Mac OS X G 3 2009-09-30 19:16 ` Anthony Liguori 2009-10-01 15:30 ` G 3 2009-10-01 16:13 ` Blue Swirl 2009-12-08 14:35 ` Pierre Riteau 2009-12-08 18:35 ` Blue Swirl 2009-12-08 21:02 ` Pierre Riteau 2009-12-08 23:01 ` Alexander Graf 2009-12-10 16:49 ` Pierre Riteau
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).