summaryrefslogtreecommitdiff
path: root/lib/poll.c
Commit message (Collapse)AuthorAgeFilesLines
* Put LGPLv2+ notices in source files where appropriate.Bruno Haible2021-06-041-8/+8
| | | | | * lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description says so.
* maint: run 'make update-copyright'Paul Eggert2020-12-311-1/+1
|
* Don't assume that UNICODE is not defined.Bruno Haible2020-05-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many Windows API functions are defined differently (redirecting to a function with suffix 'W') if the application defines the macro UNICODE than by default (redirecting to a function with suffix 'A'). * lib/clean-temp.c (OSVERSIONINFO, GetVersionEx): Redirect to the variant with suffix 'A'. * lib/dirent-private.h (WIN32_FIND_DATA): Likewise. * lib/gc-gnulib.c (CryptAcquireContext): Likewise. * lib/getaddrinfo.c (GetModuleHandle): Likewise. * lib/getlogin.c (GetUserName): Likewise. * lib/getlogin_r.c (GetUserName): Likewise. * lib/gettimeofday.c (LoadLibrary): Likewise. * lib/isatty.c (LoadLibrary, QueryFullProcessImageName): Likewise. * lib/link.c (GetModuleHandle, CreateHardLink): Likewise. * lib/localename.c (GetLocaleInfo, EnumSystemLocales): Likewise. * lib/mountlist.c (GetDriveType): Likewise. * lib/nonblocking.c (GetNamedPipeHandleState): Likewise. * lib/opendir.c (WIN32_FIND_DATA, GetFullPathName, FindFirstFile): Likewise. * lib/physmem.c (GetModuleHandle): Likewise. * lib/poll.c (GetModuleHandle, PeekConsoleInput, CreateEvent, PeekMessage, DispatchMessage): Likewise. * lib/progreloc.c (GetModuleFileName): Likewise. * lib/putenv.c (SetEnvironmentVariable): Likewise. * lib/read.c (GetNamedPipeHandleState): Likewise. * lib/readdir.c (FindNextFile): Likewise. * lib/relocatable.c (GetModuleFileName): Likewise. * lib/rename.c (MoveFileEx): Likewise. * lib/rewinddir.c (FindFirstFile): Likewise. * lib/select.c (GetModuleHandle, PeekConsoleInput, CreateEvent, PeekMessage, DispatchMessage): Likewise. * lib/sethostname.c (GetComputerNameEx, SetComputerNameEx): Likewise. * lib/socket.c (WSASocket): Likewise. * lib/stat-w32.c (LoadLibrary, GetFinalPathNameByHandle): Likewise. * lib/stat.c (WIN32_FIND_DATA, CreateFile, FindFirstFile): Likewise. * lib/stdio-read.c (GetNamedPipeHandleState): Likewise. * lib/stdio-write.c (GetNamedPipeHandleState): Likewise. * lib/tmpdir.c (GetTempPath): Likewise. * lib/tmpfile.c (OSVERSIONINFO, GetVersionEx, GetTempPath): Likewise. * lib/uname.c (OSVERSIONINFO, GetVersionEx): Likewise. * lib/utime.c (CreateFile, GetFileAttributes): Likewise. * lib/windows-cond.c (CreateEvent): Likewise. * lib/windows-rwlock.c (CreateEvent): Likewise. * lib/windows-timedmutex.c (CreateEvent): Likewise. * lib/windows-timedrecmutex.c (CreateEvent): Likewise. * lib/windows-timedrwlock.c (CreateEvent): Likewise. * lib/write.c (GetNamedPipeHandleState): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2019-12-311-1/+1
|
* poll: Fix type of timeout pointer passed to select() on mingw x86_64.Hannes Müller2019-07-021-0/+4
| | | | * lib/poll.c: Call Windows native select() with Windows native timeval.
* poll: Add comment.Bruno Haible2019-06-301-0/+7
| | | | * lib/poll.c: Add comment about WSAPoll.
* maint: Run 'make update-copyright'Paul Eggert2019-01-011-1/+1
|
* Avoid -Wcast-function-type warnings from casts after GetProcAddress.Bruno Haible2018-08-181-0/+4
| | | | | | | | | | | | | | Reported by Andy Moreton <andrewjmoreton@gmail.com> in <https://lists.gnu.org/archive/html/emacs-devel/2018-08/msg00468.html>. Solution proposed by Eli Zaretskii. * lib/getaddrinfo.c (GetProcAddress): Cast result to 'void *' first. * lib/gettimeofday.c (GetProcAddress): Likewise. * lib/link.c (GetProcAddress): Likewise. * lib/physmem.c (GetProcAddress): Likewise. * lib/poll.c (GetProcAddress): Likewise. * lib/select.c (GetProcAddress): Likewise. * lib/stat-w32.c (GetProcAddress): Likewise.
* Simplify code. Drop support for Borland C++ on Windows.Bruno Haible2018-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Gisle Vanem <gisle.vanem@gmail.com>. * lib/accept4.c: Simplify 'defined _WIN32 || defined __WIN32__' to just 'defined _WIN32'. * lib/canonicalize-lgpl.c: Likewise. * lib/classpath.c: Likewise. * lib/clean-temp.c: Likewise. * lib/csharpexec.c: Likewise. * lib/ctime.c: Likewise. * lib/dosname.h: Likewise. * lib/dup2.c: Likewise. * lib/errno.in.h: Likewise. * lib/error.c: Likewise. * lib/euidaccess.c: Likewise. * lib/execute.c: Likewise. * lib/fcntl.in.h: Likewise. * lib/fcntl.c: Likewise. * lib/filename.h: Likewise. * lib/findprog.c: Likewise. * lib/flock.c: Likewise. * lib/fopen.c: Likewise. * lib/freopen.c: Likewise. * lib/fstat.c: Likewise. * lib/fsync.c: Likewise. * lib/gc-gnulib.c: Likewise. * lib/get-rusage-data.c: Likewise. * lib/getaddrinfo.c: Likewise. * lib/getdelim.c: Likewise. * lib/getdtablesize.c: Likewise. * lib/gethostname.c: Likewise. * lib/getlogin.c: Likewise. * lib/getlogin_r.c: Likewise. * lib/getopt.c: Likewise. * lib/getpagesize.c: Likewise. * lib/getpass.c: Likewise. * lib/getrusage.c: Likewise. * lib/gettimeofday.c: Likewise. * lib/glob.c: Likewise. * lib/inttypes.in.h: Likewise. * lib/isapipe.c: Likewise. * lib/javaexec.c: Likewise. * lib/link.c: Likewise. * lib/localcharset.c: Likewise. * lib/localename.h: Likewise. * lib/localename.c: Likewise. * lib/localtime.c: Likewise. * lib/lseek.c: Likewise. * lib/mbsinit.c: Likewise. * lib/mkdir.c: Likewise. * lib/msvc-nothrow.h: Likewise. * lib/nanosleep.c: Likewise. * lib/nl_langinfo.c: Likewise. * lib/nonblocking.c: Likewise. * lib/nproc.c: Likewise. * lib/open.c: Likewise. * lib/openpty.c: Likewise. * lib/pathmax.h: Likewise. * lib/pipe-filter-aux.c: Likewise. * lib/pipe-filter-gi.c: Likewise. * lib/pipe-filter-ii.c: Likewise. * lib/pipe.c: Likewise. * lib/pipe2.c: Likewise. * lib/poll.c: Likewise. * lib/popen.c: Likewise. * lib/posix_openpt.c: Likewise. * lib/printf-parse.c: Likewise. * lib/progreloc.c: Likewise. * lib/putenv.c: Likewise. * lib/read.c: Likewise. * lib/relocatable.c: Likewise. * lib/rename.c: Likewise. * lib/same-inode.h: Likewise. * lib/secure_getenv.c: Likewise. * lib/select.c: Likewise. * lib/sethostname.c: Likewise. * lib/setlocale.c: Likewise. * lib/sigaction.c: Likewise. * lib/sigprocmask.c: Likewise. * lib/sleep.c: Likewise. * lib/spawn-pipe.h: Likewise. * lib/spawn-pipe.c: Likewise. * lib/spawni.c: Likewise. * lib/stat-time.h: Likewise. * lib/stat-w32.c: Likewise. * lib/stat.c: Likewise. * lib/stdio.in.h: Likewise. * lib/stdio-impl.h: Likewise. * lib/stdio-read.c: Likewise. * lib/stdio-write.c: Likewise. * lib/stdlib.in.h: Likewise. * lib/strerror_r.c: Likewise. * lib/strftime-fixes.c: Likewise. * lib/sys_stat.in.h: Likewise. * lib/sys_types.in.h: Likewise. * lib/sys_wait.in.h : Likewise. * lib/system-quote.h: Likewise. * lib/system-quote.c: Likewise. * lib/tmpdir.c: Likewise. * lib/tzset.c: Likewise. * lib/uname.c: Likewise. * lib/unistd.in.h: Likewise. * lib/utime.in.h: Likewise. * lib/utime.c: Likewise. * lib/utimecmp.c: Likewise. * lib/utimens.c: Likewise. * lib/vasnprintf.c: Likewise. * lib/vma-iter.h: Likewise. * lib/vma-iter.c: Likewise. * lib/wait-process.c: Likewise. * lib/wcsftime.c: Likewise. * lib/wctype.in.h: Likewise. * lib/write.c: Likewise. * tests/nap.h: Likewise. * tests/test-cloexec.c: Likewise. * tests/test-dup-safer.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-dup3.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-get-rusage-data.c: Likewise. * tests/test-getaddrinfo.c: Likewise. * tests/test-getlogin.h: Likewise. * tests/test-isatty.c: Likewise. * tests/test-localename.c: Likewise. * tests/test-mbrtowc-w32.c: Likewise. * tests/test-nonblocking.c: Likewise. * tests/test-nonblocking-pipe-main.c: Likewise. * tests/test-nonblocking-socket-main.c: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-pipe.c: Likewise. * tests/test-pipe2.c: Likewise. * tests/test-poll.c: Likewise. * tests/test-pthread_sigmask1.c: Likewise. * tests/test-select.h: Likewise. * tests/test-sethostname2.c: Likewise. * tests/test-sigprocmask.c: Likewise. * tests/test-spawn-pipe-child.c: Likewise. * tests/test-stat-time.c: Likewise. * tests/test-system-quote-main.c: Likewise. * tests/test-utimens-common.h: Likewise. * tests/test-wcrtomb-w32.c: Likewise. * m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise. * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise. * m4/javacomp.m4 (gt_JAVACOMP): Likewise. * m4/javaexec.m4 (gt_JAVAEXEC): Likewise. * m4/locale-ar.m4 (gt_LOCALE_AR): Likewise. * m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise. * m4/locale-ja.m4 (gt_LOCALE_JA): Likewise. * m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise. * m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise. * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Likewise. * m4/nocrash.m4 (GL_NOCRASH): Likewise. * m4/pathmax.m4 (gl_PATHMAX_SNIPPET): Likewise. * m4/ptsname_r.m4 (gl_PREREQ_PTSNAME_R): Likewise. * m4/stdio_h.m4 (gl_STDIO_H): Likewise. * m4/tmpfile.m4 (gl_FUNC_TMPFILE): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H): Likewise.
* maint: Run 'make update-copyright'Paul Eggert2018-01-011-1/+1
|
* all: prefer https: URLsPaul Eggert2017-09-131-1/+1
|
* poll: Fix confusion between SOCKETs and FDs on native Windows.Bruno Haible2017-05-111-0/+4
| | | | | | Fix proposed by Daniel P. Berrange <berrange@redhat.com>. * lib/poll.c [WINDOWS_NATIVE]: Undefine select.
* poll: Fix link error on native Windows.Bruno Haible2017-05-111-0/+4
| | | | * lib/poll.c [WINDOWS_NATIVE]: Undefine recv.
* Implement a way to opt out from MSVC support.Bruno Haible2017-05-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for Emacs. * modules/msvc-nothrow (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/accept4.c: Include <io.h> as an alternative to msvc-nothrow.h. * lib/error.c: Likewise. * lib/fcntl.c: Likewise. * lib/flock.c: Likewise. * lib/fstat.c: Likewise. * lib/fsync.c: Likewise. * lib/ioctl.c: Likewise. * lib/isapipe.c: Likewise. * lib/lseek.c: Likewise. * lib/nonblocking.c: Likewise. * lib/poll.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/utimens.c: Likewise. * lib/w32sock.h: Likewise. * lib/w32spawn.h: Likewise. * tests/test-cloexec.c: Likewise. * 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. * lib/ftruncate.c: Likewise. (chsize_nothrow): Renamed from chsize. * lib/msvc-nothrow.c: Don't include msvc-inval.h if HAVE_MSVC_INVALID_PARAMETER_HANDLER is not defined. * lib/close.c: Likewise. * lib/dup.c: Likewise. * lib/fclose.c: Likewise. * lib/raise.c: Likewise. * tests/test-fgetc.c: Likewise. * tests/test-fputc.c: Likewise. * tests/test-fread.c: Likewise. * tests/test-fwrite.c: Likewise. * lib/getdtablesize.c: Likewise. (_setmaxstdio_nothrow): Renamed from _setmaxstdio. * lib/isatty.c: Don't include msvc-inval.h if HAVE_MSVC_INVALID_PARAMETER_HANDLER is not defined. Include <io.h> as an alternative to msvc-nothrow.h. * lib/read.c: Likewise. * lib/write.c: Likewise. * lib/dup2.c: Likewise. (dup2_nothrow): New function. (ms_windows_dup2): Use it. * m4/close.m4 (gl_FUNC_CLOSE): Invoke gl_MSVC_INVAL and test HAVE_MSVC_INVALID_PARAMETER_HANDLER only if gl_MSVC_INVAL is defined. * m4/dup.m4 (gl_FUNC_DUP): Likewise. * m4/fdopen.m4 (gl_FUNC_FDOPEN): Likewise. * m4/raise.m4 (gl_FUNC_RAISE): Likewise. * m4/read.m4 (gl_FUNC_READ): Likewise. * m4/write.m4 (gl_FUNC_WRITE): Likewise. * doc/windows-without-msvc.texi: New file. * doc/gnulib.texi (Native Windows Support without MSVC Support): New section.
* poll: improve fast check for out-of-range NFDPaul Eggert2017-04-231-5/+4
| | | | | | * lib/poll.c: Do not include intprops.h. (poll): Compare NFD to INT_MAX, not to TYPE_MAXIMUM (nfds_t) / 2. * modules/poll (Depends-on): Remove intprops.
* poll: Enable argument check also in the Windows implementation.Bruno Haible2017-04-231-1/+1
| | | | | * lib/poll.c (poll) [WINDOWS_NATIVE]: Check value of nfd correctly. Reported by Paul Eggert.
* poll: Enable argument check.Bruno Haible2017-04-221-1/+2
| | | | | | * lib/poll.c: Include intprops.h. (poll): Check value of nfd correctly. * modules/poll (Depends-on): Add intprops.
* version-etc: new yearPaul Eggert2017-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* version-etc: new yearPaul Eggert2016-01-011-1/+1
| | | | | | | | | | * build-aux/gendocs.sh (version): * doc/gendocs_template: * doc/gendocs_template_min: * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright dates by hand in templates and the like. * all files: Run 'make update-copyright'.
* poll: port to MSVC v18 on MS-Windows 8.1Paul Eggert2015-02-241-2/+3
| | | | | | | | Problem reported by Gisle Vanem in: http://lists.gnu.org/archive/html/bug-gnulib/2015-02/msg00139.html * lib/poll.c: Always include <sys/select.h> and <sys/socket.h>. * modules/poll (Depends-on) [!HAVE_POLL || REPLACE_POLL]: Add sys_socket.
* poll: fixes for large fdsPaul Eggert2015-02-201-42/+21
| | | | | | | | * lib/poll.c (poll): Don't check directly for NFD too large. Don't rely on undefined behavior in FD_SET when an arg exceeds FD_SETSIZE. Always set revents afterwards, even if to zero. * tests/test-poll.c (poll1): Set revents to -1 instead of 0, as that makes the test a bit stricter.
* version-etc: new yearPaul Eggert2014-12-311-1/+1
| | | | | | * doc/gnulib.texi: * lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date. * all files: Run 'make update-copyright'.
* assure: new modulePaul Eggert2014-12-201-2/+3
| | | | | | | | | | | | | | | This works better than 'assert' when compiling with -DNDEBUG, as it avoids some compiler diagnostics in that case. Reported by Norihiro Tanaka in: http://lists.gnu.org/archive/html/bug-gnulib/2014-12/msg00215.html * MODULES.html.sh (func_all_modules): Add 'assure'. * lib/assure.h, modules/assure: New files. * lib/chdir-long.c, lib/cycle-check.c, lib/fchdir.c, lib/fts.c: * lib/poll.c, lib/savewd.c, lib/utimens.c, lib/xstrtol.c: Prefer 'assure' to 'assert'. * modules/chdir-long, modules/cycle-check, modules/fchdir: * modules/poll, modules/savewd, modules/utimens, modules/xstrtol: Depend on 'assure'.
* select,poll: fix console handle check on windows 8Pádraig Brady2014-06-111-3/+5
| | | | | | | | | | Similarly to commit a008d625 which fixed the obvious problem with isatty(), also apply the fix to the select() and poll() MS-Windows implementations. lib/poll.c (IsConsoleHandle): Change from testing the lower 2 bits of the handle to the more expensive but accurate syscall. lib/select.c: Likewise.
* maint: update copyrightEric Blake2014-01-011-1/+1
| | | | | | I ran 'make update-copyright'. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update all copyright year number rangesEric Blake2013-01-011-1/+1
| | | | | | Run "make update-copyright". Compare to commit 1602f0a from last year. Signed-off-by: Eric Blake <eblake@redhat.com>
* poll: fix poll(0, NULL, msec)Joachim Schmitz2012-09-131-1/+1
| | | | | | | * lib/poll.c: don't exit early if NULL is the 1st arg to poll(), but nfd is 0. In that case poll should behave like select. Copyright-paperwork-exempt: yes
* poll: fix for systems that can't recv() on a non-socketJoachim Schmitz2012-09-131-0/+4
| | | | | | | | * lib/poll.c: if recv returns ENOTSOCK, assume the descriptor is readable. In this case POLLHUP will not be supported. * doc/posix-functions/poll.texi: Document this. Copyright-paperwork-exempt: yes
* poll/select: prevent busy-waitingPaolo Bonzini2012-05-221-1/+1
| | | | | | | | | | | | | | 2012-05-21 Paolo Bonzini <bonzini@gnu.org> poll/select: prevent busy-waiting. SwitchToThread() only gives away the rest of the current time slice to another thread in the current process. So if the thread that feeds the file decscriptor we're polling is not in the current process, we get busy-waiting. * lib/poll.c: Use SleepEx(1, TRUE) instead of SwitchToThread(). Patch from Theodore Leblond. * lib/select.c: Split polling out of the loop that sets the output fd_sets. Check for zero result and loop if the wait timeout is infinite.
* maint: replace FSF snail-mail addresses with URLsPaul Eggert2012-02-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config/argz.mk, lib/accept4.c, lib/alignof.h, lib/alloca.in.h: * lib/alphasort.c, lib/arcfour.c, lib/arcfour.h, lib/arctwo.c: * lib/arctwo.h, lib/argz.c, lib/arpa_inet.in.h, lib/asnprintf.c: * lib/asprintf.c, lib/assert.in.h, lib/base32.c, lib/base32.h: * lib/base64.c, lib/base64.h, lib/c-ctype.c, lib/c-ctype.h: * lib/c-strcase.h, lib/c-strcasecmp.c, lib/c-strncasecmp.c: * lib/check-version.c, lib/check-version.h, lib/config.charset: * lib/ctype.in.h, lib/des.c, lib/des.h, lib/dup3.c, lib/errno.in.h: * lib/float+.h, lib/fnmatch.c, lib/fnmatch.in.h, lib/fnmatch_loop.c: * lib/fseeko.c, lib/gai_strerror.c, lib/gc-gnulib.c: * lib/gc-libgcrypt.c, lib/gc-pbkdf2-sha1.c, lib/gc.h: * lib/getaddrinfo.c, lib/getdelim.c, lib/getfilecon.c, lib/getline.c: * lib/getlogin_r.c, lib/getpass.c, lib/getpass.h, lib/gettext.h: * lib/gettimeofday.c, lib/glob.in.h, lib/glthread/cond.c: * lib/glthread/cond.h, lib/glthread/lock.c, lib/glthread/lock.h: * lib/glthread/thread.c, lib/glthread/thread.h: * lib/glthread/threadlib.c, lib/glthread/yield.h, lib/hmac-md5.c: * lib/hmac-sha1.c, lib/hmac.h, lib/iconv.c, lib/iconv.in.h: * lib/iconv_close.c, lib/iconv_open.c, lib/inet_ntop.c, lib/isfinite.c: * lib/isinf.c, lib/iswblank.c, lib/langinfo.in.h, lib/link.c: * lib/localcharset.c, lib/localcharset.h, lib/lseek.c, lib/malloc.c: * lib/malloca.c, lib/malloca.h, lib/md2.c, lib/md2.h, lib/md4.c: * lib/md4.h, lib/md5.c, lib/md5.h, lib/memmem.c, lib/mempcpy.c: * lib/memset.c, lib/memxor.c, lib/memxor.h, lib/minmax.h, lib/mktime.c: * lib/msvc-inval.c, lib/msvc-inval.h, lib/msvc-nothrow.c: * lib/msvc-nothrow.h, lib/netdb.in.h, lib/netinet_in.in.h, lib/nproc.c: * lib/nproc.h, lib/obstack_printf.c, lib/pathmax.h, lib/pipe.c: * lib/pipe2.c, lib/poll.c, lib/poll.in.h, lib/printf-args.c: * lib/printf-args.h, lib/printf-parse.c, lib/printf-parse.h: * lib/pselect.c, lib/pthread.in.h, lib/pty-private.h, lib/pty.in.h: * lib/read-file.c, lib/read-file.h, lib/ref-add.sin, lib/ref-del.sin: * lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c: * lib/regex_internal.h, lib/regexec.c, lib/rijndael-alg-fst.c: * lib/rijndael-alg-fst.h, lib/rijndael-api-fst.c: * lib/rijndael-api-fst.h, lib/rint.c, lib/rintf.c, lib/rintl.c: * lib/round.c, lib/roundf.c, lib/roundl.c, lib/scandir.c, lib/select.c: * lib/sha1.c, lib/sha1.h, lib/size_max.h, lib/snprintf.c: * lib/stdalign.in.h, lib/stdarg.in.h, lib/stdbool.in.h: * lib/stddef.in.h, lib/stdint.in.h, lib/stdio.in.h, lib/str-kmp.h: * lib/str-two-way.h, lib/strcasecmp.c, lib/strcasestr.c, lib/strdup.c: * lib/striconv.c, lib/striconv.h, lib/string.in.h, lib/strings.in.h: * lib/strncasecmp.c, lib/strndup.c, lib/strnlen.c, lib/strpbrk.c: * lib/strptime.c, lib/strsep.c, lib/strstr.c, lib/strverscmp.c: * lib/sys_file.in.h, lib/sys_ioctl.in.h, lib/sys_select.in.h: * lib/sys_socket.in.h, lib/sys_stat.in.h, lib/sys_time.in.h: * lib/sys_times.in.h, lib/sys_types.in.h, lib/sys_uio.in.h: * lib/sys_utsname.in.h, lib/sys_wait.in.h, lib/tcgetsid.c: * lib/termios.in.h, lib/time.in.h, lib/time_r.c, lib/timegm.c: * lib/times.c, lib/unictype/3level.h, lib/unictype/3levelbit.h: * lib/unistd.in.h, lib/vasnprintf.c, lib/vasnprintf.h, lib/vasprintf.c: * lib/vsnprintf.c, lib/waitpid.c, lib/wchar.in.h, lib/wctype.in.h: * lib/xsize.h, tests/test-closein.c, tests/test-des.c: * tests/test-fclose.c, tests/test-fgetc.c, tests/test-filevercmp.c: * tests/test-fputc.c, tests/test-fread.c, tests/test-fwrite.c: * tests/test-gc-arcfour.c, tests/test-gc-arctwo.c, tests/test-gc-des.c: * tests/test-gc-hmac-md5.c, tests/test-gc-hmac-sha1.c: * tests/test-gc-md2.c, tests/test-gc-md4.c, tests/test-gc-md5.c: * tests/test-gc-pbkdf2-sha1.c, tests/test-gc-rijndael.c: * tests/test-gc-sha1.c, tests/test-gc.c, tests/test-getdelim.c: * tests/test-getline.c, tests/test-getndelim2.c, tests/test-md2.c: * tests/test-md4.c, tests/test-parse-datetime.c, tests/test-perror.c: * tests/test-perror2.c, tests/test-pipe.c, tests/test-pipe2.c: * tests/test-poll.c, tests/test-quotearg-simple.c: * tests/test-quotearg.c, tests/test-quotearg.h: * tests/test-round-ieee.c, tests/test-round1.c: * tests/test-roundf-ieee.c, tests/test-roundf1.c: * tests/test-roundl-ieee.c, tests/test-roundl.c: * tests/test-safe-alloc.c, tests/test-sigpipe.c: * tests/test-spawn-pipe-child.c, tests/test-spawn-pipe-main.c: * tests/test-strerror.c, tests/test-strerror_r.c: * tests/test-strsignal.c, tests/test-strverscmp.c: * tests/test-xmemdup0.c: Replace FSF snail mail addresses with URLs, as per GNU coding standards. See glibc bug <http://sourceware.org/bugzilla/show_bug.cgi?id=13673>.
* select, poll, isatty: Avoid warnings on x86_64 mingw64.Marc-André Lureau2012-01-281-1/+1
| | | | | | | * lib/select.c (IsConsoleHandle): Use intptr_t to convert handle pointer to an integer. * lib/poll.c (IsConsoleHandle): Likewise. * lib/isatty.c (IsConsoleHandle): Likewise.
* Spell out "Windows 9x" and "Windows XP".Paul Eggert2012-01-041-5/+6
| | | | | * lib/poll.c, lib/select.c: In comments, replace "Win9x" with "Windows 9x" and "WinXP" with "Windows XP".
* Talk about "native Windows API", not "Win32".Bruno Haible2012-01-041-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/classpath.c: Update comments to mention native Windows. * lib/csharpexec.c: Likewise. * lib/dup2.c: Likewise. * lib/error.c: Likewise. * lib/fcntl.c: Likewise. * lib/filename.h: Likewise. * lib/findprog.c: Likewise. * lib/get-rusage-as.c: Likewise. * lib/get-rusage-data.c: Likewise. * lib/getpagesize.c: Likewise. * lib/javaexec.c: Likewise. * lib/msvc-inval.c: Likewise. * lib/msvc-nothrow.c: Likewise. * lib/nanosleep.c: Likewise. * lib/nonblocking.c: Likewise. * lib/printf-parse.c: Likewise. * lib/setlocale.c: Likewise. * lib/sigaction.c: Likewise. * lib/strerror_r.c: Likewise. * lib/tmpdir.c: Likewise. * lib/vasnprintf.c: Likewise. * lib/w32spawn.h: Likewise. * lib/waitpid.c: Likewise. * lib/stdio.in.h (fdopen, fopen, freopen): Likewise. * m4/locale-ar.m4: Likewise. * m4/locale-fr.m4: Likewise. * m4/locale-ja.m4: Likewise. * m4/locale-tr.m4: Likewise. * m4/locale-zh.m4: Likewise. * m4/printf.m4: Likewise. * tests/test-cloexec.c: Likewise. * tests/test-copy-acl.sh: Likewise. * tests/test-copy-file.sh: Likewise. * tests/test-file-has-acl.sh: Likewise. * tests/test-set-mode-acl.sh: Likewise. * tests/test-dup-safer.c: Likewise. * tests/test-dup2.c: Likewise. * tests/test-dup3.c: Likewise. * tests/test-fcntl.c: Likewise. * tests/test-nonblocking-pipe.h: Likewise. * tests/test-nonblocking-socket.h: Likewise. * tests/test-pipe.c: Likewise. * tests/test-pipe2.c: Likewise. * tests/test-spawn-pipe-child.c: Likewise. * doc/acl-resources.txt: Likewise. * lib/getaddrinfo.c (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. * tests/test-poll.c (WINDOWS_NATIVE): Likewise. * tests/test-select.h (WINDOWS_NATIVE): Likewise. * lib/localcharset.c: Update comments to mention native Windows. (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. * lib/localename.c: Likewise. * lib/progreloc.c: Likewise. * lib/relocatable.c: Likewise. * lib/poll.c (WINDOWS_NATIVE): Renamed from WIN32_NATIVE. (windows_compute_revents): Renamed from win32_compute_revents. (windows_compute_revents_socket): Renamed from win32_compute_revents_socket. * lib/select.c: Update comments to mention native Windows. (windows_poll_handle): Renamed from win32_poll_handle. * m4/threadlib.m4: Update comments to mention native Windows. (gl_THREADLIB_EARLY_BODY, gl_THREADLIB_BODY): Expect --enable-threads=windows instead of --enable-threads=win32. Set USE_WINDOWS_THREADS, not USE_WIN32_THREADS. * lib/glthread/lock.h: Update comments to mention native Windows. (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. * lib/glthread/lock.c (USE_WINDOWS_THREADS): Renamed from USE_WIN32_THREADS. * lib/glthread/cond.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/cond.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/thread.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/thread.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/tls.h (USE_WINDOWS_THREADS): Likewise. * lib/glthread/tls.c (USE_WINDOWS_THREADS): Likewise. * lib/glthread/yield.h (USE_WINDOWS_THREADS): Likewise. * tests/test-cond.c (USE_WINDOWS_THREADS): Likewise. * tests/test-thread_create.c (USE_WINDOWS_THREADS): Likewise. * tests/test-lock.c (USE_WINDOWS_THREADS): Likewise. (TEST_WINDOWS_THREADS): Renamed from TEST_WIN32_THREADS. * tests/test-tls.c: Likewise. Rationale: Microsoft renamed the "Win32 API" to "Windows API", as it is available on both 32-bit and 64-bit Windows systems. But in gnulib, we treat Cygwin like a Unix platform, therefore the main line of distinction is between "native Windows" on one side and Unix/ POSIX systems on the other side. More details in <https://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00027.html>. Suggested by Paul Eggert.
* isatty: Support for MSVC 9.Bruno Haible2012-01-031-0/+2
| | | | | | | | | | | | | | * doc/posix-functions/isatty.texi: Mention the MSVC problem. * lib/isatty.c: Include <errno.h>, msvc-inval.h. (_isatty_nothrow): New function. (isatty): Use it instead of _isatty. (IsConsoleHandle): Add comment, from Paolo Bonzini. * lib/poll.c (IsConsoleHandle): Likewise. * lib/select.c (IsConsoleHandle): Likewise. * m4/isatty.m4 (gl_FUNC_ISATTY): Fix comment. Reported by Eli Zaretskii. (gl_PREREQ_ISATTY): New macro. * modules/isatty (Depends-on): Add msvc-inval. (configure.ac): Invoke gl_PREREQ_ISATTY.
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* 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.
* poll: do not return 0 on timeout=-1Erik Faye-Lund2011-07-061-0/+7
| | | | * lib/poll.c: Loop with yield if no events occured
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* poll: Assume ANSI C.Bruno Haible2010-09-291-4/+1
| | | | * lib/poll.c (poll): Use an ANSI C declaration.
* New module 'poll-h'.Bruno Haible2010-09-291-1/+4
| | | | | | | | | | | | | | | | | | * lib/poll.in.h: Include c++defs.h and warn-on-use.h. (poll): Use modern idiom. * modules/poll-h: New file. * modules/poll (Files): Remove lib/poll.in.h. (Depends-on): Add poll-h. (configure.ac): Invoke gl_POLL_MODULE_INDICATOR. (Makefile.am): Move code for generation of poll.h to modules/poll-h. * m4/poll_h.m4: New file. * m4/poll.m4 (gl_FUNC_POLL): Require gl_POLL_H. Don't check for poll.h here. Don't set POLL_H here. Instead, set HAVE_POLL and REPLACE_POLL and invoke gl_REPLACE_POLL_H. * lib/poll.c: Use common idiom. * tests/test-poll.c: Likewise. * doc/posix-headers/poll.texi: Mention the poll-h module. Suggested by Eric Blake.
* poll: return immediately on POLLHUP.Erik Faye-Lund2010-08-261-1/+1
| | | | | * lib/poll.c (poll): Always set timeout before wait_timeout is computed.
* poll, select: handle ERROR_BROKEN_PIPE.Paolo Bonzini2010-08-231-0/+2
| | | | | | | * lib/poll.c (win32_compute_revents): Return POLLHUP when PeekNamedPipe fails with ERROR_BROKEN_PIPE. * lib/select.c (win32_compute_revents): Do not mark a pipe as writeable if PeekNamedPipe fails with ERROR_BROKEN_PIPE.
* Minor formatting changes.Bruno Haible2010-03-251-1/+1
|
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* Use spaces for indentation, not tabs.Bruno Haible2009-12-101-115/+115
|
* Fix polling for writeability of a screen buffer.Paolo Bonzini2009-08-201-31/+60
| | | | | | * lib/poll.c: Distinguish input and screen buffers for the Win32 implementation. * lib/select.c: Likewise.
* poll: suppress a warningJim Meyering2009-01-161-0/+5
| | | | | * lib/poll.c: Use #pragma GCC diagnostic ignored "-Wtype-limits" to ignore "...unsigned expression < 0 is always false" warnings.
* poll: remove declarations of unused variablesDaniel P. Berrange2009-01-161-2/+0
| | | | | * lib/poll.c (poll) [WIN32_NATIVE]: Remove declarations of unused sockbuf and optlen.
* poll: filter through cppiJim Meyering2009-01-071-25/+25
| | | | * lib/poll.c: Indent cpp directives to reflect nesting.
* poll: don't return uninitializedDaniel P. Berrange2009-01-071-2/+2
| | | | * lib/poll.c (poll) [WIN32_NATIVE]: Initialize "rc".