Re: fsync under win32 - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: fsync under win32
Date
Msg-id 200506161753.j5GHrxG03526@candle.pha.pa.us
Whole thread Raw
In response to fsync under win32  (Andreas Pflug <pgadmin@pse-consulting.de>)
List pgsql-patches
Andreas Pflug wrote:
> The latest fsync patch broke win32 build. There's no fsync under win32,
> so the #define fsync(fd) _commit(fd) which was removed from port/win32.h
> in version 1.45 is still necessary.
>
> Regards,
> Andreas

> Index: win32.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/include/port/win32.h,v
> retrieving revision 1.45
> diff -u -r1.45 win32.h
> --- win32.h    20 May 2005 14:53:26 -0000    1.45
> +++ win32.h    16 Jun 2005 13:43:50 -0000
> @@ -19,6 +19,7 @@
>  #define HAVE_FSYNC_WRITETHROUGH
>  #define HAVE_FSYNC_WRITETHROUGH_ONLY
>  #define ftruncate(a,b)    chsize(a,b)
> +#define fsync(fd) _commit(fd)
>
>  #define USES_WINSOCK

Patch applied, with comment.  Thanks.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/include/port/win32.h
===================================================================
RCS file: /cvsroot/pgsql/src/include/port/win32.h,v
retrieving revision 1.45
diff -c -c -r1.45 win32.h
*** src/include/port/win32.h    20 May 2005 14:53:26 -0000    1.45
--- src/include/port/win32.h    16 Jun 2005 17:52:18 -0000
***************
*** 19,24 ****
--- 19,29 ----
  #define HAVE_FSYNC_WRITETHROUGH
  #define HAVE_FSYNC_WRITETHROUGH_ONLY
  #define ftruncate(a,b)    chsize(a,b)
+ /*
+  *    Even though we don't support 'fsync' as a wal_sync_method,
+  *    we do fsync() a few other places where _commit() is just fine.
+  */
+ #define fsync(fd) _commit(fd)

  #define USES_WINSOCK


pgsql-patches by date:

Previous
From: Christof Petig
Date:
Subject: Re: [INTERFACES] libecpg (8.0 and CVS) hits a gcc bug on powerpc
Next
From: Pavel Stehule
Date:
Subject: Continue stmt for plpgsql