summaryrefslogtreecommitdiff
path: root/modules/cloexec-tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: don't assume getdtablesize () <= 10000000Paul Eggert2013-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | * modules/cloexec-tests: * modules/dup2-tests: * modules/dup3-tests: * modules/nonblocking-tests: * modules/posix_spawn_file_actions_addclose-tests: * modules/posix_spawn_file_actions_adddup2-tests: * modules/posix_spawn_file_actions_addopen-tests: * modules/unistd-safer-tests: Depend on the getdtablesize module. * tests/test-cloexec.c: * tests/test-dup-safer.c: * tests/test-dup2.c: * tests/test-dup3.c: * tests/test-fcntl.c: * tests/test-nonblocking.c: * tests/test-posix_spawn_file_actions_addclose.c: * tests/test-posix_spawn_file_actions_adddup2.c: * tests/test-posix_spawn_file_actions_addopen.c: Don't assume getdtablesize () <= 10000000.
* New module 'msvc-nothrow'. Makes _get_osfhandle safe on MSVC 9.Bruno Haible2011-09-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Refactor common macros used in tests.Bruno Haible2009-12-241-0/+1
|
* cloexec: preserve text vs. binary across dup_cloexecEric Blake2009-12-071-0/+1
| | | | | | | | | | | | | | | | | On mingw, dup_cloexec mistakenly converted a text fd into a binary fd. Cygwin copied the source mode. Most other platforms don't distinguish between modes. * lib/cloexec.c (dup_cloexec) [W32]: Query and use translation mode. * modules/dup2-tests (Depends-on): Add binary-io. * modules/cloexec-tests (Depends-on): Likewise. * tests/test-dup2.c (setmode, is_mode): New helpers. (main): Add tests that translation mode is preserved. * tests/test-cloexec.c (setmode, is_mode, main): Likewise. Reported by Bruno Haible. Signed-off-by: Eric Blake <ebb9@byu.net>
* cloexec: add dup_cloexecEric Blake2009-12-051-0/+10
This is needed to enforce correct semantics of mkostemp_safer. Meanwhile, it is one step closer to providing O_CLOEXEC support to open, as well as implementing portions of fcntl for mingw. * lib/cloexec.h (dup_cloexec): New prototype. Add copyright header and comments. * lib/cloexec.c (set_cloexec_flag): Add comments. (dup_cloexec): New function, with mingw implementation borrowed from... * lib/w32spawn.h (dup_noinherit): ...here. * modules/execute (Depends-on): Add cloexec. * modules/pipe (Depends-on): Likewise. * modules/cloexec (Depends-on): Add dup2. * modules/cloexec-tests (Files): New file. * tests/test-cloexec.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>