* [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
@ 2006-06-08 21:02 Armistead, Jason
2006-06-08 21:07 ` Johannes Schindelin
0 siblings, 1 reply; 7+ messages in thread
From: Armistead, Jason @ 2006-06-08 21:02 UTC (permalink / raw)
To: 'qemu-devel@nongnu.org'
Hi list
Looking at the code that was recently added
via http://lists.gnu.org/archive/html/qemu-devel/2006-06/msg00025.html
There were a lot of fsync() calls made, but this breaks the QEMU build
process on Win32 because fsync() is not available.
Suggest something like
#ifndef _WIN32
fsync(blah);
#else
_commit(blah);
#endif
which seems to work OK for me under MinGW / MSYS environment.
The _commit() function seems to be what Microsoft recommend to use, and it
compiles and runs OK with that in there, so I guess that MinGW is happy.
I'm still trying to get CVS up and running properly so I can contribute
patches in the right format.
Regards
Jason
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:02 [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync() Armistead, Jason
@ 2006-06-08 21:07 ` Johannes Schindelin
2006-06-08 21:14 ` Christian MICHON
2006-06-08 21:17 ` Paul Brook
0 siblings, 2 replies; 7+ messages in thread
From: Johannes Schindelin @ 2006-06-08 21:07 UTC (permalink / raw)
To: 'qemu-devel@nongnu.org'
Hi,
On Thu, 8 Jun 2006, Armistead, Jason wrote:
> #ifndef _WIN32
> fsync(blah);
> #else
> _commit(blah);
> #endif
Why not define it in config-host.mak like this:
--- configure.old 2006-06-08 23:06:48.000000000 +0200
+++ configure 2006-06-08 23:07:10.000000000 +0200
@@ -102,6 +102,7 @@
;;
MINGW32*)
mingw32="yes"
+CFLAGS="-Dfsync=_commit"
;;
FreeBSD)
bsd="yes"
Ciao,
Dscho
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:07 ` Johannes Schindelin
@ 2006-06-08 21:14 ` Christian MICHON
2006-06-08 21:17 ` Paul Brook
1 sibling, 0 replies; 7+ messages in thread
From: Christian MICHON @ 2006-06-08 21:14 UTC (permalink / raw)
To: qemu-devel
neat and concise!
bravos & kudos :)
On 6/8/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Why not define it in config-host.mak like this:
> +CFLAGS="-Dfsync=_commit"
--
Christian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:07 ` Johannes Schindelin
2006-06-08 21:14 ` Christian MICHON
@ 2006-06-08 21:17 ` Paul Brook
2006-06-08 21:37 ` Johannes Schindelin
1 sibling, 1 reply; 7+ messages in thread
From: Paul Brook @ 2006-06-08 21:17 UTC (permalink / raw)
To: qemu-devel
> Why not define it in config-host.mak like this:
>
> --- configure.old 2006-06-08 23:06:48.000000000 +0200
> +++ configure 2006-06-08 23:07:10.000000000 +0200
> @@ -102,6 +102,7 @@
> ;;
> MINGW32*)
> mingw32="yes"
> +CFLAGS="-Dfsync=_commit"
> ;;
> FreeBSD)
> bsd="yes"
No. This is what header files are for.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:17 ` Paul Brook
@ 2006-06-08 21:37 ` Johannes Schindelin
2006-06-08 21:50 ` Paul Brook
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Schindelin @ 2006-06-08 21:37 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel
Hi,
On Thu, 8 Jun 2006, Paul Brook wrote:
> > Why not define it in config-host.mak like this:
> >
> > --- configure.old 2006-06-08 23:06:48.000000000 +0200
> > +++ configure 2006-06-08 23:07:10.000000000 +0200
> > @@ -102,6 +102,7 @@
> > ;;
> > MINGW32*)
> > mingw32="yes"
> > +CFLAGS="-Dfsync=_commit"
> > ;;
> > FreeBSD)
> > bsd="yes"
>
> No. This is what header files are for.
Yes, but MS did not provide fsync in header files ;-)
Ciao,
Dscho
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:37 ` Johannes Schindelin
@ 2006-06-08 21:50 ` Paul Brook
2006-06-08 22:00 ` Johannes Schindelin
0 siblings, 1 reply; 7+ messages in thread
From: Paul Brook @ 2006-06-08 21:50 UTC (permalink / raw)
To: qemu-devel
> > > Why not define it in config-host.mak like this:
> > >
> > > --- configure.old 2006-06-08 23:06:48.000000000 +0200
> > > +++ configure 2006-06-08 23:07:10.000000000 +0200
> > > @@ -102,6 +102,7 @@
> > > ;;
> > > MINGW32*)
> > > mingw32="yes"
> > > +CFLAGS="-Dfsync=_commit"
> > > ;;
> > > FreeBSD)
> > > bsd="yes"
> >
> > No. This is what header files are for.
>
> Yes, but MS did not provide fsync in header files ;-)
I mean you should add a #define in a header file somewhere (eg. vl.h where
there are already similar things), not do it via a commandline option.
Paul
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync()
2006-06-08 21:50 ` Paul Brook
@ 2006-06-08 22:00 ` Johannes Schindelin
0 siblings, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2006-06-08 22:00 UTC (permalink / raw)
To: Paul Brook; +Cc: qemu-devel
Hi,
On Thu, 8 Jun 2006, Paul Brook wrote:
> I mean you should add a #define in a header file somewhere (eg. vl.h where
> there are already similar things), not do it via a commandline option.
You mean something like this?
--- vl.h.old 2006-06-08 23:58:55.000000000 +0200
+++ vl.h 2006-06-08 23:59:42.000000000 +0200
@@ -47,6 +47,7 @@
#endif
#ifdef _WIN32
+#define fsync _commit
#define lseek _lseeki64
#define ENOTSUP 4096
/* XXX: find 64 bit version */
However, I do not know if this breaks cygwin (if cygwin worked at all,
never checked).
Ciao,
Dscho
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-06-08 22:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08 21:02 [Qemu-devel] Recent patches for qemu block-cow.c etc breaks Win32 build becaus e of fsync() Armistead, Jason
2006-06-08 21:07 ` Johannes Schindelin
2006-06-08 21:14 ` Christian MICHON
2006-06-08 21:17 ` Paul Brook
2006-06-08 21:37 ` Johannes Schindelin
2006-06-08 21:50 ` Paul Brook
2006-06-08 22:00 ` Johannes Schindelin
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.