Re: xalloc-die-tests

2009-11-17 Thread Simon Josefsson
Thanks Eric and Jim.

One though on the changes is that if we use a shell script to wrap
running the binary, we'd might as well make the shell script check that
the xalloc-die binary returns a non-0 exit code and drop the XFAIL_TESTS
approach for the module.  But I don't care strongly about it.

/Simon




Re: xalloc-die-tests

2009-11-17 Thread Simon Josefsson
Simon Josefsson  writes:

> One though on the changes is that if we use a shell script to wrap
> running the binary, we'd might as well make the shell script check that
> the xalloc-die binary returns a non-0 exit code and drop the XFAIL_TESTS
> approach for the module.  But I don't care strongly about it.

Ah, I noticed your patches already changed this, but didn't drop the
XFAIL_TESTS setting.  So I pushed this.

/Simon

>From e45cb32c4ccf3e8be58a2bd3124b65f63266e21a Mon Sep 17 00:00:00 2001
From: Simon Josefsson 
Date: Tue, 17 Nov 2009 10:04:43 +0100
Subject: [PATCH] modules/xalloc-die-tests (Makefile.am): Drop XFAIL_TESTS.

---
 ChangeLog|6 ++
 modules/xalloc-die-tests |1 -
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f535c53..812f3e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-17  Simon Josefsson  
+
+   * modules/xalloc-die-tests (Makefile.am): Drop XFAIL_TESTS
+   settings since xalloc-die is no longer the self test,
+   xalloc-die.sh is.
+
 2009-11-17  Jim Meyering  
 
test-xalloc-die.sh: make the code agree with the commit log
diff --git a/modules/xalloc-die-tests b/modules/xalloc-die-tests
index 97b25e7..ed6a470 100644
--- a/modules/xalloc-die-tests
+++ b/modules/xalloc-die-tests
@@ -7,5 +7,4 @@ Depends-on:
 Makefile.am:
 TESTS += test-xalloc-die.sh
 TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@'
-XFAIL_TESTS += test-xalloc-die
 check_PROGRAMS += test-xalloc-die
-- 
1.6.5.2





Re: {un,}setenv fixes

2009-11-17 Thread Jim Meyering
Eric Blake wrote:
> Coreutils got recent reports of a FreeBSD failure on 'env -u a=b', which 
> should
> fail because unsetenv should reject invalid environment variable names (kind 
> of
> obvious, though, when you realize BSD unsetenv returns void instead of int,
> contrary to the POSIX signature).  I think this should fix it, although so far
> I have only tested it on mingw and Solaris 8 (both functions are missing),
> cygwin 1.5 (where setenv was broken, but unsetenv worked) and cygwin 1.7 and
> Solaris 10 (where both functions obey POSIX, at least after today's patch to
> cygwin).  I'll test on a few more platforms, then push.

test-unsetenv is failing on Solaris 10:

$ env -i $(type -p gdb) -q ./test-unsetenv
(gdb) r
Starting program: /tmp/.j/coreutils-8.0.125-6609c/gnulib-tests/test-unsetenv
test-unsetenv.c:50: assertion failed

Program received signal SIGABRT, Aborted.
0xff2cc674 in _lwp_kill () from /lib/libc.so.1
(gdb) bt
#0  0xff2cc674 in _lwp_kill () from /lib/libc.so.1
#1  0xff265a7c in raise () from /lib/libc.so.1
#2  0xff241954 in abort () from /lib/libc.so.1
#3  0x00010a2c in main () at test-unsetenv.c:50
(gdb) p *((char **)environ)@5
$1 = {0xffbfff9e "LINES=98", 0xffbfff93 "COLUMNS=81", 0xffbffe64 "a=2", 0x0, 
0x0}
(gdb) up
#1  0xff265a7c in raise () from /lib/libc.so.1
(gdb)
#2  0xff241954 in abort () from /lib/libc.so.1
(gdb)
#3  0x00010a2c in main () at test-unsetenv.c:50
50ASSERT (getenv ("a") == NULL);
(gdb)

Of the env-related replacement functions, only putenv was compiled:

  $ ls ../lib/*env.o
  ../lib/putenv.o

The above makes me wonder if Solaris 10 needs the unsetenv replacement.




the _t suffix

2009-11-17 Thread Simon Josefsson
I've seen some people suggest that POSIX reserves the _t suffix
namespace for its own variables.  Is this true?  If so, is there any
need to worry about gnulib?  There are several gnulib modules that
declares types with the _t suffix.

I've found this link but it is not really clear to me that it reserves
the _t suffix.  It does say "ANY HEADER" and "_t" but that could also
refer to any POSIX header file, not just any header file.
http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

/Simon




Re: Intel C++ compiler for Linux 11.1 doesn't build m4 1.4.13 on NetBSD

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Alexander Nasonov on 11/17/2009 2:37 AM:
> it fails here:
> 
> fflush.c(95): error: a value of type "__off_t={__int64_t={long long}}" cannot 
> be assigned to an entity of type "fpos_t"
> fp_->_offset = pos;
>  ^
> compilation aborted for fflush.c (code 2)
> *** [fflush.o] Error code 2
> 1 error

Thanks for the report.  This is a gnulib problem, so I'm adding that list.

Are you sure you are using a C++ compiler instead of a C compiler?

> 
> 
> A quick look at /usr/include/stdio.h shows where the problem is:
> 
> /*
>  * This is fairly grotesque, but pure ANSI code must not inspect the
>  * innards of an fpos_t anyway.  The library internally uses off_t, 
>  * which we assume is exactly as big as eight chars.
>  */
> #if (!defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__)) || defined(_LIBC)
> typedef __off_t fpos_t;
> #else
> typedef struct __sfpos {
> __off_t _pos;
> } fpos_t;
> #endif
> 
> I think the comment is right and m4 shouldn't use C99 flag (or don't use 
> _offset).

Actually, the real fix is to make gnulib realize how to properly assign to
fpos_t, even when it is a struct.  But this is something that Bruno may be
more familiar with, since he wrote the code in this file.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksCoU8ACgkQ84KuGfSFAYAphQCfZAmOV2d7gvptFnY6xCz7IH8o
LKkAnAwIrTsACYf562403k61yAYpgt4c
=YlLD
-END PGP SIGNATURE-




Re: Intel C++ compiler for Linux 11.1 doesn't build m4 1.4.13 on NetBSD

2009-11-17 Thread Alexander Nasonov
17.11.09, 06:12, "Eric Blake" :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> Are you sure you are using a C++ compiler instead of a C compiler?

I was refering to the product called "Intel® C++ Compiler Professional Edition 
for Linux". They ship the C compiler as well.

Thanks,
Alex




Re: {un,}setenv fixes

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Jim Meyering on 11/17/2009 2:45 AM:
>> I'll test on a few more platforms, then push.
> 
> test-unsetenv is failing on Solaris 10:

Well, you obviously spotted a platform I missed in re-testing. ;)

> The above makes me wonder if Solaris 10 needs the unsetenv replacement.

Yep.  Like so.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksCp2EACgkQ84KuGfSFAYBQXACfZ9i/uf1kaauGJ1U9E0kTTKrZ
h2EAn20eVo9ylotWik+tEMzlH5ySrAmt
=GDyk
-END PGP SIGNATURE-
>From 41d42744e7a191342b71e4fe21517679b6a02a5e Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Tue, 17 Nov 2009 06:31:34 -0700
Subject: [PATCH] unsetenv: work around Solaris bug

unsetenv(name) only cleared the first instance, even if (ab)use of
putenv, or assignment to environ, included duplicates of name.

* m4/setenv.m4 (gl_FUNC_UNSETENV): Check for bug.
* lib/unsetenv.c (rpl_unsetenv): Work around it.
Reported by Jim Meyering.

Signed-off-by: Eric Blake 
---
 ChangeLog  |5 +
 lib/unsetenv.c |5 +++--
 m4/setenv.m4   |   23 ++-
 3 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e417934..4dbb0d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-11-17  Eric Blake  

+   unsetenv: work around Solaris bug
+   * m4/setenv.m4 (gl_FUNC_UNSETENV): Check for bug.
+   * lib/unsetenv.c (rpl_unsetenv): Work around it.
+   Reported by Jim Meyering.
+
vasnprintf: avoid compiler warnings
* lib/vasnprintf.c (VASNPRINTF): Avoid shadowing our own local
variables.
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
index 7567011..21fb199 100644
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -105,10 +105,11 @@ rpl_unsetenv (const char *name)
   errno = EINVAL;
   return -1;
 }
+  while (getenv (name))
 # if !VOID_UNSETENV
-  result =
+result =
 # endif
-unsetenv (name);
+  unsetenv (name);
   return result;
 }

diff --git a/m4/setenv.m4 b/m4/setenv.m4
index ca146d2..a5df034 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 12
+# setenv.m4 serial 13
 dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -50,6 +50,7 @@ AC_DEFUN([gl_FUNC_UNSETENV],
 AC_LIBOBJ([unsetenv])
 gl_PREREQ_UNSETENV
   else
+dnl Some BSDs return void, failing to do error checking.
 AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
   [AC_TRY_COMPILE([#include 
 extern
@@ -68,6 +69,26 @@ int unsetenv();
   REPLACE_UNSETENV=1
   AC_LIBOBJ([unsetenv])
 fi
+
+dnl Solaris 10 unsetenv does not remove all copies of a name.
+AC_CACHE_CHECK([whether unsetenv works on duplicates],
+  [gl_cv_func_unsetenv_works],
+  [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+   #include 
+  ]], [[
+   char entry[] = "b=2";
+   if (putenv ("a=1")) return 1;
+   if (putenv (entry)) return 2;
+   entry[0] = 'a';
+   unsetenv ("a");
+   if (getenv ("a")) return 3;
+  ]])],
+  [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
+  [gl_cv_func_unsetenv_works="guessing no"])])
+if test "$gl_cv_func_unsetenv_works" != yes; then
+  REPLACE_UNSETENV=1
+  AC_LIBOBJ([unsetenv])
+fi
   fi
 ])

-- 
1.6.5.rc1



Re: vasnprintf warnings

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 11/4/2009 6:50 PM:
> According to Eric Blake on 10/30/2009 10:27 AM:
>> Bruno, is it okay to apply this patch to silence these compiler warnings?
> 
>> * lib/vasnprintf.c (VASNPRINTF): Avoid shadowing our own local
>> variables.
>> * lib/printf-args.c (PRINTF_FETCHARGS): Avoid type mismatch.
> 
> Ping?

No response, so I've applied it.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksCp8QACgkQ84KuGfSFAYBWywCgy3PP0U4b7yl/+2TeLVqy6lhW
SYcAoNgf9FrH6xv0BtM/1+voTGvrW3Xc
=ky/E
-END PGP SIGNATURE-




Re: the _t suffix

2009-11-17 Thread Bruce Korb
Hi Simon,

It's true.  However, it is so ubiquitously used that there's no way
that it could ever be enforced.  I consider it bogus.  Too big of
a name space grab.  It also reserves functions beginning with
"str", too.  Also egregious, even if not stratospherically over the top.

On Tue, Nov 17, 2009 at 2:06 AM, Simon Josefsson  wrote:
> I've seen some people suggest that POSIX reserves the _t suffix
> namespace for its own variables.  Is this true?  If so, is there any
> need to worry about gnulib?  There are several gnulib modules that
> declares types with the _t suffix.
>
> I've found this link but it is not really clear to me that it reserves
> the _t suffix.  It does say "ANY HEADER" and "_t" but that could also
> refer to any POSIX header file, not just any header file.
> http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
>
> /Simon
>
>
>




test-xalloc-die buglet

2009-11-17 Thread Simon Josefsson
I noticed an EOL problem on mingw and pushed the fix below.

/Simon

>From 3e00f5fce5b904dc642aff88abbcf75867263e0a Mon Sep 17 00:00:00 2001
From: Simon Josefsson 
Date: Tue, 17 Nov 2009 19:58:12 +0100
Subject: [PATCH] tests/test-xalloc-die.sh: Deal with EOL differences, and more.

---
 ChangeLog|5 +
 tests/test-xalloc-die.sh |   31 ---
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4dbb0d3..0989d4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-17  Simon Josefsson  
+
+   * tests/test-xalloc-die.sh: Add license.  Check that nothing is
+   printed to stdout.  Deal with EOL differences.
+
 2009-11-17  Eric Blake  
 
unsetenv: work around Solaris bug
diff --git a/tests/test-xalloc-die.sh b/tests/test-xalloc-die.sh
index b181ccb..dc9bc37 100755
--- a/tests/test-xalloc-die.sh
+++ b/tests/test-xalloc-die.sh
@@ -1,4 +1,20 @@
 #!/bin/sh
+# Test suite for xalloc_die.
+# Copyright (C) 2009 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
 
 tmpfiles=""
 trap '__st=$?; rm -fr $tmpfiles; exit $__st' 0
@@ -12,19 +28,28 @@ else
   compare() { cmp "$@"; }
 fi
 
-tmpfiles="t-xalloc-die.tmp"
+tmpout=t-xalloc-die.tmp-stderr
+tmperr=t-xalloc-die.tmp-stdout
+tmpfiles="$tmpout $tmperr ${tmpout}2 ${tmperr}2"
+
 PATH=".:$PATH"
 export PATH
-test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
+test-xalloc-die${EXEEXT} 2> ${tmperr} > ${tmpout}
 case $? in
   1) ;;
   *) (exit 1); exit 1 ;;
 esac
 
-compare - t-xalloc-die.tmp <<\EOF || { (exit 1); exit 1; }
+cat $tmperr | tr -d '\015' > ${tmperr}2
+cat $tmpout | tr -d '\015' > ${tmpout}2
+
+compare - ${tmperr}2 <<\EOF || { (exit 1); exit 1; }
 test-xalloc-die: memory exhausted
 EOF
 
+compare - ${tmpout}2 <<\EOF || { (exit 1); exit 1; }
+EOF
+
 rm -fr $tmpfiles
 
 exit 0
-- 
1.6.5.2





Re: test-xalloc-die buglet

2009-11-17 Thread Eric Blake
Simon Josefsson  josefsson.org> writes:

> 
> I noticed an EOL problem on mingw and pushed the fix below.

You beat me to it; I noticed the same, but didn't have quite as large a patch.

> 
> -tmpfiles="t-xalloc-die.tmp"
> +tmpout=t-xalloc-die.tmp-stderr
> +tmperr=t-xalloc-die.tmp-stdout
> +tmpfiles="$tmpout $tmperr ${tmpout}2 ${tmperr}2"

Do we really need ${tmpout}2?

> 
> -compare - t-xalloc-die.tmp <<\EOF || { (exit 1); exit 1; }
> +cat $tmperr | tr -d '\015' > ${tmperr}2

Useless use of cat.  Also, check for errors.  Try:

tr -d '\015' < $tmperr > ${tmperr}2 || { (exit 1); exit 1; }

> +cat $tmpout | tr -d '\015' > ${tmpout}2
> +compare - ${tmpout}2 <<\EOF || { (exit 1); exit 1; }
> +EOF
> +

Pointless.  If we expect the file to be empty, then there are no carriage 
returns to strip.  It is better to collapse these lines into one:

test ! -s $tmpout || { (exit 1); exit 1; }

Hmm, I'm really starting to like the idea of a common init script, so we can 
just do "Exit 1" instead of "{ (exit 1); exit 1; }".

-- 
Eric Blake







Re: test-xalloc-die buglet

2009-11-17 Thread Jim Meyering
Eric Blake wrote:
...
> test ! -s $tmpout || { (exit 1); exit 1; }
>
> Hmm, I'm really starting to like the idea of a common init script, so we can
> just do "Exit 1" instead of "{ (exit 1); exit 1; }".

Exactly.
The next question is whether to automatically create a temporary directory
for each test.  Of course, it would be deleted automatically.
I'm debating whether to do it in two steps or one.
Here's most of step1's init.sh, assuming a two-step approach:
  1) make each script use init.sh, convert all exit to Exit, and remove
  now-unnecessary rm -rf $tmpfiles stmts.
  2) change init.sh to create tmpdir, and cd into it before the test is
  run, and then clean up via trap.

The tmpdir-creation could be handled by the function in build-aux/mkdtemp.
AFAIK, it is portable enough, though if used as a function, rather
than exec'd, it will need some work to be more name-space friendly
and use clobber variables with names like $n.

Here's the beginnings of init.sh:
Namespace matters.  Notice $_tmpfiles.
Not sure if it's worth adding underscores to _exit and _compare.
What do you think?
-
# source this file; set up for tests

# Copyright (C) 2009 Free Software Foundation, Inc.
... copyright elided...

# We use a trap below for cleanup.  This requires us to go through
# hoops to get the right exit status transported through the signal.
# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
# sh inside this function.
Exit ()
{
  set +e
  (exit $1)
  exit $1
}

# This pair of trap statements ensures that $tmpfiles are removed
# upon interrupt and upon exit.
_tmpfiles=""
trap '__st=$?; rm -fr $_tmpfiles; exit $__st' 0
trap '__st=$?; Exit $__st' 1 2 3 15

if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
  compare() { diff -u "$@"; }
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
  compare() { cmp -s "$@"; }
else
  compare() { cmp "$@"; }
fi




[PATCH] Add ‘gnulib-tool’ support for LGPLv3+

2009-11-17 Thread Ludovic Courtès
Hello,

The attached patch fixes LGPLv3+ support in ‘gnulib-tool’.

Thanks,
Ludo’.

From 29c308aa797c07f9cc40074338ae6b5e5a290be8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 
Date: Tue, 17 Nov 2009 21:38:51 +0100
Subject: [PATCH] Add `gnulib-tool --import' support for LGPLv3+.

* gnulib-tool (func_import): Add support for LGPLv3+.
---
 gnulib-tool |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib-tool b/gnulib-tool
index a1e604c..dc59e48 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -2810,7 +2810,7 @@ func_import ()
   case "$lgpl" in
 yes | 3)
   case $license in
-LGPL | LGPLv2+) ;;
+LGPL | LGPLv2+ | LGPLv3+) ;;
 *) func_append license_incompatibilities "$module $license$nl" ;;
   esac
   ;;
-- 
1.6.4.2



pgpN9lMiwC5vZ.pgp
Description: PGP signature


Re: [PATCH] Add ‘gnulib-tool’ support for LGPLv3+

2009-11-17 Thread Jim Meyering
Ludovic Courtès wrote:
> The attached patch fixes LGPLv3+ support in ‘gnulib-tool’.
>
> Thanks,
> Ludo’.
>
> From 29c308aa797c07f9cc40074338ae6b5e5a290be8 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= 
> Date: Tue, 17 Nov 2009 21:38:51 +0100
> Subject: [PATCH] Add `gnulib-tool --import' support for LGPLv3+.
>
> * gnulib-tool (func_import): Add support for LGPLv3+.
> ---
>  gnulib-tool |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/gnulib-tool b/gnulib-tool
> index a1e604c..dc59e48 100755
> --- a/gnulib-tool
> +++ b/gnulib-tool
> @@ -2810,7 +2810,7 @@ func_import ()
>case "$lgpl" in
>  yes | 3)
>case $license in
> -LGPL | LGPLv2+) ;;
> +LGPL | LGPLv2+ | LGPLv3+) ;;

Not needed, if I were paying attention.
Will fix shortly:

s/LGPLv3+/LGPL/




Re: [PATCH] Add ‘gnulib-tool’ support for LGPLv3+

2009-11-17 Thread Simon Josefsson
l...@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> The attached patch fixes LGPLv3+ support in ‘gnulib-tool’.

Hi!  Pushed, thanks.

/Simon




Re: Error message doesn't say, "error"

2009-11-17 Thread Bruce Korb
Alfred M. Szmidt wrote:
> Bruce, how about this?  I'd actually rather see the whole version.m4
> mess be removed, but this is a decent fix for now.

A good and proper define-in-one-place fix for version stamps
is a really good idea.  Sticking the original version string
into an AC_INIT() m4 macro is _not_ a good idea.  It needs
to be in a readily accessible place.  "version.m4" is a
derived file and creating a full, derived file seems better
than editing a version controlled file (configure.ac).
I did it for README, but doesn't mean I like it. ;)

For anyone not interesting in pulling the sharutils archive
and reading a bootstrap script, FYI it contains the original:
> sharutils_version=4.7.1
> 
> autoconf_version=$(
>   autoconf --version | \
> sed -e 's/autoconf.*) *//' -e '1q'
> )
> gettext_version=$(
>   gettext --version | \
> sed -e 's/^gettext .*) *//' -e '1q'
> )
> automake_version=$(
>   automake --version | \
> sed -e 's/^automake .*) *//' -e 's/\([0-9]*\.[0-9]*\)\..*/\1/' -e 1q
> )
> exec 3> version.m4
> cat >&3 <<-  _EOVers_
> m4_define([sharutils_version], [${sharutils_version}])
> m4_define([sharutils_eaddr],   [bug-gnu-ut...@gnu.org])
> m4_define([gettext_version],   [${gettext_version}])
> AC_PREREQ([${autoconf_version}])
> _EOVers_
> 
> case "${sharutils_version}" in
> *.*pre* ) echo [DIST_ALPHA=README-alpha] ;;
> *)  echo [DIST_ALPHA=] ;;
> esac >&3
> exec 3>&-

I'll add the following shortly.  Thanks again, Alfred:

> 2009-11-15  Alfred M. Szmidt  
> 
>   * configure.ac (AC_INIT): Wrap sharutils_version and
>   sharutils_eaddr around m4_defn.
>   (AM_INIT_AUTOMAKE): Added `gnits'.
> 

> ! AC_INIT([GNU 
> sharutils],m4_defn([sharutils_version]),m4_defn([sharutils_eaddr]))

I was about to ask of sharutils_eaddr needed an "m4_defn()" wrapper, too.




Re: #ifndef __need_getopt not working in getopt.h

2009-11-17 Thread Bruce Korb
On Sat, Nov 14, 2009 at 2:57 PM, Eric Blake  wrote:
> Is this something you can reproduce using just './gnulib-tool --with-tests
> - --test [your list of modules]'?  Is this a case where you need to upgrade
> your list of modules to use getopt-posix or getopt-gnu, instead of the
> deprecated plain getopt?

Hmm.  Thanks, Eric.  Normally, I prefer to write using the completely
non-standard "autoopts-config" :-D.  I'll try again with getopt-gnu.
Perhaps this could be fiddled a bit so the failure mode is a little
clearer about the cause?

>> I'm running on linux.  There is a /usr/include/getopt.h.
>
> Which kernel version, and glibc version?
vmlinux-2.6.27.37
$ /lib/libc.so.6
GNU C Library stable release version 2.9 (20081117), by Roland McGrath et al.

Thank you.  Regards, Bruce




Re: #ifndef __need_getopt not working in getopt.h

2009-11-17 Thread Bruce Korb
Nope.  The first time through, it is still the installed getopt.h and
it is the broken configured version the second time through.
I could do my testing thus:

configure
make
make dist
cp /usr/include/getopt.h lib/.
make check

but I'd rather understand why A) the configured version is invalid,
and B) why it changes between "make" and "make check".

On Tue, Nov 17, 2009 at 4:14 PM, Bruce Korb  wrote:
> On Sat, Nov 14, 2009 at 2:57 PM, Eric Blake  wrote:
>> Is this something you can reproduce using just './gnulib-tool --with-tests
>> - --test [your list of modules]'?  Is this a case where you need to upgrade
>> your list of modules to use getopt-posix or getopt-gnu, instead of the
>> deprecated plain getopt?
>
> Hmm.  Thanks, Eric.  Normally, I prefer to write using the completely
> non-standard "autoopts-config" :-D.  I'll try again with getopt-gnu.
> Perhaps this could be fiddled a bit so the failure mode is a little
> clearer about the cause?
>
>>> I'm running on linux.  There is a /usr/include/getopt.h.
>>
>> Which kernel version, and glibc version?
> vmlinux-2.6.27.37
> $ /lib/libc.so.6
> GNU C Library stable release version 2.9 (20081117), by Roland McGrath et al.
>
> Thank you.  Regards, Bruce
>




Re: test-xalloc-die buglet

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 11/17/2009 12:07 PM:
>> -compare - t-xalloc-die.tmp <<\EOF || { (exit 1); exit 1; }
>> +cat $tmperr | tr -d '\015' > ${tmperr}2
> 
> Useless use of cat.  Also, check for errors.  Try:
> 
> tr -d '\015' < $tmperr > ${tmperr}2 || { (exit 1); exit 1; }
> 
> Pointless.  If we expect the file to be empty, then there are no carriage 
> returns to strip.  It is better to collapse these lines into one:
> 
> test ! -s $tmpout || { (exit 1); exit 1; }

I'm applying this:

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksDgoEACgkQ84KuGfSFAYD5iACfXPNYjNZb4QJ7+neA4FsSzhsT
0CwAoNYyRtNKIqH/BoYrjeptHoAFfY8U
=kINx
-END PGP SIGNATURE-
>From 89fe4c9d24e052d1947575379792613eb82f37cb Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Tue, 17 Nov 2009 11:38:42 -0700
Subject: [PATCH] xalloc-die-tests: optimize

* tests/test-xalloc-die.sh: Reduce number of processes.

Signed-off-by: Eric Blake 
---
 ChangeLog|5 +
 tests/test-xalloc-die.sh |8 +++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 33e9351..2889727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-17  Eric Blake  
+
+   xalloc-die-tests: optimize
+   * tests/test-xalloc-die.sh: Reduce number of processes.
+
 2009-11-17  Simon Josefsson  

* gnulib-tool: Support LGPLv3+ licenses in module files.  Tiny
diff --git a/tests/test-xalloc-die.sh b/tests/test-xalloc-die.sh
index dc9bc37..4b0d2c2 100755
--- a/tests/test-xalloc-die.sh
+++ b/tests/test-xalloc-die.sh
@@ -30,7 +30,7 @@ fi

 tmpout=t-xalloc-die.tmp-stderr
 tmperr=t-xalloc-die.tmp-stdout
-tmpfiles="$tmpout $tmperr ${tmpout}2 ${tmperr}2"
+tmpfiles="$tmpout $tmperr ${tmperr}2"

 PATH=".:$PATH"
 export PATH
@@ -40,15 +40,13 @@ case $? in
   *) (exit 1); exit 1 ;;
 esac

-cat $tmperr | tr -d '\015' > ${tmperr}2
-cat $tmpout | tr -d '\015' > ${tmpout}2
+tr -d '\015' < $tmperr > ${tmperr}2 || { (exit 1); exit 1; }

 compare - ${tmperr}2 <<\EOF || { (exit 1); exit 1; }
 test-xalloc-die: memory exhausted
 EOF

-compare - ${tmpout}2 <<\EOF || { (exit 1); exit 1; }
-EOF
+test -s $tmpout && { (exit 1); exit 1; }

 rm -fr $tmpfiles

-- 
1.6.5.rc1



Re: mkostemps

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 11/4/2009 7:18 PM:
> According to Eric Blake on 11/2/2009 4:18 PM:
>> Now that glibc 2.11 offers mkostemps, we should too.  Any objections to this
>> patch series?
> 
> No comments, so I went ahead and pushed this.

One more followup - don't interfere with C++ compilation.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksDg3UACgkQ84KuGfSFAYB/ggCaA5QIVBfY+EBH++lC7zVCsuJp
9IkAmwa9s9GX3bmFB4jisjPrDfyb7fiO
=Ee1W
-END PGP SIGNATURE-
>From 83e045030538b7838367305c0b92c7c756c90651 Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Tue, 17 Nov 2009 11:53:14 -0700
Subject: [PATCH] mkstemp: avoid conflict with C++ keyword template

Just because glibc uses K&R, and uses template as an identifier,
doesn't mean we have to.

* lib/mkdtemp.c (mkdtemp): Change spelling of template.
* lib/mkostemp.c (mkostemp): Likewise.
* lib/mkostemps.c (mkostemps): Likewise.
* lib/mkstemp.c (mkstemp): Likewise.
* lib/mkstemps.c (mkstemps): Likewise.

Signed-off-by: Eric Blake 
---
 ChangeLog   |7 +++
 lib/mkdtemp.c   |   10 +-
 lib/mkostemp.c  |   10 --
 lib/mkostemps.c |   11 ---
 lib/mkstemp.c   |9 -
 lib/mkstemps.c  |   10 --
 6 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2889727..64b11d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-11-17  Eric Blake  

+   mkstemp: avoid conflict with C++ keyword template
+   * lib/mkdtemp.c (mkdtemp): Change spelling of template.
+   * lib/mkostemp.c (mkostemp): Likewise.
+   * lib/mkostemps.c (mkostemps): Likewise.
+   * lib/mkstemp.c (mkstemp): Likewise.
+   * lib/mkstemps.c (mkstemps): Likewise.
+
xalloc-die-tests: optimize
* tests/test-xalloc-die.sh: Reduce number of processes.

diff --git a/lib/mkdtemp.c b/lib/mkdtemp.c
index 7f07ee4..2a71f77 100644
--- a/lib/mkdtemp.c
+++ b/lib/mkdtemp.c
@@ -23,16 +23,16 @@

 #include "tempname.h"

-/* Generate a unique temporary directory from TEMPLATE.
-   The last six characters of TEMPLATE must be "XX";
+/* Generate a unique temporary directory from XTEMPLATE.
+   The last six characters of XTEMPLATE must be "XX";
they are replaced with a string that makes the filename unique.
The directory is created, mode 700, and its name is returned.
(This function comes from OpenBSD.) */
 char *
-mkdtemp (char *template)
+mkdtemp (char *xtemplate)
 {
-  if (gen_tempname (template, 0, 0, GT_DIR))
+  if (gen_tempname (xtemplate, 0, 0, GT_DIR))
 return NULL;
   else
-return template;
+return xtemplate;
 }
diff --git a/lib/mkostemp.c b/lib/mkostemp.c
index 02a97e6..cdf758f 100644
--- a/lib/mkostemp.c
+++ b/lib/mkostemp.c
@@ -35,14 +35,12 @@
 # define __GT_FILE 0
 #endif

-/* Generate a unique temporary file name from TEMPLATE.
-   The last six characters of TEMPLATE must be "XX";
+/* Generate a unique temporary file name from XTEMPLATE.
+   The last six characters of XTEMPLATE must be "XX";
they are replaced with a string that makes the file name unique.
Then open the file and return a fd. */
 int
-mkostemp (template, flags)
- char *template;
- int flags;
+mkostemp (char *xtemplate, int flags)
 {
-  return __gen_tempname (template, 0, flags, __GT_FILE);
+  return __gen_tempname (xtemplate, 0, flags, __GT_FILE);
 }
diff --git a/lib/mkostemps.c b/lib/mkostemps.c
index 8de90fe..98475ff 100644
--- a/lib/mkostemps.c
+++ b/lib/mkostemps.c
@@ -37,15 +37,12 @@
 # define __GT_FILE 0
 #endif

-/* Generate a unique temporary file name from TEMPLATE.  The last six
-   characters before a suffix of length SUFFIXLEN of TEMPLATE must be
+/* Generate a unique temporary file name from XTEMPLATE.  The last six
+   characters before a suffix of length SUFFIXLEN of XTEMPLATE must be
"XX"; they are replaced with a string that makes the filename
unique.  Then open the file and return a fd. */
 int
-mkostemps (template, suffixlen, flags)
- char *template;
- int suffixlen;
- int flags;
+mkostemps (char *xtemplate, int suffixlen, int flags)
 {
   if (suffixlen < 0)
 {
@@ -53,5 +50,5 @@ mkostemps (template, suffixlen, flags)
   return -1;
 }

-  return __gen_tempname (template, suffixlen, flags, __GT_FILE);
+  return __gen_tempname (xtemplate, suffixlen, flags, __GT_FILE);
 }
diff --git a/lib/mkstemp.c b/lib/mkstemp.c
index 684c983..dda0400 100644
--- a/lib/mkstemp.c
+++ b/lib/mkstemp.c
@@ -35,13 +35,12 @@
 # define __GT_FILE 0
 #endif

-/* Generate a unique temporary file name from TEMPLATE.
-   The last six characters of TEMPLATE must be "XX";
+/* Generate a unique temporary file name from XTEMPLATE.
+   The last six ch

Re: OpenBSD chown

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 11/16/2009 10:16 PM:
> According to Eric Blake on 11/14/2009 12:48 PM:
>> However, I'm now seeing a failure on OpenBSD, where chown refuses to
>> change ctime on files if there is no change to ownership:
> 
> It turns out that the 'no-op' chmod correctly changes ctime, and that the
> "optimization" was only happening on the 'no-op' chown.  So this patch
> will fix it for chown.  However, I'm stumped for lchown; OpenBSD 4.0 lacks
> lutimes and lchmod, and link follows symlinks, so the only things I can
> think of that modify ctime on a symlink are a double rename or flat-out
> recreation with unlink/symlink.  Neither is very appealing, as it exposes
> a window of time where the symlink doesn't exist.  I guess I'll just have
> to find a way to modify this test to skip the portions of the lchown test
> that depend on ctime when run on OpenBSD.

Here's what I'm pushing.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksDhqUACgkQ84KuGfSFAYBaOgCeN2t4oijz2IYAXLAa8iyYCrgm
S+MAoLVr6yb6AhwFaugWLvqhj9GMA+mp
=pVu0
-END PGP SIGNATURE-
>From 84405cbc35207f178b1b50617254cb85ea803128 Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Mon, 16 Nov 2009 14:35:41 -0700
Subject: [PATCH] chown: work around OpenBSD bug

chown(name,geteuid(),-1) failed to update the change time if
name was already owned by the current effective user.  Work
around it by using chmod, which does not have this bug.

Unfortunately, lchown has the same bug, but OpenBSD 4.0 lacks
lchmod and lutimes, so there is no way to affect ctime without
unlinking and recreating the symlink, which is too dangerous.

* lib/chown.c (rpl_chown): Work around the bug.
* lib/lchown.c (rpl_lchown): Attempt to do likewise.
* m4/chown.m4 (gl_FUNC_CHOWN): Test for ctime bug.
* m4/lchown.m4 (gl_FUNC_LCHOWN): Check for lchmod.
* modules/chown (Depends-on): Add stdbool.
* modules/lchown (Depends-on): Likewise.
* doc/posix-functions/chown.texi (chown): Document the bug.
* doc/posix-functions/lchown.texi (lchown): Likewise.
* tests/test-lchown.h (test_chown): Relax test.

Signed-off-by: Eric Blake 
---
 ChangeLog   |   11 ++
 doc/posix-functions/chown.texi  |4 ++
 doc/posix-functions/lchown.texi |5 +++
 lib/chown.c |   71 +++---
 lib/lchown.c|   46 +++--
 m4/chown.m4 |   40 +-
 m4/lchown.m4|   12 ---
 modules/chown   |3 +-
 modules/lchown  |1 +
 tests/test-lchown.h |   12 ++-
 10 files changed, 171 insertions(+), 34 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 64b11d2..599a944 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2009-11-17  Eric Blake  

+   chown: work around OpenBSD bug
+   * lib/chown.c (rpl_chown): Work around the bug.
+   * lib/lchown.c (rpl_lchown): Attempt to do likewise.
+   * m4/chown.m4 (gl_FUNC_CHOWN): Test for ctime bug.
+   * m4/lchown.m4 (gl_FUNC_LCHOWN): Check for lchmod.
+   * modules/chown (Depends-on): Add stdbool.
+   * modules/lchown (Depends-on): Likewise.
+   * doc/posix-functions/chown.texi (chown): Document the bug.
+   * doc/posix-functions/lchown.texi (lchown): Likewise.
+   * tests/test-lchown.h (test_chown): Relax test.
+
mkstemp: avoid conflict with C++ keyword template
* lib/mkdtemp.c (mkdtemp): Change spelling of template.
* lib/mkostemp.c (mkostemp): Likewise.
diff --git a/doc/posix-functions/chown.texi b/doc/posix-functions/chown.texi
index e5a80d6..88e25cd 100644
--- a/doc/posix-functions/chown.texi
+++ b/doc/posix-functions/chown.texi
@@ -13,6 +13,10 @@ chown
 @code{chown("link-to-file/",uid,gid)}:
 FreeBSD 7.2, Solaris 9.
 @item
+Some platforms fail to update the change time when at least one
+argument was not -1, but no ownership changes resulted:
+OpenBSD 4.0.
+...@item
 When passed an argument of -1, some implementations really set the owner
 user/group id of the file to this value, rather than leaving that id of the
 file alone.
diff --git a/doc/posix-functions/lchown.texi b/doc/posix-functions/lchown.texi
index 0686bf3..595a05c 100644
--- a/doc/posix-functions/lchown.texi
+++ b/doc/posix-functions/lchown.texi
@@ -13,6 +13,11 @@ lchown
 @code{lchown("link-to-file/",uid,gid)}:
 FreeBSD 7.2, Solaris 9.
 @item
+Some platforms fail to update the change time when at least one
+argument was not -1, but no ownership changes resulted.  However,
+without @code{lchmod}, the replacement only fixes this for non-symlinks:
+OpenBSD 4.0.
+...@item
 This function is missing on some platforms; however, 

usleep (was: pending patches?)

2009-11-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Eric Blake on 11/14/2009 6:18 AM:
> I'm also thinking of adding a usleep module to guarantee Linux semantics
> (usleep(100) waits a second, rather than failing instantly with
> EINVAL).  That will clean up its use somewhat.

I'm pushing this.  Most systems these days still support usleep, even
though POSIX no longer requires it; even mingw has it; so the few
platforms where this implementation rounds up to the ceiling of the next
second should be rare (still correct behavior, just slow).  And there is
still a benefit to using usleep instead of select or nanosleep - fewer
dependencies on external libraries.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksDiEwACgkQ84KuGfSFAYBUoACfZnXo+SByXSHSfOvvn1ZsosXB
lEEAoIv2BZUS+rOWjgwKIIhHa4y7VMk/
=lCtE
-END PGP SIGNATURE-
>From e8eecfd3f7d37692a7b87779b69d6fdc22d88d4d Mon Sep 17 00:00:00 2001
From: Eric Blake 
Date: Tue, 17 Nov 2009 09:24:56 -0700
Subject: [PATCH 1/2] usleep: new module

mingw usleep(100) failed with EINVAL, as allowed by POSIX,
but contrary to GNU usage.  Rather than implement an accurate
usleep based on select or nanosleep, both of which drag in
dependencies on external libraries, this version intentionally
takes the ceiling in seconds if usleep() is missing.

* modules/usleep: New file.
* m4/usleep.m4 (gl_FUNC_USLEEP): Likewise.
* lib/usleep.c (usleep): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add defaults.
* modules/unistd (Makefile.am): Substitute witnesses.
* lib/unistd.in.h (usleep): Add declaration.
* doc/pastposix-functions/usleep.texi (usleep): Document this.
* MODULES.html.sh (Date and time): Likewise.
* modules/usleep-tests (Depends-on): New test.
* tests/test-usleep.c: New file.

Signed-off-by: Eric Blake 
---
 ChangeLog   |   12 +++
 MODULES.html.sh |3 +-
 doc/pastposix-functions/usleep.texi |   18 ++-
 lib/unistd.in.h |   21 
 lib/usleep.c|   58 +++
 m4/unistd_h.m4  |5 ++-
 m4/usleep.m4|   37 ++
 modules/unistd  |3 ++
 modules/usleep  |   26 +++
 modules/usleep-tests|   11 ++
 tests/test-usleep.c |   49 +
 11 files changed, 233 insertions(+), 10 deletions(-)
 create mode 100644 lib/usleep.c
 create mode 100644 m4/usleep.m4
 create mode 100644 modules/usleep
 create mode 100644 modules/usleep-tests
 create mode 100644 tests/test-usleep.c

diff --git a/ChangeLog b/ChangeLog
index 599a944..cf14b4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2009-11-17  Eric Blake  

+   usleep: new module
+   * modules/usleep: New file.
+   * m4/usleep.m4 (gl_FUNC_USLEEP): Likewise.
+   * lib/usleep.c (usleep): Likewise.
+   * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Add defaults.
+   * modules/unistd (Makefile.am): Substitute witnesses.
+   * lib/unistd.in.h (usleep): Add declaration.
+   * doc/pastposix-functions/usleep.texi (usleep): Document this.
+   * MODULES.html.sh (Date and time): Likewise.
+   * modules/usleep-tests (Depends-on): New test.
+   * tests/test-usleep.c: New file.
+
chown: work around OpenBSD bug
* lib/chown.c (rpl_chown): Work around the bug.
* lib/lchown.c (rpl_lchown): Attempt to do likewise.
diff --git a/MODULES.html.sh b/MODULES.html.sh
index 7d42b73..cb791b8 100755
--- a/MODULES.html.sh
+++ b/MODULES.html.sh
@@ -2593,8 +2593,9 @@ func_all_modules ()
   func_begin_table
   func_module gethrxtime
   func_module gettime
-  func_module settime
   func_module posixtm
+  func_module settime
+  func_module usleep
   func_module xnanosleep
   func_end_table

diff --git a/doc/pastposix-functions/usleep.texi 
b/doc/pastposix-functions/usleep.texi
index bb38152..8ca0da9 100644
--- a/doc/pastposix-functions/usleep.texi
+++ b/doc/pastposix-functions/usleep.texi
@@ -4,23 +4,25 @@ usleep

 POSIX specification: @url{http://www.opengroup.org/susv3xsh/usleep.html}

-Gnulib module: ---
+Gnulib module: usleep

 Portability problems fixed by Gnulib:
 @itemize
+...@item
+On some systems, @code{usleep} rejects attempts to sleep longer than 1
+second, as allowed by POSIX:
+mingw.
+...@item
+This function is missing on some platforms.  However, the replacement
+is designed to be lightweight, and may round to the neareset second;
+use @code{select} or @code{nanosleep} if better resolution is needed:
+IRIX 5.3, Solaris 2.4, older mingw, BeOS.
 @end itemize

 Portability problems not fixed by Gnulib:
 @itemize
 @item
-