Re: zic: fix PostgreSQL build failure on filesystems without hard link support - Mailing list pgsql-hackers

From Tom Lane
Subject Re: zic: fix PostgreSQL build failure on filesystems without hard link support
Date
Msg-id 1771779.1785517670@sss.pgh.pa.us
Whole thread
In response to Re: zic: fix PostgreSQL build failure on filesystems without hard link support  (Vladlen Popolitov <v.popolitov@postgrespro.ru>)
Responses Re: Bug: XLogReader mishandles oversized multi-page xl_tot_len (potential memory corruption)
Re: hashjoins vs. Bloom filters (yet again)
Re: zic: fix PostgreSQL build failure on filesystems without hard link support
List pgsql-hackers
Vladlen Popolitov <v.popolitov@postgrespro.ru> writes:
> Tom Lane писал(а) 2026-07-31 17:08:
>> Interesting.  I wonder if it'd be sane to put in an explicit mapping
>> for ERROR_INVALID_FUNCTION, although I'm not quite sure whether to
>> prefer ENOTSUP or EOPNOTSUPP.

> We could try other approach - avoid changing zic and _dosmaperr()
> and fix link() like this in src/port/win32link.c:

>         if (returncode == ERROR_INVALID_FUNCTION)
>             errno = ENOTSUP;
>         else
>             dosmaperr(returncode);

Yeah, that sounds like the solution with the smallest blast radius.
We know that ERROR_INVALID_FUNCTION means this for link(), but
it's hardly clear that that applies across-the-board; it seems
like EINVAL is probably the best translation in other cases.

Another advantage is that we don't have to sync it with changes in
zic.c: this will still do what we want after Eggert's changes of
today[1] arrive, whereas other answers might not.

I'll go make it so in a bit.  Thanks for the report!

            regards, tom lane

[1] https://lists.iana.org/hyperkitty/list/tz@iana.org/thread/O5Q2I3GLZIF6GEFZ3MDWRZKG4ENPJVFQ/



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: walsummarizer can get stuck when switching timelines
Next
From: David K
Date:
Subject: Re: Bug: XLogReader mishandles oversized multi-page xl_tot_len (potential memory corruption)