On Fri, 22 Apr 2022 at 04:38, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>> On 20.04.22 22:29, Tom Lane wrote:
>>> PG_BINARY is useful for open(). It's the PG_BINARY_R/W/A macros for
>>> fopen() that are redundant per POSIX. Possibly someone generalized
>>> inappropriately; or maybe long ago we supported some platform that
>>> rejected the "b" option?
>
>> I think the latter was the case. I doubt it's still a problem.
>
> We could find that out with little effort, at least for machines in the
> buildfarm, by modifying c.h to use the form with "b" always.
>
I think we should also consider the popen() (see: OpenPipeStream() function),
on the Windows, it can use "b", however, for linux, it might be not right.
So, modifying c.h to use the form with "b" isn't always right.
[1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/popen-wpopen?view=msvc-170
--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.