postgresql/src/port
Tom Lane 61b53695fb Remove optreset from src/port/ implementations of getopt and getopt_long.
We don't actually need optreset, because we can easily fix the code to
ensure that it's cleanly restartable after having completed a scan over the
argv array; which is the only case we need to restart in.  Getting rid of
it avoids a class of interactions with the system libraries and allows
reversion of my change of yesterday in postmaster.c and postgres.c.

Back-patch to 8.4.  Before that the getopt code was a bit different anyway.
2010-12-16 16:23:05 -05:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
chklocale.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
crypt.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
dirent.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
dirmod.c Fix comparisons of pointers with zero to compare with NULL instead. 2010-10-29 15:51:52 -04:00
erand48.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
exec.c Avoid clobbering errno, per comment from Tom. 2010-12-16 17:15:37 -03:00
fseeko.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
getaddrinfo.c Fix getaddrinfo() in pgport to use proper parameters, as detected by 2010-11-25 12:56:59 -05:00
gethostname.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
getopt.c Remove optreset from src/port/ implementations of getopt and getopt_long. 2010-12-16 16:23:05 -05:00
getopt_long.c Remove optreset from src/port/ implementations of getopt and getopt_long. 2010-12-16 16:23:05 -05:00
getrusage.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
gettimeofday.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
inet_aton.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
inet_net_ntop.c Fix portability issues in new src/port/inet_net_ntop.c file. 2010-11-26 18:00:26 -05:00
isinf.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
kill.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Makefile Move a couple of initdb's subroutines into src/port/. 2010-12-10 19:42:44 -05:00
memcmp.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
noblock.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
open.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
path.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgcheckdir.c Move a couple of initdb's subroutines into src/port/. 2010-12-10 19:42:44 -05:00
pgmkdirp.c Move a couple of initdb's subroutines into src/port/. 2010-12-10 19:42:44 -05:00
pgsleep.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pgstrcasecmp.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pipe.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pthread-win32.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
qsort.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
qsort_arg.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
random.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
rint.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
snprintf.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
sprompt.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
srandom.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strdup.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strerror.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strlcat.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strlcpy.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strtol.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
strtoul.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
thread.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
unsetenv.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.ico Add as binary mode 2004-10-07 13:59:45 +00:00
win32env.c Add some minor missing error checks 2010-12-16 12:23:07 -03:00
win32error.c Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32ver.rc Stamp HEAD as 9.1devel. 2010-07-09 04:10:58 +00:00

src/port/README

libpgport
=========

libpgport must have special behavior.  It supplies functions to both
libraries and applications.  However, there are two complexities:

1)  Libraries need to use object files that are compiled with exactly
the same flags as the library.  libpgport might not use the same flags,
so it is necessary to recompile the object files for individual
libraries.  This is done by removing -lpgport from the link line:

        # Need to recompile any libpgport object files
        LIBS := $(filter-out -lpgport, $(LIBS))

and adding infrastructure to recompile the object files:

        OBJS= execute.o typename.o descriptor.o data.o error.o prepare.o memory.o \
                connect.o misc.o path.o exec.o \
                $(filter snprintf.o, $(LIBOBJS))

The problem is that there is no testing of which object files need to be
added, but missing functions usually show up when linking user
applications.

2) For applications, we use -lpgport before -lpq, so the static files
from libpgport are linked first.  This avoids having applications
dependent on symbols that are _used_ by libpq, but not intended to be
exported by libpq.  libpq's libpgport usage changes over time, so such a
dependency is a problem.  Win32, Linux, and Darwin use an export list to
control the symbols exported by libpq.