Re: BSD gettext - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BSD gettext
Date
Msg-id 29525.990707497@sss.pgh.pa.us
Whole thread Raw
In response to BSD gettext  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: BSD gettext  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: BSD gettext  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> This is a compilation of the BSD-licensed gettext tools from NetBSD plus
> some of my own code, put into a (hopefully) portable package, intended to
> be evaluated for possible use in PostgreSQL.  Give it a try if you're
> interested.

On HPUX 10.20:

make[2]: Entering directory `/home/tgl/pgsql/bsd-gettext-0.0/libintl'
/bin/sh ../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I..     -g -O2 -c gettext.c
gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -c gettext.c -o gettext.o
gettext.c: In function `mapit':
gettext.c:313: `MAP_FAILED' undeclared (first use in this function)
gettext.c:313: (Each undeclared identifier is reported only once
gettext.c:313: for each function it appears in.)
gettext.c: In function `unmapit':
gettext.c:442: `MAP_FAILED' undeclared (first use in this function)
make[2]: *** [gettext.lo] Error 1

The HPUX man page for mmap documents its failure return value as "-1",
so I hacked around this with

#ifndef MAP_FAILED
#define MAP_FAILED ((void *) (-1))
#endif

whereupon it built and passed the simple self-test you suggested.
However, I think it's pretty foolish to depend on mmap for such
little reason as this code does.  I suggest ripping out the mmap
usage and just reading the file with good old read(2).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug#98565: postgresql logs notices with GMT timestamps in syslog (fwd)
Next
From: Peter Eisentraut
Date:
Subject: Re: Smaller access privilege changes