+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ Consolidate all uses of PATH_MAX in *.m4 files.
+ * m4/pathmax.m4 (gl_PATHMAX_SNIPPET, gl_PATHMAX_SNIPPET_PREREQ): New
+ macros.
+ * m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Use gl_PATHMAX_SNIPPET_PREREQ
+ and gl_PATHMAX_SNIPPET.
+ * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
+ * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
+ * modules/chdir-long (Files): Add m4/pathmax.m4.
+ * modules/getcwd (Files): Likewise.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ ftruncate: Un-deprecate, concentrate on Win32 support.
+ * modules/ftruncate (Status, Notice): Remove sections.
+ (Depends-on): Add largefile.
+ * m4/ftruncate.m4 (gl_FUNC_FTRUNCATE): Drop failure message on
+ non-mingw platforms.
+ * lib/ftruncate.c: Remove code for the older platforms. For Win32,
+ include <io.h>.
+ * modules/perror-tests (Depends-on): Add ftruncate.
+ * doc/posix-functions/ftruncate.texi: Mention the MSVC problem and the
+ 'ftruncate' module.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ Add dependencies to new dirent related modules.
+ * modules/opendir (Depends-on): Add closedir.
+ * modules/getcwd (Depends-on): Add opendir, closedir.
+ * modules/dirent-safer-tests (Depends-on): Likewise.
+ * modules/fdopendir-tests (Depends-on): Likewise.
+ * modules/rename-tests (Depends-on): Add opendir, readdir, closedir.
+ * modules/renameat-tests (Depends-on): Likewise.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ opendir: Avoid compilation error on mingw.
+ * lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
+ * modules/opendir (Depends-on): Add unistd.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ ftruncate tests: Avoid a test failure on mingw.
+ * tests/test-ftruncate.c (main): Allow a failure with EACCES.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ select tests: Avoid test failures on OSF/1 5.1 and mingw.
+ * tests/test-select.h (test_bad_fd): Disable all tests on OSF/1 and
+ native Windows.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ New module 'fdopen'.
+ * lib/stdio.in.h (fdopen): New declaration.
+ * lib/fdopen.c: New file.
+ * m4/fdopen.m4: New file.
+ * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize GNULIB_FDOPEN,
+ REPLACE_FDOPEN.
+ * modules/stdio (Makefile.am): Substitute GNULIB_FDOPEN,
+ REPLACE_FDOPEN.
+ * modules/fdopen: New file.
+ * modules/stdio-tests (Depends-on): Remove fdopen-tests.
+ * tests/test-stdio-c++.cc: Check signature of fdopen.
+ * doc/posix-functions/fdopen.texi: Mention the new module.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ unlockpt tests: Avoid test failure on NetBSD 5.1.
+ * tests/test-unlockpt.c (main): Skip the EBADF tests on NetBSD.
+ * doc/posix-functions/unlockpt.texi: Mention the bug on NetBSD.
+
+2011-09-21 Bruno Haible <bruno@clisp.org>
+
+ getlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
+ * tests/test-getlogin.c (main): Allow a failure with EINVAL.
+ * tests/test-getlogin_r.c (main): Likewise.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ time tests: Don't require pid_t.
+ * doc/posix-headers/time.texi: Revert last change.
+ * m4/time_h.m4 (gl_HEADER_TIME_H_BODY): Revert last change.
+ * tests/test-time.c: Comment out the check for pid_t.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ fsync tests: Avoid a test failure on mingw.
+ * tests/test-fsync.c (main): Allow a failure with EIO.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ euidaccess: Update comments.
+ * m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Update comments.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ Ensure EBADF returns for socket functions on mingw.
+ * lib/accept.c (rpl_accept): Fail with error EBADF if the file
+ descriptor is invalid.
+ * lib/bind.c (rpl_bind): Likewise.
+ * lib/connect.c (rpl_connect): Likewise.
+ * lib/getpeername.c (rpl_getpeername): Likewise.
+ * lib/getsockname.c (rpl_getsockname): Likewise.
+ * lib/getsockopt.c (rpl_getsockopt): Likewise.
+ * lib/listen.c (rpl_listen): Likewise.
+ * lib/recv.c (rpl_recv): Likewise.
+ * lib/recvfrom.c (rpl_recvfrom): Likewise.
+ * lib/send.c (rpl_send): Likewise.
+ * lib/sendto.c (rpl_sendto): Likewise.
+ * lib/setsockopt.c (rpl_setsockopt): Likewise.
+ * lib/shutdown.c (rpl_shutdown): Likewise.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ select tests: EBADF tests.
+ * tests/test-select.h (do_select_bad_fd, do_select_bad_fd_nowait,
+ test_bad_fd): New functions.
+ (test_function): Invoke also test_bad_fd.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ Tests for module 'posix_spawn_file_actions_addopen.
+ * modules/posix_spawn_file_actions_addopen-tests: New file.
+ * tests/test-posix_spawn_file_actions_addopen.c: New file.
+
+ Tests for module 'posix_spawn_file_actions_adddup2'.
+ * modules/posix_spawn_file_actions_adddup2-tests: New file.
+ * tests/test-posix_spawn_file_actions_adddup2.c: New file.
+
+ Tests for module 'posix_spawn_file_actions_addclose'.
+ * modules/posix_spawn_file_actions_addclose-tests: New file.
+ * tests/test-posix_spawn_file_actions_addclose.c: New file.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ Tests for module 'unlockpt'.
+ * modules/unlockpt-tests: New file.
+ * tests/test-unlockpt.c: New file.
+ * doc/posix-functions/unlockpt.texi: Mention the Cygwin 1.7 problem.
+
+ Tests for module 'grantpt'.
+ * modules/grantpt-tests: New file.
+ * tests/test-grantpt.c: New file.
+ * doc/posix-functions/grantpt.texi: Mention the Cygwin 1.7 problem.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ freopen tests: EBADF tests.
+ * tests/test-freopen.c: Include errno.h, unistd.h.
+ (main): Add tests for EBADF, commented out for the moment.
+
+ fclose tests: EBADF tests.
+ * tests/test-fclose.c (main): Add tests for EBADF.
+
+ fflush tests: EBADF tests.
+ * tests/test-fflush.c: Include errno.h, macros.h.
+ (main): Add tests for EBADF.
+
+ ftello tests: EBADF tests.
+ * tests/test-ftello4.sh: New file.
+ * tests/test-ftello4.c: New file.
+ * modules/ftello-tests (Files): Add them.
+ (Makefile.am): Arrange to compile test-ftello4 and run test-ftello4.sh.
+
+ fseeko tests: EBADF tests.
+ * tests/test-fseeko4.sh: New file.
+ * tests/test-fseeko4.c: New file.
+ * modules/fseeko-tests (Files): Add them.
+ (Makefile.am): Arrange to compile test-fseeko4 and run test-fseeko4.sh.
+
+ Tests for function fputc().
+ * modules/fputc-tests: New file.
+ * tests/test-fputc.c: New file.
+ * modules/stdio-tests (Depends-on): Add fputc-tests.
+
+ Tests for function fgetc().
+ * modules/fgetc-tests: New file.
+ * tests/test-fgetc.c: New file.
+ * modules/stdio-tests (Depends-on): Add fgetc-tests.
+
+ Tests for function fdopen().
+ * modules/fdopen-tests: New file.
+ * tests/test-fdopen.c: New file.
+ * modules/stdio-tests (Depends-on): Add fdopen-tests.
+
+ Tests for module 'vdprintf'.
+ * modules/vdprintf-tests: New file.
+ * tests/test-vdprintf.c: New file.
+
+ Tests for module 'dprintf'.
+ * modules/dprintf-tests: New file.
+ * tests/test-dprintf.c: New file.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ Tests for module 'ioctl'.
+ * modules/ioctl-tests: New file.
+ * tests/test-ioctl.c: New file.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ fcntl tests: EBADF tests.
+ * tests/test-fcntl.c (main): Add more tests for EBADF.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ utimensat tests: EBADF tests.
+ * tests/test-utimensat.c (main): Add tests for EBADF.
+
+ renameat tests: EBADF tests.
+ * tests/test-renameat.c (main): Add tests for EBADF.
+
+ mkfifoat tests: EBADF tests.
+ * tests/test-mkfifoat.c (main): Add tests for EBADF.
+
+ readlinkat tests: EBADF tests.
+ * tests/test-readlinkat.c (main): Add tests for EBADF.
+
+ symlinkat tests: EBADF tests.
+ * tests/test-symlinkat.c (main): Add tests for EBADF.
+
+ linkat tests: EBADF tests.
+ * tests/test-linkat.c (main): Add tests for EBADF.
+
+ Tests for module 'faccessat'.
+ * modules/faccessat-tests: New file.
+ * tests/test-faccessat.c: New file.
+
+ fdopendir tests: EBADF tests.
+ * tests/test-fdopendir.c (main): Add more tests for EBADF.
+
+ openat tests: EBADF tests.
+ * tests/test-fchownat.c (main): Add tests for EBADF.
+ * tests/test-fstatat.c (main): Likewise.
+ * tests/test-mkdirat.c (main): Likewise.
+ * tests/test-openat.c (main): Likewise.
+ * tests/test-unlinkat.c (main): Likewise.
+ * tests/test-fchmodat.c: New file.
+ * modules/openat-tests (Files): Add tests/test-fchmodat.c.
+ (Makefile.am): Also run 'test-fchmodat'.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ utimens, futimens, fdutimensat tests: EBADF tests.
+ * tests/test-futimens.h (test_futimens): Add more tests for EBADF.
+
+ Tests for function fstat().
+ * modules/fstat-tests: New file.
+ * tests/test-fstat.c: New file.
+ * modules/sys_stat-tests (Depends-on): Add fstat-tests.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ test-ttyname_r tests: EBADF tests.
+ * tests/test-ttyname_r.c (main): Add tests for EBADF.
+
+ Tests for module 'isatty'.
+ * modules/isatty-tests: New file.
+ * tests/test-isatty.c: New file.
+
+ Tests for module 'write'.
+ * modules/write-tests: New file.
+ * tests/test-write.c: New file.
+
+ Tests for module 'read'.
+ * modules/read-tests: New file.
+ * tests/test-read.c: New file.
+
+ pwrite tests: EBADF tests.
+ * tests/test-pwrite.c (main): Add tests for EBADF.
+
+ pread tests: EBADF tests.
+ * tests/test-pread.c (main): Add tests for EBADF.
+
+ lseek tests: EBADF tests.
+ * tests/test-lseek.c (main): Add more tests for EBADF.
+
+ Tests for module 'ftruncate'.
+ * modules/ftruncate-tests: New file.
+ * tests/test-ftruncate.sh: New file.
+ * tests/test-ftruncate.c: New file.
+
+ fsync tests: EBADF tests.
+ * tests/test-fsync.c (main): Add more tests for EBADF.
+
+ fdatasync tests: EBADF tests.
+ * tests/test-fdatasync.c (main): Add more tests for EBADF.
+
+ Tests for module 'fchown'.
+ * modules/fchown-tests: New file.
+ * tests/test-fchown.c: New file.
+
+ Tests for module 'fchmod'.
+ * modules/fchmod-tests: New file.
+ * tests/test-fchmod.c: New file.
+
+ fchdir tests: EBADF tests.
+ * tests/test-fchdir.c (main): Add more tests for EBADF.
+
+ dup2 tests: EBADF tests.
+ * tests/test-dup2.c (main): Add more tests for EBADF.
+
+ Tests for module 'dup'.
+ * modules/dup-tests: New file.
+ * tests/test-dup.c: New file.
+
+ Tests for module 'close'.
+ * modules/close-tests: New file.
+ * tests/test-close.c: New file.
+
+2011-09-20 Bruno Haible <bruno@clisp.org>
+
+ Tests for module 'shutdown'.
+ * modules/shutdown-tests: New file.
+ * tests/test-shutdown.c: New file.
+
+ Tests for module 'setsockopt'.
+ * modules/setsockopt-tests: New file.
+ * tests/test-setsockopt.c: New file.
+
+ Tests for module 'sendto'.
+ * modules/sendto-tests: New file.
+ * tests/test-sendto.c: New file.
+
+ Tests for module 'send'.
+ * modules/send-tests: New file.
+ * tests/test-send.c: New file.
+
+ Tests for module 'recvfrom'.
+ * modules/recvfrom-tests: New file.
+ * tests/test-recvfrom.c: New file.
+
+ Tests for module 'recv'.
+ * modules/recv-tests: New file.
+ * tests/test-recv.c: New file.
+
+ Tests for module 'listen'.
+ * modules/listen-tests: New file.
+ * tests/test-listen.c: New file.
+
+ Tests for module 'getsockopt'.
+ * modules/getsockopt-tests: New file.
+ * tests/test-getsockopt.c: New file.
+
+ Tests for module 'getsockname'.
+ * modules/getsockname-tests: New file.
+ * tests/test-getsockname.c: New file.
+
+ Tests for module 'getpeername'.
+ * modules/getpeername-tests: New file.
+ * tests/test-getpeername.c: New file.
+
+ Tests for module 'connect'.
+ * modules/connect-tests: New file.
+ * tests/test-connect.c: New file.
+
+ Tests for module 'bind'.
+ * modules/bind-tests: New file.
+ * tests/test-bind.c: New file.
+
+ accept4 tests: Fix for native Windows.
+ * tests/test-accept4.c: Include sockets.h.
+ (main): Invoke gl_sockets_startup.
+ * modules/accept4-tests (Depends-on): Add sockets.
+
+ accept tests: Fix for native Windows.
+ * tests/test-accept.c: Include sockets.h.
+ (main): Invoke gl_sockets_startup.
+ * modules/accept-tests (Depends-on): Add sockets.
+
+2011-09-19 Bruno Haible <bruno@clisp.org>
+
+ msvc-inval: Require a semicolon after DONE_MSVC_INVAL.
+ * lib/msvc-inval.h (TRY_MSVC_INVAL, DONE_MSVC_INVAL): Wrap in a
+ do...while(0).
+ * lib/dup2.c (rpl_dup2): Add a semicolon after DONE_MSVC_INVAL.
+ Suggested by Paul Eggert.
+
+2011-09-19 Bruno Haible <bruno@clisp.org>
+
+ sched: Ensure pid_t is defined.
+ * m4/sched_h.m4 (gl_SCHED_H): Arrange to override <sched.h> if it does
+ not define pid_t.
+ * lib/sched.in.h: Include <sys/types.h>.
+ * doc/posix-headers/sched.texi: Mention the pid_t problem.
+ Reported by Tom G. Christensen <tgc@jupiterrise.com>.
+
+2011-09-19 Bruno Haible <bruno@clisp.org>
+
+ msvc-inval: Ensure the entire expansion is a single statement.
+ * lib/msvc-inval.h (TRY_MSVC_INVAL, DONE_MSVC_INVAL): Add an extra pair
+ of braces.
+
+2011-09-19 Jim Meyering <meyering@redhat.com>
+
+ tests: use printf, not echo in init.sh's warn_ function
+ * tests/init.sh (warn_): Use printf, not echo. The latter would
+ misbehave when given strings containing a backslash or starting
+ with e.g., -n. James Youngman suggested setting IFS.
+
+2011-09-19 Eric Blake <eblake@redhat.com>
+
+ futimens: enhance test
+ * tests/test-futimens.h (test_futimens): Also check for EBADF on
+ closed non-negative fd.
+
+ date: accept 'hence' as opposite of 'ago'
+ * lib/parse-datetime.y (relative_time_table): Add 'hence'.
+ * tests/test-parse-datetime.c (main): Enhance test.
+ Suggested by Jesse Wilson.
+
+2011-09-19 Jim Meyering <meyering@redhat.com>
+
+ getcwd: don't fail in a deep directory on a system without openat
+ Before this change, getcwd would fail when called from a directory
+ of depth PATH_MAX / 3 or greater. That was due to the fact that
+ the non-openat implementation used "..", "../..", "../../..", etc.
+ to access ancestor directories. With too many, that string would
+ be longer than PATH_MAX.
+ * lib/getcwd.c (HAVE_OPENAT_SUPPORT): Define also when we are
+ using gnulib's openat replacement.
+ * m4/openat.m4: Set GNULIB_OPENAT, so getcwd.c knows when
+ we're using the replacement function.
+
2011-09-14 Martin von Gagern <Martin.vGagern@gmx.net>
maint.mk: avoid warnings from perl about missing files