Re: determining the program_invocation_name

2010-12-24 Thread Paul Eggert
On 12/24/2010 01:41 PM, Bruno Haible wrote: > Decide that it is better to have no gnulib API at all than an API that > has portability problems. Given the results of your (impressive) research, I'm tempted to go with this approach. A fallback position might be to implement only A (the sh

more select-tests updates

2010-12-24 Thread Bruno Haible
Hi Paolo, While looking at tests/test-select.c for the OSF/1 failure, I found a couple of small tweaks. Can you agree to these 4 patches? 1) The code for pipe() on Win32 is now in module 'pipe-posix'. And 'pipe-posix' depends on 'unistd'. 2010-12-24 Bruno Haible select tests: Use ex

Re: [PATCH] test-select: avoid warn_unused_result warnings

2010-12-24 Thread Bruno Haible
Hi Jim, You wrote on 2010-10-13 in : > * tests/test-select.c: Include "macros.h". > ASSERT that each call to read, write, and pipe succeeds. > While not technically required, also check each "close". The last part causes a failur

determining the program_invocation_name

2010-12-24 Thread Bruno Haible
Hi, How can some library code determine the name of the running program, for error message and display purposes, if the program's main() function has not stored argv[0] in a particular place? Let's be clear about two things: 1) This question is mostly irrelevant for libposix, because library

[PATCH] stdint: avoid HP-UX 10.20 preprocessor bug

2010-12-24 Thread Eric Blake
* lib/stdint.in.h (INT64_MAX, UINT64_MAX): Check via #ifdef rather than #if. * tests/test-floor2.c (main): Likewise. Reported by Peter O'Gorman. Signed-off-by: Eric Blake --- > >> +#if UINT64_MAX >> # define GL_UINT64_T > > Any reason not to #ifdef INT64_MAX/UINT64_MAX instead of plain #if?

[PATCH] pipe: make obsoletion transition easier

2010-12-24 Thread Eric Blake
* lib/pipe.h: Restore file as thin shim around "spawn-pipe.h". * modules/pipe (Files): Include revived file. (Include): Drop reference, to mirror getdate's behavior. Signed-off-by: Eric Blake --- > Since at this point we are not considering moving either all POSIX > related modules or all applic

Re: gnulib stdint.h substitution of int64_t results in a linking error in GCC 4.(3|2|0) on OSX

2010-12-24 Thread Peter O'Gorman
On Wed, Nov 24, 2010 at 12:07:52PM -0800, Paul Eggert wrote: > I pushed the following patch; could you please give it a try? > From 531b8a416b6ae40f89808e1db8976eb25972e661 Mon Sep 17 00:00:00 2001 > From: Paul Eggert > Date: Wed, 24 Nov 2010 12:05:43 -0800 > Subject: [PATCH] stdint: port to GCC

Re: socket functions on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > socklen_t is typedef'ed in (and as an int) but, for some > strange and probably historical reason, not used anywhere, in particular > not in those socket funktions with use a size_t instead (which is > typedefe'ed to an unsigned integer) OK, I wanted to know whether sockl

Re: gethostname on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > diff -u ./gllib/unistd.in.h.orig ./gllib/unistd.in.h > --- ./gllib/unistd.in.h.orig2010-12-20 19:57:37.0 -0600 > +++ ./gllib/unistd.in.h 2010-12-23 07:57:13.0 -0600 > @@ -51,6 +51,14 @@ > # undef _GL_INCLUDING_WINSOCK2_H > #endif > > +#ifdef __TANDEM

Re: HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > Yes, but with a condition that apparently is not met (and to deeply > nested and complicated for me to grasp), hence my change: > > diff -u ./gllib/sys_select.in.h.orig ./gllib/sys_select.in.h > --- ./gllib/sys_select.in.h.orig2010-10-10 16:05:05.0 -0500 >

sys_select: tweak

2010-12-24 Thread Bruno Haible
There is no reason to include from except on native Windows platforms. I've tested this on various platforms. 2010-12-24 Bruno Haible sys_select: Remove unneeded include. * lib/sys_select.in.h: Don't include on platforms that have . --- lib/sys_select.in.h.orig

RE: alphasort on HP-NonStop

2010-12-24 Thread Joachim Schmitz
Thanks. I'll report this as a bug to HP NonStop development. Last change on the lib was that scandir() and scandir64() had been added, looks like alphasort() got added too, but not externalized. Bye, Jojo -Original Message- From: Bruno Haible [mailto:br...@clisp.org] Sent: Friday, Decem

Re: HOST_NAME_MAX on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > Good question. In config.h I can only see: > > #define HOST_NAME_MAX > > So it gets #define'd but with no value > ... > Possibly because it does not #include is such a rarely included header file that we can ignore it here, and simply use a fallback of 256 (which is th

Re: printf.o HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > gllig/printf.o is not, but does not contain rpl_printf: > $ nm -Pe gllib/printf.o > E __stdio_fp > F printf > E rpl_vfprintf gllib/printf.o should define rpl_printf, not printf. Is some header file on your platform doing a "#undef printf" ? Bru

Re: alphasort on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > Ah! Found it in a lib called zutildll! And that indeed gets linked by my > wrapper script. It is not documented anywhere, so I'm not sure whether > it serves the purpose POSIX defined for this... Yes, when a function is not documented, it's most reliable to not use it. >

Re: porting alignof to HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > typedef struct { char slot1; char slot2; } char_helper; > ((size_t)__INTADDR__(&(((struct { char __slot1; char __slot2; } > *)0)->__slot2))) > > Is not equal to > > ((size_t)__INTADDR__(&(((char_helper *)0)->slot2))) > > do you see why, resp. what's wrong here? No, I

RE: alphasort on HP-NonStop

2010-12-24 Thread Joachim Schmitz
Hi Bruno Hmmm, as per config.log and config.h configure apparently found alphasort and #defined _HAVE_ALPHASORT, I wonder why? configure:24953: checking for alphasort configure:24953: cc -o conftest -g -I/usr/local/include conftest.c >&5 return 0; ^ "/usr/local/Floss/gnulib/testdir-pos

Re: [PATCH] doc: document Solaris printf bug with large float precisions

2010-12-24 Thread Bruno Haible
Hello Paul, > This prints "513 0.0" rather than the correct "513 1.0". Indeed. I reproduce on Solaris 10/SPARC. On Solaris 10/x86, the result is simply a SIGSEGV. When I build a testdir for 'snprintf-posix', the results are: - On Solaris 10/x86: checking whether printf supports l

Re: rename, renameat test failures on OSF/1

2010-12-24 Thread Jim Meyering
Bruno Haible wrote: > Hi Eric, > >> > -ASSERT (errno == EINVAL || errno == EBUSY); >> > +ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); > >> The patch to relax the testsuite looks okay to me; we're already >> allowing other non-standard errno values here, so no one h

Re: on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > OK, the highest number for any SIG is 31, so NSIG should really be > 32. Thanks for this info. I'm adding a definition of NSIG for your platform. 2010-12-24 Bruno Haible signal: Define NSIG. * lib/signal.in.h (NSIG): Define to 32 on NonStop Kernel.

Re: rename, renameat test failures on OSF/1

2010-12-24 Thread Bruno Haible
Hi Eric, > > -ASSERT (errno == EINVAL || errno == EBUSY); > > +ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST); > The patch to relax the testsuite looks okay to me; we're already > allowing other non-standard errno values here, so no one has complained > about it cau

Re: on HP-NonStop

2010-12-24 Thread Bruno Haible
Joachim Schmitz wrote: > The only SA_ Macros I can find are SA_DATA_SITE in , > most probably unrelated, and SA_NOCLDSTOP and SA_RESERVED_31 in , > and nothing that looks remotely like a replacement, signal.h attached Thanks for looking into this. So the best choice is to accept the fact that SA

Re: [PATCH] doc: document Solaris printf bug with large float precisions

2010-12-24 Thread Simon Josefsson
Paul Eggert writes: > Here's a simpler test case that illustrates the Solaris bug, > in case there's anybody here who can get bug fixes > into Solaris: > > #include > int > main (void) > { > char buf[1000]; > int n = snprintf (buf, sizeof buf, "%.511f", 1.0); > printf ("%d %s\n", n, buf);

[PATCH] tests: port test-fdutimensat.c to Solaris 8

2010-12-24 Thread Paul Eggert
* tests/test-fdutimensat.c (do_fdutimens): Don't assume fdutimensat works with a nonnegative fd and AT_SYMLINK_NOFOLLOW. On Solaris 8, it fails with errno == ENOSYS, because there is no futimens (so it can't use the fd), and there is no lutimens (so it can't implement AT_SYMLINK_NOFOLLOW on symlink