about summary refs log tree commit diff
path: root/hurd/hurdselect.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-011-1/+1
|
* hurd: Use __clock_gettime in _hurd_selectFlorian Weimer2019-11-071-7/+4
| | | | | | | | | The __gettimeofday references caused check-localplt failures after commit 5e46749c64d5. Fixes: 5e46749c64d51f50f8511ed99c1266d7c13e182b Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Change-Id: Ia6da4045157a5bbccc67d79e881d7592e6f8a890
* time: Introduce function to check correctness of nanoseconds valueLukasz Majewski2019-10-271-2/+2
| | | | | | | | | | | | | | | The valid_nanoseconds () static inline function has been introduced to check if nanoseconds value is in the correct range - greater or equal to zero and less than 1000000000. The explicit #include <time.h> has been added to files where it was missing. The __syscall_slong_t type for ns has been used to avoid issues on x32. Tested with: - scripts/build-many-glibcs.py - make PARALLELMFLAGS="-j12" && make PARALLELMFLAGS="-j12" xcheck on x86_64
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, change sources.redhat.com to sourceware.org. This patch was automatically generated by running the following shell script, which uses GNU sed, and which avoids modifying files imported from upstream: sed -ri ' s,(http|ftp)(://(.*\.)?(gnu|fsf|sourceware)\.org($|[^.]|\.[^a-z])),https\2,g s,(http|ftp)(://(.*\.)?)sources\.redhat\.com($|[^.]|\.[^a-z]),https\2sourceware.org\4,g ' \ $(find $(git ls-files) -prune -type f \ ! -name '*.po' \ ! -name 'ChangeLog*' \ ! -path COPYING ! -path COPYING.LIB \ ! -path manual/fdl-1.3.texi ! -path manual/lgpl-2.1.texi \ ! -path manual/texinfo.tex ! -path scripts/config.guess \ ! -path scripts/config.sub ! -path scripts/install-sh \ ! -path scripts/mkinstalldirs ! -path scripts/move-if-change \ ! -path INSTALL ! -path locale/programs/charmap-kw.h \ ! -path po/libc.pot ! -path sysdeps/gnu/errlist.c \ ! '(' -name configure \ -execdir test -f configure.ac -o -f configure.in ';' ')' \ ! '(' -name preconfigure \ -execdir test -f preconfigure.ac ';' ')' \ -print) and then by running 'make dist-prepare' to regenerate files built from the altered files, and then executing the following to cleanup: chmod a+x sysdeps/unix/sysv/linux/riscv/configure # Omit irrelevant whitespace and comment-only changes, # perhaps from a slightly-different Autoconf version. git checkout -f \ sysdeps/csky/configure \ sysdeps/hppa/configure \ sysdeps/riscv/configure \ sysdeps/unix/sysv/linux/csky/configure # Omit changes that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/powerpc/powerpc64/ppc-mcount.S: trailing lines git checkout -f \ sysdeps/powerpc/powerpc64/ppc-mcount.S \ sysdeps/unix/sysv/linux/s390/s390-64/syscall.S # Omit change that caused a pre-commit check to fail like this: # remote: *** error: sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S: last line does not end in newline git checkout -f sysdeps/sparc/sparc64/multiarch/memcpy-ultra3.S
* hurd: Fix poll and select POSIX compliancy details about errorsSamuel Thibault2019-08-301-41/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following: - On error, poll must not return without polling, including EBADF, and instead report POLLHUP/POLLERR/POLLNVAL - Select must report EBADF if some set contains an invalid FD. The idea is to move error management to after all select calls, in the poll/select final treatment. The error is instead recorded in a new `error' field, and a new SELECT_ERROR bit set. Thanks Svante Signell for the initial version of the patch. * hurd/hurdselect.c (SELECT_ERROR): New macro. (_hurd_select): - Add `error' field to `d' structures array. - If a poll descriptor is bogus, set EBADF, but continue with a zero timeout. - Go through the whole fd_set, not only until _hurd_dtablesize. Return EBADF there is any bit set above _hurd_dtablesize. - Do not request io_select on bogus descriptors (SELECT_ERROR). - On io_select request error, record the error. - On io_select bogus reply, use EIO error code. - On io_select bogus or error reply, record the error. - Do not destroy reply port for bogus FDs. - On error, make poll set POLLHUP in the EPIPE case, POLLNVAL in the EBADF case, or else POLLERR. - On error, make select simulated readiness.
* hurd: Fix timeout handling in _hurd_selectRichard Braun2019-08-301-39/+77
| | | | | | | | | | | | | | | | | | | Rely on servers to implement timeouts, so that very short values (including 0) don't make mach_msg return before valid replies can be received. The purpose of this scheme is to guarantee a full client-server round-trip, whatever the timeout value. This change depends on the new io_select_timeout RPC being implemented by servers. * hurd/Makefile (user-interfaces): Add io_reply and io_request. * hurd/hurdselect.c: Include <sys/time.h>, <hurd/io_request.h> and <limits.h>. (_hurd_select): Replace the call to __io_select with either __io_select_request or __io_select_timeout_request, depending on the timeout. Count the number of ready descriptors (replies for which at least one type bit is set). Implement the timeout locally when there is no file descriptor.
* hurd: Fix _hurd_select for single fd setsRichard Braun2019-08-301-4/+1
| | | | | | | | | | | | The function attempts to optimize this case by performing one IPC system call with the timeout included among the parameters, but in the absence of a reply, it will call mach_msg again with the same timeout later, effectively doubling the total timeout of the select/poll call. Remove this optimization for the time being. * hurd/hurdselect.c (_hurd_select): Always call __io_select with no timeout.
* Break some lines before not after operators.Joseph Myers2019-02-221-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GNU Coding Standards specify that line breaks in expressions should go before an operator, not after one. This patch fixes various code to do this. It only changes code that appears to be mostly following GNU style anyway, not files and directories with substantially different formatting. It is not exhaustive even for files using GNU style (for example, changes to sysdeps files are deferred for subsequent cleanups). Some files changed are shared with gnulib, but most are specific to glibc. Changes were made manually, with places to change found by grep (so some cases, e.g. where the operator was followed by a comment at end of line, are particularly liable to have been missed by grep, but I did include cases where the operator was followed by backslash-newline). This patch generally does not attempt to address other coding style issues in the expressions changed (for example, missing spaces before '(', or lack of parentheses to ensure indentation of continuation lines properly reflects operator precedence). Tested for x86_64, and with build-many-glibcs.py. * benchtests/bench-memmem.c (simple_memmem): Break lines before rather than after operators. * benchtests/bench-skeleton.c (TIMESPEC_AFTER): Likewise. * crypt/md5.c (md5_finish_ctx): Likewise. * crypt/sha256.c (__sha256_finish_ctx): Likewise. * crypt/sha512.c (__sha512_finish_ctx): Likewise. * elf/cache.c (load_aux_cache): Likewise. * elf/dl-load.c (open_verify): Likewise. * elf/get-dynamic-info.h (elf_get_dynamic_info): Likewise. * elf/readelflib.c (process_elf_file): Likewise. * elf/rtld.c (dl_main): Likewise. * elf/sprof.c (generate_call_graph): Likewise. * hurd/ctty-input.c (_hurd_ctty_input): Likewise. * hurd/ctty-output.c (_hurd_ctty_output): Likewise. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/getdport.c (__getdport): Likewise. * hurd/hurd/signal.h (_hurd_interrupted_rpc_timeout): Likewise. * hurd/hurd/sigpreempt.h (HURD_PREEMPT_SIGNAL_P): Likewise. * hurd/hurdfault.c (_hurdsig_fault_catch_exception_raise): Likewise. * hurd/hurdioctl.c (fioctl): Likewise. * hurd/hurdselect.c (_hurd_select): Likewise. * hurd/hurdsig.c (_hurdsig_abort_rpcs): Likewise. (STOPSIGS): Likewise. * hurd/hurdstartup.c (_hurd_startup): Likewise. * hurd/intr-msg.c (_hurd_intr_rpc_mach_msg): Likewise. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise. * hurd/msgportdemux.c (msgport_server): Likewise. * hurd/setauth.c (_hurd_setauth): Likewise. * include/features.h (__GLIBC_USE_DEPRECATED_SCANF): Likewise. * libio/libioP.h [IO_DEBUG] (CHECK_FILE): Likewise. * locale/programs/ld-ctype.c (set_class_defaults): Likewise. * localedata/tests-mbwc/tst_swscanf.c (tst_swscanf): Likewise. * login/tst-utmp.c (do_check): Likewise. (simulate_login): Likewise. * mach/lowlevellock.h (lll_lock): Likewise. (lll_trylock): Likewise. * math/test-fenv.c (ALL_EXC): Likewise. * math/test-fenvinline.c (ALL_EXC): Likewise. * misc/sys/cdefs.h (__attribute_deprecated_msg__): Likewise. * nis/nis_call.c (__do_niscall3): Likewise. * nis/nis_callback.c (cb_prog_1): Likewise. * nis/nis_defaults.c (searchaccess): Likewise. * nis/nis_findserv.c (__nis_findfastest_with_timeout): Likewise. * nis/nis_ismember.c (internal_ismember): Likewise. * nis/nis_local_names.c (nis_local_principal): Likewise. * nis/nss_nis/nis-rpc.c (_nss_nis_getrpcbyname_r): Likewise. * nis/nss_nisplus/nisplus-netgrp.c (_nss_nisplus_getnetgrent_r): Likewise. * nis/ypclnt.c (yp_match): Likewise. (yp_first): Likewise. (yp_next): Likewise. (yp_master): Likewise. (yp_order): Likewise. * nscd/hstcache.c (cache_addhst): Likewise. * nscd/initgrcache.c (addinitgroupsX): Likewise. * nss/nss_compat/compat-pwd.c (copy_pwd_changes): Likewise. (internal_getpwuid_r): Likewise. * nss/nss_compat/compat-spwd.c (copy_spwd_changes): Likewise. * posix/glob.h (__GLOB_FLAGS): Likewise. * posix/regcomp.c (peek_token): Likewise. (peek_token_bracket): Likewise. (parse_expression): Likewise. * posix/regexec.c (sift_states_iter_mb): Likewise. (check_node_accept_bytes): Likewise. * posix/tst-spawn3.c (do_test): Likewise. * posix/wordexp-test.c (testit): Likewise. * posix/wordexp.c (parse_tilde): Likewise. (exec_comm): Likewise. * posix/wordexp.h (__WRDE_FLAGS): Likewise. * resource/vtimes.c (TIMEVAL_TO_VTIMES): Likewise. * setjmp/sigjmp.c (__sigjmp_save): Likewise. * stdio-common/printf_fp.c (__printf_fp_l): Likewise. * stdio-common/tst-fileno.c (do_test): Likewise. * stdio-common/vfprintf-internal.c (vfprintf): Likewise. * stdlib/strfmon_l.c (__vstrfmon_l_internal): Likewise. * stdlib/strtod_l.c (round_and_return): Likewise. (____STRTOF_INTERNAL): Likewise. * stdlib/tst-strfrom.h (TEST_STRFROM): Likewise. * string/strcspn.c (STRCSPN): Likewise. * string/test-memmem.c (simple_memmem): Likewise. * termios/tcsetattr.c (tcsetattr): Likewise. * time/alt_digit.c (_nl_parse_alt_digit): Likewise. * time/asctime.c (asctime_internal): Likewise. * time/strptime_l.c (__strptime_internal): Likewise. * time/sys/time.h (timercmp): Likewise. * time/tzfile.c (__tzfile_compute): Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2019-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2018-01-011-1/+1
| | | | | | | * All files with FSF copyright notices: Update copyright dates using scripts/update-copyrights. * locale/programs/charmap-kw.h: Regenerated. * locale/programs/locfile-kw.h: Likewise.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2017-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2016-01-041-1/+1
|
* hurdselect: remove dead code.Samuel Thibault2015-02-071-7/+0
| | | | | | | | | | | | | | | | | | This removes code which actually never happens, and is already taken care of in the function. This is in the second part of select, when the __mach_msg() function over the portset has returned something else than MACH_MSG_SUCCESS. I guess in the past the value returned by __mach_msg() was stored in err, so this code was necessary to set back err to 0, but now it is stored in msgerr, so err is already still 0 by default. It can thus never contain MACH_RCV_TIMED_OUT, i.e. the code is dead. The first case mentioned in the comment is already handled: on time out with no message, err is already still the default 0. On time out due to poll, err would still be 0, unless some of the io_select RPCs has returned EINTR, in which case it contains EINTR. If any other io_select RPCs had returned a proper answer, got!=0, and thus err is set to 0 just below. The code is thus indeed not useful any more.
* hurdselect: Let select get interrupted by signalsSamuel Thibault2015-02-071-1/+4
| | | | | We need to set MACH_RCV_INTERRUPT to avoid __mach_msg just looping on signals, and then we can handle the interruption.
* hurd: allow poll() array bigger than FD_SETSIZESamuel Thibault2015-02-071-1/+1
|
* Update copyright dates with scripts/update-copyrights.Joseph Myers2015-01-021-1/+1
|
* Update copyright notices with scripts/update-copyrightsAllan McRae2014-01-011-1/+1
|
* Update copyright notices with scripts/update-copyrights.Joseph Myers2013-01-021-1/+1
|
* Hurd: _hurd_select: check for invalid parameter valuesPino Toscano2012-05-101-7/+21
|
* Replace FSF snail mail address with URLs.Paul Eggert2012-02-091-3/+2
|
* Hurd: fix timeout rounding in selectSamuel Thibault2010-08-021-1/+1
|
* * hurd/hurdselect.c (_hurd_select): FixRoland McGrath2002-04-021-11/+20
| | | | | | | | | | | | | | | | | | | | | | | MACH_MSG_TYPE_INTEGER_T -> integer_t in sizeof. Use a union rather than casts to compare mach_msg_type_t as int. 2002-03-25 Roland McGrath <roland@frob.com> * hurd/hurdchdir.c (_hurd_change_directory_port_from_name): Don't check off the end of NAME when it's shorter than 2 chars. Reported by Ognyan Kulev <ogi@fmi.uni-sofia.bg>. 2002-03-17 Roland McGrath <roland@frob.com> * sysdeps/mach/hurd/i386/sys/io.h: New file. * sysdeps/mach/hurd/i386/ioperm.c: New file. * sysdeps/mach/hurd/i386/Dist: Add them. * sysdeps/mach/hurd/i386/Versions (libc: GLIBC_2.2.6): New set, add ioperm. * sysdeps/mach/configure.in: New check to set HAVE_I386_IO_PERM_MODIFY. (mach_interface_list): Check for mach_i386.defs. * config.h.in (HAVE_I386_IO_PERM_MODIFY): #undef it. * sysdeps/mach/configure: Regenerated.
* * hurd/hurdselect.c (_hurd_select) [MACH_MSG_TRAILER_MINIMUM_SIZE]:Roland McGrath2002-02-171-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | Use untyped Mach IPC message format. * sysdeps/mach/hurd/ioctl.c (__ioctl) [! MACH_MSG_TYPE_BIT]: Handle Handle untyped Mach IPC message formats. * hurd/catch-exc.c (_S_catch_exception_raise) [EXC_MASK_ALL]: Expect different argument conventions when this is defined. [EXC_MASK_ALL] (_S_catch_exception_raise_state): New stub function. [EXC_MASK_ALL] (_S_catch_exception_raise_state_identity): Likewise. * hurd/hurdfault.c: Likewise for _hurdsig_fault_catch_exception_*. [NDR_CHAR_ASCII] (mig_reply_header_t): #define as mig_reply_error_t for OSF Mach variant. (faulted): Use mig_reply_error_t for REPLY. (_hurdsig_fault_init) [EXC_MASK_ALL]: Use EXCEPTION_STATE_IDENTITY in __thread_set_exception_ports call. (_hurdsig_fault_init) [MACH_PORT_RECEIVE_STATUS]: Use __mach_port_set_attributes in place of __mach_port_set_qlimit. * sysdeps/mach/powerpc/sysdep.h (_MACH_MACHINE_ASM_H): Define this before include <sysdeps/mach/sysdep.h>, to inhibit <mach/machine/asm.h> on Darwin, which includes bogons.
* 2001-10-28 Roland McGrath <roland@frob.com>Roland McGrath2001-10-281-8/+12
| | | | | * hurd/hurdselect.c (_hurd_select): Check SELECT_RETURNED bit when packing results for a `poll' call.
* Update to LGPL v2.1.Andreas Jaeger2001-07-061-8/+8
| | | | | | | | | | | | | | 2001-07-06 Paul Eggert <eggert@twinsun.com> * manual/argp.texi: Remove ignored LGPL copyright notice; it's not appropriate for documentation anyway. * manual/libc-texinfo.sh: "Library General Public License" -> "Lesser General Public License". 2001-07-06 Andreas Jaeger <aj@suse.de> * All files under GPL/LGPL version 2: Place under LGPL version 2.1.
* 1999-02-27 Roland McGrath <roland@baalperazim.frob.com> Roland McGrath1999-02-271-3/+4
| | | | | | * hurd/hurdselect.c (_hurd_select): When bailing for bogus fd, don't try to _hurd_port_free a lower-numbered descriptor that was not in any fd_set.
* 1998-12-05 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1998-12-061-0/+444
* sysdeps/mach/hurd/pselect.c: New file. * sysdeps/mach/hurd/poll.c: New file. * hurd/Makefile (routines): Add hurdselect. * hurd/hurdselect.c: New file. (_hurd_select): New function, guts taken from ... * sysdeps/mach/hurd/select.c (__select): ... here. Now work by just calling _hurd_select. * hurd/hurd/fd.h: Declare _hurd_select. 1998-12-05 Roland McGrath <roland@baalperazim.frob.com> * time/strptime.c: Fix unterminated comment in last change. * argp/argp.h: Add __restrict.