> The newer runtime libraries of MSVC no longer return error codes from > functions like printf(), close(), dup2(), _get_osfhandle(), when you pass > an invalid format string or invalid file descriptor.[1][2] > > No, they invoke a so-called "invalid parameter handler" which exists once per > process (i.e. it's a piece of global state).[3]
So, gnulib needs more unit tests of EBADF return codes. I've added such tests for 'accept' and 'accept4'. More such tests are to come for: bind close connect dprintf dup dup2 faccessat fchdir fchmod fchown fclose fcntl fdatasync fdopen fdopendir fdutimensat fflush fgetc fputc freopen fseeko fstat fsync ftello ftruncate futimens getpeername getsockname getsockopt grantpt ioctl isatty linkat listen lseek mkfifoat openat posix_spawn_file_actions_addclose posix_spawn_file_actions_adddup2 posix_spawn_file_actions_addopen pread pwrite read readlinkat recv recvfrom renameat select send sendto setsockopt shutdown symlinkat ttyname_r unlockpt utimens utimensat vdprintf write Bruno -- In memoriam Bernhard Bästlein <http://en.wikipedia.org/wiki/Bernhard_Bästlein>