66 * Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
77 * Portions Copyright (c) 1994, Regents of the University of California
88 *
9- * $PostgreSQL: pgsql/src/include/port.h,v 1.66 2004/11/08 16:34:23 momjian Exp $
9+ * $PostgreSQL: pgsql/src/include/port.h,v 1.67 2004/11/17 17:46:15 tgl Exp $
1010 *
1111 *-------------------------------------------------------------------------
1212 */
@@ -73,9 +73,13 @@ extern int find_other_exec(const char *argv0, const char *target,
7373
7474#if defined(WIN32 )|| defined(__CYGWIN__ )
7575#define EXE ".exe"
76- #define DEVNULL "nul"
7776#else
7877#define EXE ""
78+ #endif
79+
80+ #if defined(WIN32 )&& !defined(__CYGWIN__ )
81+ #define DEVNULL "nul"
82+ #else
7983#define DEVNULL "/dev/null"
8084#endif
8185
@@ -88,13 +92,13 @@ extern int find_other_exec(const char *argv0, const char *target,
8892 *See the "Notes" section about quotes at:
8993 *http://home.earthlink.net/~rlively/MANUALS/COMMANDS/C/CMD.HTM
9094 */
91- #ifdef WIN32
95+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
9296#define SYSTEMQUOTE "\""
9397#else
9498#define SYSTEMQUOTE ""
9599#endif
96100
97- #ifdef WIN32
101+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
98102#define HOMEDIR "USERPROFILE"
99103#else
100104#define HOMEDIR "HOME"
@@ -163,8 +167,9 @@ extern intpgunlink(const char *path);
163167 *Cygwin has its own symlinks which work on Win95/98/ME where
164168 *junction points don't, so use it instead. We have no way of
165169 *knowing what type of system Cygwin binaries will be run on.
170+ * Note: Some CYGWIN includes might #define WIN32.
166171 */
167- #ifdef WIN32
172+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
168173extern int pgsymlink (const char * oldpath ,const char * newpath );
169174#define symlink (oldpath ,newpath )pgsymlink(oldpath, newpath)
170175#endif
@@ -173,7 +178,7 @@ extern intpgsymlink(const char *oldpath, const char *newpath);
173178
174179extern bool rmtree (char * path ,bool rmtopdir );
175180
176- #ifdef WIN32
181+ #if defined( WIN32 ) && !defined( __CYGWIN__ )
177182
178183/* open() replacement to allow delete of held files */
179184#ifndef WIN32_CLIENT_ONLY
@@ -266,7 +271,7 @@ extern void srandom(unsigned int seed);
266271/* thread.h */
267272extern char * pqStrerror (int errnum ,char * strerrbuf ,size_t buflen );
268273
269- #ifndef WIN32
274+ #if !defined( WIN32 ) || defined( __CYGWIN__ )
270275extern int pqGetpwuid (uid_t uid ,struct passwd * resultbuf ,char * buffer ,
271276size_t buflen ,struct passwd * * result );
272277#endif