* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.39 2000/12/03 10:27:26 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.40 2000/12/08 22:21:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
logFile = XLogFileOpen(logId, logSeg, false);
}
- if (fsync(logFile) != 0)
+ if (pg_fsync(logFile) != 0)
elog(STOP, "fsync(logfile %u seg %u) failed: %m",
logId, logSeg);
LgwrResult.Flush = LgwrResult.Write;
{
if (wcnt > 0)
{
- if (fsync(logFile) != 0)
+ if (pg_fsync(logFile) != 0)
elog(STOP, "fsync(logfile %u seg %u) failed: %m",
logId, logSeg);
if (LgwrResult.Write.xlogid != logId)
if (XLByteLT(LgwrResult.Flush, LgwrRqst.Flush) &&
XLByteLE(LgwrRqst.Flush, LgwrResult.Write))
{
- if (fsync(logFile) != 0)
+ if (pg_fsync(logFile) != 0)
elog(STOP, "fsync(logfile %u seg %u) failed: %m",
logId, logSeg);
LgwrResult.Flush = LgwrResult.Write;
elog(STOP, "write(logfile %u seg %u) failed: %m",
logId, logSeg);
- if (fsync(fd) != 0)
+ if (pg_fsync(fd) != 0)
elog(STOP, "fsync(logfile %u seg %u) failed: %m",
logId, logSeg);
}
if (readFile >= 0)
{
- if (fsync(readFile) < 0)
+ if (pg_fsync(readFile) < 0)
elog(STOP, "ReadRecord: fsync(logfile %u seg %u) failed: %m",
readId, readSeg);
close(readFile);
if (write(fd, buffer, BLCKSZ) != BLCKSZ)
elog(STOP, "WriteControlFile failed to write control file: %m");
- if (fsync(fd) != 0)
+ if (pg_fsync(fd) != 0)
elog(STOP, "WriteControlFile failed to fsync control file: %m");
close(fd);
if (write(fd, ControlFile, sizeof(ControlFileData)) != sizeof(ControlFileData))
elog(STOP, "write(cntlfile) failed: %m");
- if (fsync(fd) != 0)
+ if (pg_fsync(fd) != 0)
elog(STOP, "fsync(cntlfile) failed: %m");
close(fd);
if (write(logFile, buffer, BLCKSZ) != BLCKSZ)
elog(STOP, "BootStrapXLOG failed to write logfile: %m");
- if (fsync(logFile) != 0)
+ if (pg_fsync(logFile) != 0)
elog(STOP, "BootStrapXLOG failed to fsync logfile: %m");
close(logFile);
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fd.h,v 1.24 2000/11/30 08:46:26 vadim Exp $
+ * $Id: fd.h,v 1.25 2000/12/08 22:21:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/* Miscellaneous support routines */
extern void closeAllVfds(void);
extern void AtEOXact_Files(void);
-
-#define pg_fsync(fd) fsync(fd)
+extern int pg_fsync(int fd);
#endif /* FD_H */