Using isatty() on WIN32 platform - Mailing list pgsql-hackers

From Martín Marqués
Subject Using isatty() on WIN32 platform
Date
Msg-id b8899675-9af5-713d-3193-a19325088e57@2ndquadrant.com
Whole thread Raw
Responses Re: Using isatty() on WIN32 platform  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

While following suggestions from Arthur Zakirov on a patch for
pg_basebackup I found that we are using isatty() in multiple places, but
we don't distinguish the WIN32 code which should use _isatty() as per [1].

It's true that isatty() is still supported by Visual C (else we'd fail
to compile) but per the documentation it could get removed at any moment.

Instead of just using #ifdef in my patch, I thought we could have a
cleaner patch which would cover all calls for isatty().

Attached is a patch for src/include/ports/win32.h

[1]: https://msdn.microsoft.com/en-us/library/ms235388.aspx

P.D.: Which would be the correct usage, per-standards: with or without
the _ prefix?

-- 
Martín Marqués                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] pgbench regression test failure