gnulib.git
12 years agoglthread/*, strsignal: Support for MSVC.
Bruno Haible [Mon, 3 Oct 2011 23:19:29 +0000 (01:19 +0200)]
glthread/*, strsignal: Support for MSVC.

* lib/glthread/cond.h: Define WIN32_LEAN_AND_MEAN, so as to avoid
including <winsock.h> on MSVC 9.
* lib/glthread/lock.h: Likewise.
* lib/glthread/thread.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/glthread/yield.h: Likewise.
* lib/strsignal.c: Include <string.h> first. Don't include <unistd.h>
if HAVE_UNISTD_H is false.
* m4/strsignal.m4 (gl_PREREQ_STRSIGNAL): Test for <unistd.h>.

12 years agononblocking tests: Fix test failure on OpenBSD/SPARC64.
Bruno Haible [Mon, 3 Oct 2011 14:15:47 +0000 (16:15 +0200)]
nonblocking tests: Fix test failure on OpenBSD/SPARC64.

* tests/test-nonblocking-socket.h (SOCKET_DATA_BLOCK_SIZE) [OpenBSD]:
Set to 100000.

12 years agoacl: Fix specification.
Bruno Haible [Mon, 3 Oct 2011 13:48:57 +0000 (15:48 +0200)]
acl: Fix specification.

* lib/file-has-acl.c (file_has_acl): Fix specification.

12 years agorelocatable-lib[-lgpl]: Avoid expensive /proc access on Linux, Cygwin.
Bruno Haible [Mon, 3 Oct 2011 11:15:34 +0000 (13:15 +0200)]
relocatable-lib[-lgpl]: Avoid expensive /proc access on Linux, Cygwin.

* lib/relocatable.c (ENABLE_COSTLY_RELOCATABLE): New macro.
(compute_curr_prefix, shared_library_fullname,
find_shared_library_fullname, get_shared_library_fullname, relocate):
Use it together with PIC && INSTALLDIR.
Reported by <jojelino@gmail.com>
via Charles Wilson <cygwin@cwilson.fastmail.fm>.

12 years agoautoupdate
Karl Berry [Sun, 2 Oct 2011 13:31:01 +0000 (06:31 -0700)]
autoupdate

12 years agomaint.mk: adjust a release-related rule not to require use of gzip
Jim Meyering [Sat, 1 Oct 2011 15:33:42 +0000 (17:33 +0200)]
maint.mk: adjust a release-related rule not to require use of gzip

* top/maint.mk (writable-files): Don't hard-code use of .tar.gz.
Instead, check each file in $(DIST_ARCHIVES).  This is better for
projects that build only .tar.xz files.  Also fix an erroneous test.

12 years agotest-linkat: don't leave behind a temporary file
Jim Meyering [Sat, 1 Oct 2011 13:06:43 +0000 (15:06 +0200)]
test-linkat: don't leave behind a temporary file

* tests/test-linkat.c (main): Don't forget to remove a temporary file.
Otherwise, coreutils' "make distcheck" would fail with this:
  Only in /c/cu/tests/torture/coreutils/test/\
    coreutils-8.13.22-d5caf.old/gnulib-tests: test-linkat.too
  make[2]: *** [my-distcheck] Error 1

12 years agofloat, math: add omitted file
Jim Meyering [Sat, 1 Oct 2011 12:34:09 +0000 (14:34 +0200)]
float, math: add omitted file

* lib/itold.c: Add file, required for yesterday's float change.

12 years agoisinf: Fix for OpenBSD/x86.
Bruno Haible [Sat, 1 Oct 2011 10:07:28 +0000 (12:07 +0200)]
isinf: Fix for OpenBSD/x86.

* m4/isinf.m4 (gl_ISINFL_WORKS): Also test the behaviour of isinf on
pseudo-NaNs, pseudo-Infinities, and other non-IEEE values.
* doc/posix-functions/isinf.texi: Mention the problem on OpenBSD/x86.

12 years agoisfinite: Fix syntax error in configure test.
Bruno Haible [Sat, 1 Oct 2011 09:58:48 +0000 (11:58 +0200)]
isfinite: Fix syntax error in configure test.

* m4/isfinite.m4 (gl_ISFINITEL_WORKS): Fix syntax error.

12 years agoisfinite: Fix typo.
Bruno Haible [Sat, 1 Oct 2011 09:50:52 +0000 (11:50 +0200)]
isfinite: Fix typo.

* m4/isfinite.m4 (gl_ISFINITEL_WORKS): When cross-compiling, set
gl_cv_func_isfinitel_works, not gl_cv_func_isnanl_works.

12 years agononblocking tests: Fix test failure on Linux/IA-64.
Bruno Haible [Sat, 1 Oct 2011 09:23:31 +0000 (11:23 +0200)]
nonblocking tests: Fix test failure on Linux/IA-64.

* tests/test-nonblocking-pipe.h (PIPE_DATA_BLOCK_SIZE) [Linux/IA-64]:
Set to 270000.

12 years agomkfifoat tests: Fix a test failure on mingw.
Bruno Haible [Sat, 1 Oct 2011 08:50:57 +0000 (10:50 +0200)]
mkfifoat tests: Fix a test failure on mingw.

* tests/test-mkfifoat.c (main): Allow mkfifoat or test_mknodat to fail
with error ENOSYS.

12 years agofloat, math: Fix 'int' to 'long double' conversion on Linux/SPARC64.
Bruno Haible [Fri, 30 Sep 2011 19:07:43 +0000 (21:07 +0200)]
float, math: Fix 'int' to 'long double' conversion on Linux/SPARC64.

* m4/float_h.m4 (gl_FLOAT_H): Test conversion from 'int' to
'long double'. Set REPLACE_ITOLD.
* lib/float.in.h (_Qp_itoq, _gl_float_fix_itold): New declarations.
* lib/math.in.h (_Qp_itoq, _gl_math_fix_itold): New declarations.
* lib/itold.c: New file.
* modules/float (Files): Add lib/itold.c.
(configure.ac): When REPLACE_ITOLD is 1, arrange to compile itold.c.
(Makefile.am): Substitute REPLACE_ITOLD.
* modules/math (Depends-on): Add float.
(Makefile.am): Substitute REPLACE_ITOLD.
* doc/posix-headers/float.texi: Mention problem on Linux/SPARC64.
* doc/posix-headers/math.texi: Likewise.
* doc/posix-functions/logl.texi: Likewise.

12 years agononblocking tests: Fix test failure on Linux/SPARC (32-bit and 64-bit).
Bruno Haible [Fri, 30 Sep 2011 15:44:22 +0000 (17:44 +0200)]
nonblocking tests: Fix test failure on Linux/SPARC (32-bit and 64-bit).

* tests/test-nonblocking-pipe.h (PIPE_DATA_BLOCK_SIZE) [Linux/SPARC]:
Set to 140000.

12 years agognulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible [Fri, 30 Sep 2011 10:10:27 +0000 (12:10 +0200)]
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.

* gnulib-tool (func_import): If the configure.ac has an AC_PROG_CC_STDC
invocation, say "right after AC_PROG_CC_STDC", not "right after
AC_PROG_CC".
Reported by Gary V. Vaughan <gary@gnu.org>.

12 years agoCentralize C99 requirement.
Bruno Haible [Fri, 30 Sep 2011 09:54:58 +0000 (11:54 +0200)]
Centralize C99 requirement.

* m4/gnulib-common.m4 (gl_PROG_CC_C99): New macro.
* modules/stdarg (configure.ac-early): Invoke it instead of
AC_PROG_CC_STDC.
Reported by Gary V. Vaughan and Paul Eggert.

12 years agofloat: Fix LDBL_MAX value on Linux/PowerPC.
Bruno Haible [Fri, 30 Sep 2011 01:56:26 +0000 (03:56 +0200)]
float: Fix LDBL_MAX value on Linux/PowerPC.

* m4/float_h.m4 (gl_FLOAT_H): Set FLOAT_H and REPLACE_FLOAT_LDBL also
on Linux/PowerPC.
* lib/float.in.h (LDBL_MAX): Redefine also on Linux/PowerPC.
* lib/float.c (gl_LDBL_MAX): Also define on Linux/PowerPC.
* doc/posix-headers/float.texi: Mention Linux/PowerPC as an affected
platform.
Reported by Andreas Metzler <ametzler@downhill.at.eu.org>.

12 years agoTweak last ChangeLog entry.
Bruno Haible [Thu, 29 Sep 2011 19:39:39 +0000 (21:39 +0200)]
Tweak last ChangeLog entry.

12 years agodoc: Improve doc about gl_EARLY.
Bruno Haible [Thu, 29 Sep 2011 08:50:37 +0000 (10:50 +0200)]
doc: Improve doc about gl_EARLY.

* doc/gnulib-tool.texi (Initial import): Mention where to place an
AC_PROG_CC_STDC invocation.
Reported by Gary V. Vaughan <gary@vaughan.pe>.

12 years agofgetc, fputc, fread, fwrite tests: Fix link error.
Bruno Haible [Wed, 28 Sep 2011 08:57:32 +0000 (10:57 +0200)]
fgetc, fputc, fread, fwrite tests: Fix link error.

* tests/test-fgetc.c (main): Don't invoke gl_msvc_inval_ensure_handler
on non-MSVC platforms.
* tests/test-fputc.c (main): Likewise.
* tests/test-fread.c (main): Likewise.
* tests/test-fwrite.c (main): Likewise.
Reported by Jim Meyering.

12 years agofputc, fwrite tests: Avoid test failure on MSVC.
Bruno Haible [Wed, 28 Sep 2011 00:01:19 +0000 (02:01 +0200)]
fputc, fwrite tests: Avoid test failure on MSVC.

* tests/test-fgetc.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fputc.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fread.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* tests/test-fwrite.c: Include msvc-inval.h.
(main): Invoke gl_msvc_inval_ensure_handler.
* modules/fgetc-tests (Depends-on): Add msvc-inval.
* modules/fputc-tests (Depends-on): Likewise.
* modules/fread-tests (Depends-on): Likewise.
* modules/fwrite-tests (Depends-on): Likewise.

12 years agoraise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.
Bruno Haible [Tue, 27 Sep 2011 22:49:04 +0000 (00:49 +0200)]
raise: Fix double declaration with modules 'sigprocmask' and 'sigpipe'.

* lib/signal.in.h (GNULIB_defined_signal_blocking): New macro.
(raise): Remove older, duplicated declaration.
(_gl_raise_SIGPIPE): New declaration.
* lib/sigprocmask.c (_gl_raise_SIGPIPE): New function.
(rpl_raise): Remove function.
* lib/raise.c (rpl_raise, raise): Merge into a single function. Handle
a gnulib-defined SIGPIPE here.
* m4/raise.m4 (gl_FUNC_RAISE): Set REPLACE_RAISE also if the module
'sigprocmask' has detected missing signal-blocking and the module
'sigpipe' is enabled.
Reported by Tatsuro MATSUOKA <tmacchant5@yahoo.co.jp>.

12 years agoautoupdate
Karl Berry [Tue, 27 Sep 2011 13:20:10 +0000 (06:20 -0700)]
autoupdate

12 years agobase64-tests: avoid memory leak
Gijs van Tulder [Mon, 26 Sep 2011 17:58:01 +0000 (19:58 +0200)]
base64-tests: avoid memory leak

* tests/test-base64.c (main): Plug memory leak.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agobase32: new module
Gijs van Tulder [Sun, 25 Sep 2011 12:06:58 +0000 (14:06 +0200)]
base32: new module

* modules/base32: New module.
* lib/base32.c: New file.
* lib/base32.h: Likewise.
* m4/base32.m4: Likewise.
* modules/base32-tests: New test.
* tests/test-base32.c: Likewise.
* MODULES.html.sh (Misc): Mention it.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agognulib: use more-standard license notice wording
Paul Eggert [Mon, 26 Sep 2011 19:58:27 +0000 (12:58 -0700)]
gnulib: use more-standard license notice wording

* gnulib-tool (func_emit_copyright_notice): When emitting a
license notice into a file, use the standard wording as suggested
by the current information for GNU maintainers, except say "file"
rather than "program".  The new wording gives a license version
number, which addresses an issue raised by Glenn Morris in
<http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00397.html>.
* m4/onceonly.m4: Use that same wording here, too.

12 years agodup2: minor simplification
Paul Eggert [Mon, 26 Sep 2011 16:27:08 +0000 (09:27 -0700)]
dup2: minor simplification

* m4/dup2.m4 (gl_PREREQ_DUP2): Don't require AC_C_INLINE,
as lib/dup2.c no longer uses 'inline'.

12 years agostrings: Fix compilation error on MSVC.
Bruno Haible [Mon, 26 Sep 2011 00:36:46 +0000 (02:36 +0200)]
strings: Fix compilation error on MSVC.

* lib/strings.in.h: Include <stddef.h> for size_t.

12 years agofflush et al.: Document limitation on MSVC.
Bruno Haible [Sun, 25 Sep 2011 21:22:19 +0000 (23:22 +0200)]
fflush et al.: Document limitation on MSVC.

* doc/posix-functions/fflush.texi: Document possible crash in handling
mode other than DEFAULT_HANDLING.
* doc/posix-functions/fgetc.texi: Likewise.
* doc/posix-functions/fputc.texi: Likewise.
* doc/posix-functions/fread.texi: Likewise.
* doc/posix-functions/fwrite.texi: Likewise.

12 years agomsvc-inval: Allow three invalid parameter handling modes.
Bruno Haible [Sun, 25 Sep 2011 21:08:45 +0000 (23:08 +0200)]
msvc-inval: Allow three invalid parameter handling modes.

* lib/msvc-inval.h: Don't include <stdlib.h> here.
(DEFAULT_HANDLING, HAIRY_LIBRARY_HANDLING, SANE_LIBRARY_HANDLING): New
macros.
(gl_msvc_inval_ensure_handler, TRY_MSVC_INVAL, CATCH_MSVC_INVAL,
DONE_MSVC_INVAL): Implement DEFAULT_HANDLING. Treat
SANE_LIBRARY_HANDLING as a no-op.
* lib/msvc-inval.c: Treat SANE_LIBRARY_HANDLING as a no-op. Include
<stdlib.h>.
(gl_msvc_invalid_parameter_handler): Implement DEFAULT_HANDLING.

12 years agomsvc-inval: Make handler multithread-safe.
Bruno Haible [Sun, 25 Sep 2011 20:02:18 +0000 (22:02 +0200)]
msvc-inval: Make handler multithread-safe.

* lib/msvc-inval.h (struct gl_msvc_inval_per_thread): New type.
(gl_msvc_inval_restart, gl_msvc_inval_restart_valid): Remove
declarations.
(gl_msvc_inval_current): New declaration.
(TRY_MSVC_INVAL, CATCH_MSVC_INVAL, DONE_MSVC_INVAL) [!_MSC_VER]:
Operate on the structure returned by gl_msvc_inval_current().
* lib/msvc-inval.c (gl_msvc_inval_restart, gl_msvc_inval_restart_valid):
Remove varaiables.
(tls_index, tls_initialized): New variables.
(not_per_thread): New variable.
(gl_msvc_inval_current): New function.
(gl_msvc_invalid_parameter_handler) [!_MSC_VER]: Use the structure
returned by gl_msvc_inval_current().

12 years agomsvc-inval: Install handler globally.
Bruno Haible [Sun, 25 Sep 2011 19:05:20 +0000 (21:05 +0200)]
msvc-inval: Install handler globally.

* lib/msvc-inval.h (STATUS_GNULIB_INVALID_PARAMETER): Define also for
!_MSC_VER.
(gl_msvc_invalid_parameter_handler): Remove declaration.
(gl_msvc_inval_restart_valid, gl_msvc_inval_ensure_handler): New
declarations.
(TRY_MSVC_INVAL, CATCH_MSVC_INVAL, DONE_MSVC_INVAL) [!_MSC_VER]:
Install the handler globally, don't uninstall it.
* lib/msvc-inval.c (gl_msvc_inval_restart_valid): New variable.
(gl_msvc_invalid_parameter_handler): Make static. If the restart is not
currently valid, call RaiseException instead.
(gl_msvc_inval_initialized, gl_msvc_inval_ensure_handler): Define also
for !_MSC_VER.

12 years agostrerror_r-posix: Fix for MSVC 9.
Bruno Haible [Sun, 25 Sep 2011 12:54:47 +0000 (14:54 +0200)]
strerror_r-posix: Fix for MSVC 9.

* lib/strerror_r.c (local_snprintf): New function.
(snprintf): Define to local_snprintf, not to _snprintf.

12 years agoftruncate: Support for MSVC 9.
Bruno Haible [Sun, 25 Sep 2011 12:10:58 +0000 (14:10 +0200)]
ftruncate: Support for MSVC 9.

* lib/ftruncate.c: Include errno.h, msvc-inval.h.
(chsize_nothrow): New function.
(chsize): Redefine as a macro.
* m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): Require AC_C_INLINE.
* modules/ftruncate (Depends-on): Add msvc-inval.

12 years agoNew module 'fstat'.
Bruno Haible [Sun, 25 Sep 2011 11:42:08 +0000 (13:42 +0200)]
New module 'fstat'.

* lib/sys_stat.in.h (fstat): Declare only if GNULIB_FSTAT is set.
* lib/fstat.c: New file, based on a piece of lib/fchdir.c.
* lib/fchdir.c (rpl_fstat): Remove function.
* m4/fstat.m4: New file.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_FSTAT.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Test whether fstat is
declared.
(gl_SYS_STAT_H_DEFAULTS): Initialize GNULIB_FSTAT.
* modules/sys_stat (Makefile.am): Substitute GNULIB_FSTAT.
* modules/fstat: New file.
* modules/sys_stat-tests (Depends-on): Remove fstat-tests.
* tests/test-sys_stat-c++.cc (fstat): Check only if GNULIB_TEST_FSTAT
is set.
* doc/posix-functions/fstat.texi: Mention the new module and the
problem on MSVC.
* NEWS: Mention the change.
* modules/acl (Depends-on): Add fstat.
* modules/chdir-safer (Depends-on): Likewise.
* modules/chown (Depends-on): Likewise.
* modules/copy-file (Depends-on): Likewise.
* modules/fchdir (Depends-on): Likewise.
* modules/fdopendir (Depends-on): Likewise.
* modules/fopen (Depends-on): Likewise.
* modules/fts (Depends-on): Likewise.
* modules/getcwd (Depends-on): Likewise.
* modules/isapipe (Depends-on): Likewise.
* modules/linkat (Depends-on): Likewise.
* modules/lseek (Depends-on): Likewise.
* modules/mkdir-p (Depends-on): Likewise.
* modules/open (Depends-on): Likewise.
* modules/openat (Depends-on): Likewise.
* modules/read-file (Depends-on): Likewise.
* modules/renameat (Depends-on): Likewise.
* modules/utimens (Depends-on): Likewise.

12 years agolinkat: Fix compilation on MSVC 9.
Bruno Haible [Sun, 25 Sep 2011 11:25:16 +0000 (13:25 +0200)]
linkat: Fix compilation on MSVC 9.

* lib/linkat.c: Don't include <stdint.h>.

12 years agofclose: Support for MSVC 9.
Bruno Haible [Sun, 25 Sep 2011 10:10:10 +0000 (12:10 +0200)]
fclose: Support for MSVC 9.

* lib/fclose.c: Include msvc-inval.h.
(fclose_nothrow): New function.
(rpl_fclose): Use it.
* modules/fclose (Depends-on): Add msvc-inval.
* doc/posix-functions/fclose.texi: Mention the problem on MSVC.

12 years agodup2: minor simplifications
Paul Eggert [Sun, 25 Sep 2011 05:49:14 +0000 (22:49 -0700)]
dup2: minor simplifications

* lib/dup2.c (ms_windows_dup2): Omit 'inline' as it's not clear
that it's a performance win.
(rpl_dup2): Change "if !((defined _WIN32 || defined __WIN32__) &&
! defined __CYGWIN__)" to "ifdef F_GETFL".

12 years agotest-futimens: avoid a warning from gcc -Wshadow
Jim Meyering [Sat, 24 Sep 2011 19:02:15 +0000 (21:02 +0200)]
test-futimens: avoid a warning from gcc -Wshadow

* tests/test-futimens.h (test_futimens): Rename inner local, s/fd/fd0/
to avoid a shadowing warning.

12 years agofdopen: Support for MSVC 9.
Bruno Haible [Sat, 24 Sep 2011 16:08:50 +0000 (18:08 +0200)]
fdopen: Support for MSVC 9.

* m4/fdopen.m4 (gl_FUNC_FDOPEN): Set REPLACE_FDOPEN also if
HAVE_MSVC_INVALID_PARAMETER_HANDLER is 1.
* lib/fdopen.c: Include msvc-inval.h.
(fdopen_nothrow): New function.
(rpl_fdopen): Use it.
* modules/fdopen (Depends-on): Add msvc-inval.
* modules/fclose-tests (Depends-on): Add fdopen.
* modules/fflush-tests (Depends-on): Likewise.
* modules/fgetc-tests (Depends-on): Likewise.
* modules/fputc-tests (Depends-on): Likewise.
* modules/fread-tests (Depends-on): Likewise.
* modules/freopen-tests (Depends-on): Likewise.
* modules/fseeko-tests (Depends-on): Likewise.
* modules/ftello-tests (Depends-on): Likewise.
* modules/fwrite-tests  (Depends-on): Likewise.
* doc/posix-functions/fdopen.texi: Mention the problem on MSVC.

12 years agofgetc, fputc, fread, fwrite tests: Avoid compilation error on MSVC.
Bruno Haible [Sat, 24 Sep 2011 15:59:54 +0000 (17:59 +0200)]
fgetc, fputc, fread, fwrite tests: Avoid compilation error on MSVC.

* modules/fgetc-tests (Depends-on): Add unistd.
* modules/fputc-tests (Depends-on): Likewise.
* modules/fread-tests (Depends-on): Likewise.
* modules/fwrite-tests (Depends-on): Likewise.

12 years agodup: Simplify autoconf test.
Bruno Haible [Sat, 24 Sep 2011 15:42:03 +0000 (17:42 +0200)]
dup: Simplify autoconf test.

* m4/dup.m4 (gl_FUNC_DUP): Don't run a test program. Instead, just rely
on gl_MSVC_INVAL's result.

12 years agoTests for function fwrite().
Bruno Haible [Sat, 24 Sep 2011 15:08:38 +0000 (17:08 +0200)]
Tests for function fwrite().

* modules/fwrite-tests: New file.
* tests/test-fwrite.c: New file.
* modules/stdio-tests (Depends-on): Add fwrite-tests.

12 years agoTests for function fread().
Bruno Haible [Sat, 24 Sep 2011 15:07:17 +0000 (17:07 +0200)]
Tests for function fread().

* modules/fread-tests: New file.
* tests/test-fread.c: New file.
* modules/stdio-tests (Depends-on): Add fread-tests.

12 years agoActivate fputc tests.
Bruno Haible [Sat, 24 Sep 2011 15:05:34 +0000 (17:05 +0200)]
Activate fputc tests.

* modules/stdio-tests (Depends-on): Add fputc-tests.

12 years agoEnhance fgetc, fputc tests.
Bruno Haible [Sat, 24 Sep 2011 15:03:49 +0000 (17:03 +0200)]
Enhance fgetc, fputc tests.

* tests/test-fgetc.c (main): Also test the stream's error indicator.
* tests/test-fputc.c (main): Likewise.

12 years agowrite: Support for MSVC 9.
Bruno Haible [Sat, 24 Sep 2011 14:46:51 +0000 (16:46 +0200)]
write: Support for MSVC 9.

* lib/unistd.in.h (write): Replace also when GNULIB_UNISTD_H_NONBLOCKING
is not 1.
* lib/write.c (write_nothrow): New function.
(rpl_write): Define also when GNULIB_NONBLOCKING or GNULIB_SIGPIPE is
not 1. Use write_nothrow.
* m4/write.m4 (gl_FUNC_WRITE): Replace read if the platform has an
invalid parameter handler.
(gl_PREREQ_WRITE): New macro.
* modules/write (Depends-on): Add msvc-inval.
(configure.ac): Invoke gl_PREREQ_WRITE.
* doc/posix-functions/write.texi: Mention the problem on MSVC.

12 years agoread: Fix last commit.
Bruno Haible [Sat, 24 Sep 2011 14:43:26 +0000 (16:43 +0200)]
read: Fix last commit.

* lib/read.c (read_nothrow): Change return type to 'ssize_t'.

12 years agodup2: Fix last commit.
Bruno Haible [Sat, 24 Sep 2011 11:51:39 +0000 (13:51 +0200)]
dup2: Fix last commit.

* lib/dup2.c: Restore comments. Treat Cygwin like Unix.
(rpl_dup2): Disable fcntl workaround on native Windows.

12 years agosigprocmask: Make code safer.
Bruno Haible [Sat, 24 Sep 2011 10:37:54 +0000 (12:37 +0200)]
sigprocmask: Make code safer.

* lib/sigprocmask.c: Move '#include "msvc-inval.h"' before the code
section that changes macro definitions for this compilation unit.

12 years agodup2: clarify by coalescing Windows-specific material
Paul Eggert [Sat, 24 Sep 2011 05:04:20 +0000 (22:04 -0700)]
dup2: clarify by coalescing Windows-specific material

* lib/dup2.c: Move '#include "msvc-inval.h"' and '#include
"msvc-nothrow.h"' to the Windows-specific section, so that the
Emacs source need not contain these include files.
(ms_windows_dup2): Rename from dup2_nothrow, and move all the
Windows-specific fixes into this function rather than just the
nothrow fix, as this shortens and clarifies the code.  Always
define as a function, as that's a bit cleaner than having it be
sometimes a function and sometimes a macro.
(rpl_dup2): Move the Windows-specific stuff out of here and into
ms_windows_dup2.  Don't protect the Haiku-related fix with
"#if !defined __linux__", as the same code also works around
a Linux kernel bug, and it doesn't add any system calls on any
platform.  Add comment about FreeBSD 6.1.

12 years agosigprocmask: move #include directive
Paul Eggert [Sat, 24 Sep 2011 04:54:43 +0000 (21:54 -0700)]
sigprocmask: move #include directive

* lib/sigprocmask.c: Move '#include "msvc-inval.h"' to the
Windows-specific section, so that the Emacs source need not
contain msvc-inval.h.

12 years agoread: Support for MSVC 9.
Bruno Haible [Sat, 24 Sep 2011 02:07:12 +0000 (04:07 +0200)]
read: Support for MSVC 9.

* lib/unistd.in.h (read): Replace also when GNULIB_UNISTD_H_NONBLOCKING
is not 1.
* lib/read.c (read_nothrow): New function.
(rpl_read): Define also when GNULIB_NONBLOCKING is not 1. Use
read_nothrow.
* m4/read.m4 (gl_FUNC_READ): Replace read if the platform has an
invalid parameter handler.
(gl_PREREQ_READ): New macro.
* modules/read (Depends-on): Add msvc-inval.
(configure.ac): Invoke gl_PREREQ_READ.
* doc/posix-functions/read.texi: Mention the problem on MSVC.

12 years agoclose: Support for MSVC 9.
Bruno Haible [Sat, 24 Sep 2011 00:48:19 +0000 (02:48 +0200)]
close: Support for MSVC 9.

* lib/close.c: Include <errno.h>, msvc-inval.h.
(close_nothrow): New function.
(rpl_close): Use it.
* m4/close.m4 (gl_FUNC_CLOSE): Replace close if the platform has an
invalid parameter handler.
* modules/close (Depends-on): Add msvc-inval.
* modules/dup2-tests (Depends-on): Add close.
* modules/dup3-tests (Depends-on): Likewise.
* modules/fcntl-tests (Depends-on): Likewise.
* modules/spawn-pipe-tests (Depends-on): Likewise.
* modules/unistd-safer-tests (Depends-on): Likewise.
* doc/posix-functions/close.texi: Mention the problem on MSVC.

12 years agomsvc-nothrow: Avoid a compiler warning.
Bruno Haible [Sat, 24 Sep 2011 00:17:33 +0000 (02:17 +0200)]
msvc-nothrow: Avoid a compiler warning.

12 years agoNew module 'dup'.
Bruno Haible [Sat, 24 Sep 2011 00:08:13 +0000 (02:08 +0200)]
New module 'dup'.

* lib/unistd.in.h (dup): Declare only if the 'dup' module is in use.
Allow replacement.
* lib/dup.c: New file.
* lib/fchdir.c (rpl_dup): Remove function.
* m4/dup.m4: New file.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Don't set REPLACE_DUP here.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'dup' is declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_DUP.
* modules/unistd (Makefile.am): Substitute GNULIB_DUP.
* modules/dup: New file.
* tests/test-unistd-c++.cc: Check the signature of 'dup' only if the
'dup' module is in use.
* modules/fdopendir (Depends-on): Add dup.
* modules/fdutimensat-tests (Depends-on): Likewise.
* modules/fts (Depends-on): Likewise.
* modules/futimens-tests (Depends-on): Likewise.
* modules/posix_spawnp-tests (Depends-on): Likewise.
* modules/unistd-safer-tests (Depends-on): Likewise.
* modules/utimens-tests (Depends-on): Likewise.
* doc/posix-functions/dup.texi: Mention the new module and the problem
on MSVC.

12 years agogetdtablesize: Support for MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 23:48:27 +0000 (01:48 +0200)]
getdtablesize: Support for MSVC 9.

* lib/getdtablesize.c: Include msvc-inval.h.
(_setmaxstdio_nothrow): New function.
(_setmaxstdio): Redefine it.
* m4/getdtablesize.m4 (gl_PREREQ_GETDTABLESIZE): New macro.
* modules/getdtablesize (Depends-on): Add msvc-inval.
(configure.ac): Invoke gl_PREREQ_GETDTABLESIZE.

12 years agosignal-h: Rename from signal.
Bruno Haible [Fri, 23 Sep 2011 23:28:22 +0000 (01:28 +0200)]
signal-h: Rename from signal.

* modules/signal-h: Renamed from modules/signal.
* modules/pthread_sigmask (Depends-on): Update.
* modules/raise (Depends-on): Likewise.
* modules/sigaction (Depends-on): Likewise.
* modules/sigpipe (Depends-on): Likewise.
* modules/sigprocmask (Depends-on): Likewise.
* modules/sys_select (Depends-on): Likewise.
* modules/signal-h-tests: Renamed from modules/signal-tests.
(Files, Depends-on, Makefile.am): Update.
* tests/test-signal-h.c: Renamed from tests/test-signal.c.
* modules/signal-h-c++-tests: Renamed from modules/signal-c++-tests.
(Files, Makefile.am): Update.
* tests/test-signal-h-c++.cc: Renamed from tests/test-signal-c++.cc.
* tests/test-signal-h-c++2.cc: Renamed from tests/test-signal-c++2.cc.
* modules/signal: New placeholder file.
* MODULES.html.sh (Support for systems lacking POSIX:2008): Update.
* doc/posix-headers/signal.texi: Update.
* NEWS: Mention the change.

12 years agosigprocmask: Avoid crashes through signal() on MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 23:07:22 +0000 (01:07 +0200)]
sigprocmask: Avoid crashes through signal() on MSVC 9.

* lib/sigprocmask.c: Include msvc-inval.h.
(signal_nothrow): New function.
(signal): Redefine it.
* m4/signalblocking.m4 (gl_PREREQ_SIGPROCMASK): Require AC_C_INLINE.
* modules/sigprocmask (Depends-on): Add msvc-inval.
* doc/posix-functions/signal.texi: Mention the problem on MSVC.

12 years agoTests for module 'raise'.
Bruno Haible [Fri, 23 Sep 2011 22:51:58 +0000 (00:51 +0200)]
Tests for module 'raise'.

* modules/raise-tests: New file.
* tests/test-raise.c: New file.

12 years agoraise: Support for MSVC.
Bruno Haible [Fri, 23 Sep 2011 22:50:39 +0000 (00:50 +0200)]
raise: Support for MSVC.

* lib/signal.in.h (raise): New declaration.
* lib/raise.c (raise_nothrow, rpl_raise): New alternate implementation
for native Windows platforms.
* m4/raise.m4: New file.
* m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Initialize GNULIB_RAISE,
HAVE_RAISE, REPLACE_RAISE.
* modules/signal (Makefile.am): Substitute GNULIB_RAISE, HAVE_RAISE,
REPLACE_RAISE.
* modules/raise (Status, Notice): Remove fields.
(Files): Add m4/raise.m4.
(Depends-on): Add signal, msvc-inval.
(configure.ac): Use the common idioms.
(Maintainer): Add me.
* tests/test-signal-c++.cc: Check the signature of raise.
* doc/posix-functions/raise.texi: Mention the problem on MSVC.

12 years agopipe2: Fix compilation on pre-C99 compilers.
Bruno Haible [Fri, 23 Sep 2011 21:03:42 +0000 (23:03 +0200)]
pipe2: Fix compilation on pre-C99 compilers.

* lib/pipe2.c (pipe2): Surround verify(...) declaration with braces.

12 years agodup2: Fix typo in last commit.
Bruno Haible [Fri, 23 Sep 2011 20:19:27 +0000 (22:19 +0200)]
dup2: Fix typo in last commit.

12 years agoNew module 'msvc-nothrow'. Makes _get_osfhandle safe on MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 19:38:44 +0000 (21:38 +0200)]
New module 'msvc-nothrow'. Makes _get_osfhandle safe on MSVC 9.

* lib/msvc-nothrow.h: New file.
* lib/msvc-nothrow.c: New file.
* m4/msvc-nothrow.m4: New file.
* modules/msvc-nothrow: New file.
* lib/dup2.c: Include msvc-nothrow.h.
(rpl_dup2): No need to protect _get_osfhandle call here.
* lib/accept4.c: Include msvc-nothrow.h.
* lib/error.c: Likewise.
* lib/fcntl.c: Likewise.
* lib/lseek.c: Likewise.
* lib/nonblocking.c: Likewise.
* lib/poll.c: Likewise.
* lib/read.c: Likewise.
* lib/select.c: Likewise.
* lib/sockets.h: Likewise.
* lib/sockets.c: Likewise.
* lib/stdio-read.c: Likewise.
* lib/stdio-write.c: Likewise.
* lib/write.c: Likewise.
* lib/w32sock.h: Likewise.
* lib/w32spawn.h: Likewise.
* lib/flock.c: Include msvc-nothrow.h instead of <io.h>.
* lib/fsync.c: Likewise.
* lib/isapipe.c: Likewise.
* modules/dup2 (Depends-on): Add msvc-nothrow.
* modules/accept4 (Depends-on): Likewise.
* modules/error (Depends-on): Likewise.
* modules/fcntl (Depends-on): Likewise.
* modules/lseek (Depends-on): Likewise.
* modules/nonblocking (Depends-on): Likewise.
* modules/poll (Depends-on): Likewise.
* modules/read (Depends-on): Likewise.
* modules/select (Depends-on): Likewise.
* modules/sockets (Depends-on): Likewise.
* modules/sigpipe (Depends-on): Likewise.
* modules/write (Depends-on): Likewise.
* modules/accept (Depends-on): Likewise.
* modules/bind (Depends-on): Likewise.
* modules/connect (Depends-on): Likewise.
* modules/gethostname (Depends-on): Likewise.
* modules/getpeername (Depends-on): Likewise.
* modules/getsockname (Depends-on): Likewise.
* modules/getsockopt (Depends-on): Likewise.
* modules/ioctl (Depends-on): Likewise.
* modules/listen (Depends-on): Likewise.
* modules/recv (Depends-on): Likewise.
* modules/recvfrom (Depends-on): Likewise.
* modules/send (Depends-on): Likewise.
* modules/sendto (Depends-on): Likewise.
* modules/setsockopt (Depends-on): Likewise.
* modules/shutdown (Depends-on): Likewise.
* modules/socket (Depends-on): Likewise.
* modules/execute (Depends-on): Likewise.
* modules/spawn-pipe (Depends-on): Likewise.
* modules/flock (Depends-on): Likewise.
* modules/fsync (Depends-on): Likewise.
* modules/isapipe (Depends-on): Likewise.
* tests/test-cloexec.c: Include msvc-nothrow.h.
* tests/test-dup-safer.c: Likewise.
* tests/test-dup2.c: Likewise.
* tests/test-dup3.c: Likewise.
* tests/test-fcntl.c: Likewise.
* tests/test-pipe.c: Likewise.
* tests/test-pipe2.c: Likewise.
* modules/cloexec-tests (Depends-on): Add msvc-nothrow.
* modules/unistd-safer-tests (Depends-on): Likewise.
* modules/dup2-tests (Depends-on): Likewise.
* modules/dup3-tests (Depends-on): Likewise.
* modules/fcntl-tests (Depends-on): Likewise.
* modules/pipe-posix-tests (Depends-on): Likewise.
* modules/pipe2-tests (Depends-on): Likewise.

12 years agodup2: Make code more maintainable.
Bruno Haible [Fri, 23 Sep 2011 18:55:00 +0000 (20:55 +0200)]
dup2: Make code more maintainable.

* lib/dup2.c (dup2_nothrow): New function, extracted from rpl_dup2.
(rpl_dup2): Use it.
* m4/dup2.m4 (gl_PREREQ_DUP2): New macro.
* modules/dup2 (configure.ac): Invoke it.
Reported by Paul Eggert.

12 years agomsvc-inval: Fix compilation error.
Bruno Haible [Fri, 23 Sep 2011 18:45:10 +0000 (20:45 +0200)]
msvc-inval: Fix compilation error.

* lib/msvc-inval.h: Include <excpt.h>.

12 years agoupdate from texinfo
Karl Berry [Fri, 23 Sep 2011 16:44:17 +0000 (09:44 -0700)]
update from texinfo

12 years agomkdir: Tweak for MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:46:14 +0000 (12:46 +0200)]
mkdir: Tweak for MSVC 9.

* lib/sys_stat.in.h: Update comments.
* doc/posix-functions/mkdir.texi: Mention problem on MSVC 9.

12 years agoTests for module 'chdir'.
Bruno Haible [Fri, 23 Sep 2011 10:38:49 +0000 (12:38 +0200)]
Tests for module 'chdir'.

* modules/chdir-tests: New file.
* tests/test-chdir.c: New file.

12 years agoNew module 'chdir'.
Bruno Haible [Fri, 23 Sep 2011 10:32:41 +0000 (12:32 +0200)]
New module 'chdir'.

* modules/chdir: New file.
* lib/unistd.in.h: Include <io.h>, <direct.h> also for chdir.
(chdir): New declaration.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether chdir is declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_CHDIR.
* modules/unistd (Makefile.am): Substitute GNULIB_CHDIR.
* tests/test-unistd-c++.cc: Check signature of chdir.
* doc/posix-functions/chdir.texi: Mention problem on native Windows.
* modules/chdir-long (Depends-on): Add chdir.
* modules/fchdir (Depends-on): Likewise.
* modules/rename (Depends-on): Likewise.
* modules/savewd (Depends-on): Likewise.

12 years agormdir: Support for mingw, MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:08:40 +0000 (12:08 +0200)]
rmdir: Support for mingw, MSVC 9.

* lib/unistd.in.h: Include <io.h> and <direct.h> also for rmdir.
* doc/posix-functions/getcwd.texi: Mention problem on native Windows.

12 years agogetcwd: Tweak for MSVC 9.
Bruno Haible [Fri, 23 Sep 2011 10:05:16 +0000 (12:05 +0200)]
getcwd: Tweak for MSVC 9.

* lib/unistd.in.h: Update comments.
* doc/posix-functions/getcwd.texi: Mention problem on MSVC 9.

12 years agostrerror_r-posix: Avoid a link error on MSVC.
Bruno Haible [Thu, 22 Sep 2011 22:13:29 +0000 (00:13 +0200)]
strerror_r-posix: Avoid a link error on MSVC.

* m4/strerror_r.m4 (gl_PREREQ_STRERROR_R): Check for snprintf.
* lib/strerror_r.c (snprintf): Define to _snprintf if it doesn't exist.

12 years agoselect: Avoid link errors on MSVC.
Bruno Haible [Thu, 22 Sep 2011 21:45:06 +0000 (23:45 +0200)]
select: Avoid link errors on MSVC.

* m4/select.m4 (gl_FUNC_SELECT): Determine LIB_SELECT.
* modules/select (Link): Replace $(LIBSOCKET) with $(LIB_SELECT).
* modules/pselect (Link): Likewise.
* NEWS: Mention the change.
* modules/select-tests (Makefile.am): Link test-select, test-select-fd,
test-select-stdin against $(LIB_SELECT).
* modules/pselect-tests (Makefile.am): Link test-pselect against
$(LIB_SELECT).

12 years agoselect: Avoid compilation error on MSVC.
Bruno Haible [Thu, 22 Sep 2011 21:33:51 +0000 (23:33 +0200)]
select: Avoid compilation error on MSVC.

* lib/select.c: Don't include <stdbool.h>.

12 years agoConsolidate all uses of PATH_MAX in *.m4 files.
Bruno Haible [Thu, 22 Sep 2011 12:17:57 +0000 (14:17 +0200)]
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.

12 years agoftruncate: Un-deprecate, concentrate on Win32 support.
Bruno Haible [Thu, 22 Sep 2011 12:16:31 +0000 (14:16 +0200)]
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.

12 years agoAdd dependencies to new dirent related modules.
Bruno Haible [Wed, 21 Sep 2011 23:48:01 +0000 (01:48 +0200)]
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.

12 years agoopendir: Avoid compilation error on mingw.
Bruno Haible [Wed, 21 Sep 2011 21:19:44 +0000 (23:19 +0200)]
opendir: Avoid compilation error on mingw.

* lib/opendir.c: Include <stddef.h> always. Include <unistd.h> as well.
* modules/opendir (Depends-on): Add unistd.

12 years agoftruncate tests: Avoid a test failure on mingw.
Bruno Haible [Wed, 21 Sep 2011 20:22:46 +0000 (22:22 +0200)]
ftruncate tests: Avoid a test failure on mingw.

* tests/test-ftruncate.c (main): Allow a failure with EACCES.

12 years agoselect tests: Avoid test failures on OSF/1 5.1 and mingw.
Bruno Haible [Wed, 21 Sep 2011 19:28:38 +0000 (21:28 +0200)]
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.

12 years agoNew module 'fdopen'.
Bruno Haible [Wed, 21 Sep 2011 19:16:45 +0000 (21:16 +0200)]
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.

12 years agounlockpt tests: Avoid test failure on NetBSD 5.1.
Bruno Haible [Wed, 21 Sep 2011 10:43:20 +0000 (12:43 +0200)]
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.

12 years agogetlogin, getlogin_r tests: Avoid test failure on Linux/SPARC.
Bruno Haible [Wed, 21 Sep 2011 10:21:47 +0000 (12:21 +0200)]
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.

12 years agotime tests: Don't require pid_t.
Bruno Haible [Tue, 20 Sep 2011 23:10:05 +0000 (01:10 +0200)]
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.

12 years agotime tests: Don't require pid_t.
Bruno Haible [Tue, 20 Sep 2011 23:03:23 +0000 (01:03 +0200)]
time tests: Don't require pid_t.

* tests/test-time.c: Comment out the check for pid_t.

12 years agofsync tests: Avoid a test failure on mingw.
Bruno Haible [Tue, 20 Sep 2011 22:46:15 +0000 (00:46 +0200)]
fsync tests: Avoid a test failure on mingw.

* tests/test-fsync.c (main): Allow a failure with EIO.

12 years agoeuidaccess: Update comments.
Bruno Haible [Tue, 20 Sep 2011 22:33:15 +0000 (00:33 +0200)]
euidaccess: Update comments.

* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Update comments.

12 years agoEnsure EBADF returns for socket functions on mingw.
Bruno Haible [Tue, 20 Sep 2011 22:20:59 +0000 (00:20 +0200)]
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.

12 years agoselect tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:59:33 +0000 (23:59 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_addopen.
Bruno Haible [Tue, 20 Sep 2011 21:21:26 +0000 (23:21 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_adddup2'.
Bruno Haible [Tue, 20 Sep 2011 21:20:26 +0000 (23:20 +0200)]
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.

12 years agoTests for module 'posix_spawn_file_actions_addclose'.
Bruno Haible [Tue, 20 Sep 2011 21:19:22 +0000 (23:19 +0200)]
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.

12 years agoTests for module 'unlockpt'.
Bruno Haible [Tue, 20 Sep 2011 21:17:56 +0000 (23:17 +0200)]
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.

12 years agoTests for module 'grantpt'.
Bruno Haible [Tue, 20 Sep 2011 21:16:35 +0000 (23:16 +0200)]
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.

12 years agofreopen tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:13:46 +0000 (23:13 +0200)]
freopen tests: EBADF tests.

* tests/test-freopen.c: Include errno.h, unistd.h.
(main): Add tests for EBADF, commented out for the moment.

12 years agofclose tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:12:01 +0000 (23:12 +0200)]
fclose tests: EBADF tests.

* tests/test-fclose.c (main): Add tests for EBADF.

12 years agofflush tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:10:44 +0000 (23:10 +0200)]
fflush tests: EBADF tests.

* tests/test-fflush.c: Include errno.h, macros.h.
(main): Add tests for EBADF.

12 years agoftello tests: EBADF tests.
Bruno Haible [Tue, 20 Sep 2011 21:09:06 +0000 (23:09 +0200)]
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.