Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] xlog.c.patch for cygwin port.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: yutaka tanida <yutaka(at)marin(dot)or(dot)jp>, Alexei Zakharov <A(dot)S(dot)Zakharov(at)inp(dot)nsk(dot)su>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] xlog.c.patch for cygwin port.
Date: 2000-03-08 01:01:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> This looks interesting.  We could remove some of our ifwin cruft.

I have been thinking for quite some time that most of the CYGWIN32
ifdefs represent very poor programming.  Instead of zillions of

#ifndef __CYGWIN32__
	fd = open(filename, O_RDONLY, 0666);
	fd = open(filename, O_RDONLY | O_BINARY, 0666);

we should have in one include file something like

#ifndef __CYGWIN32__
// etc for the combinations we need
// etc

and then the body of the code would have

	fd = open(filename, OPEN_FLAGS_READ, 0666);

and no ifdef.  This would also provide a single place to tweak open()
flags for other platforms, whereas the existing method is exactly zero
help for any non-CYGWIN platform that wants to add O_BINARY ...

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: The Hermit HackerDate: 2000-03-08 01:08:27
Subject: Re: [HACKERS] sqgfault on initdb with current CVS
Previous:From: Tom LaneDate: 2000-03-08 00:55:17
Subject: Re: [HACKERS] DROP TABLE inside a transaction block

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group