more POSIX 2008 cleanup: strnlen(), rindex()

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: more POSIX 2008 cleanup: strnlen(), rindex()
Date: 2026-01-03 09:51:53
Message-ID: 98ce805c-6103-421b-adc3-fcf8f3dddbe3@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It has previously been established that POSIX 2008 is the baseline for
PostgreSQL code (modulo Windows). Looking through the POSIX 2008
changes, I found a few more things we can clean up with respect to that.

The first patch removes the configure checks for strnlen(), since that
is now required, and I see that all buildfarm members support. There
was some discussion in the commit messages that added these checks
(e.g., commit 8a241792f96) that suggests it was once required, but I did
not find any information about which platforms were affected then. But
that's 8 years ago now, so I think it might be obsolete.

The second patch replaces the single remaining use of rindex() with the
equivalent strrchr(). rindex() has been removed from POSIX.

Attachment Content-Type Size
0001-strnlen-is-now-required.patch text/plain 5.4 KB
0002-Remove-use-of-rindex-function.patch text/plain 997 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2026-01-03 09:58:14 Re: more POSIX 2008 cleanup: strnlen(), rindex()
Previous Message Jelte Fennema-Nio 2026-01-03 09:42:20 Re: Decouple C++ support in Meson's PGXS from LLVM enablement