Replace getopt() with our re-entrant variant in the backend

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 681774315d738ed9bb213d755c6f39fa5b5009b9
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2026-03-30T17:47:16Z
Replace getopt() with our re-entrant variant in the backend

Some of these probably could continue using non-re-entrant getopt()
even if we start using threads in the future, but it seems better to
make them all anyway, so that we have a clear-cut rule of "no plain
getopt() in the postgres binary".

Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/d1da5f0e-0d68-47c9-a882-eb22f462752f@iki.fi

Files

Discussion