Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the Unix
Tom Lane <tgl@sss.pgh.pa.us>
Get rid of not-very-portable fcntl(F_SETLK) mechanism for locking the Unix socket file, in favor of having an ordinary lockfile beside the socket file. Clean up a few robustness problems in the lockfile code. If postmaster is going to reject a connection request based on database state, it will now tell you so before authentication exchange not after. (Of course, a failure after is still possible if conditions change meanwhile, but this makes life easier for a yet-to-be-written pg_ping utility.)
Files
| Path | Change | +/− |
|---|---|---|
| configure | modified | +124 −158 |
| configure.in | modified | +0 −17 |
| src/backend/libpq/pqcomm.c | modified | +22 −53 |
| src/backend/postmaster/postmaster.c | modified | +121 −115 |
| src/backend/tcop/postgres.c | modified | +5 −11 |
| src/backend/utils/init/miscinit.c | modified | +212 −186 |
| src/backend/utils/misc/guc.c | modified | +2 −2 |
| src/bin/pg_ctl/pg_ctl.sh | modified | +6 −6 |
| src/include/config.h.in | modified | +1 −4 |
| src/include/miscadmin.h | modified | +4 −13 |