about summary refs log tree commit diff
path: root/hurd/hurd
Commit message (Collapse)AuthorAgeFilesLines
* hurd: Stop mapping AT_NO_AUTOMOUNT to O_NOTRANSSergey Bugaev2024-04-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While AT_NO_AUTOMOUNT is similar in function to the Hurd's O_NOTRANS, there are significant enough differences in semantics: 1. AT_NO_AUTOMOUNT has no effect on already established mounts, whereas O_NOTRANS causes the lookup to ignore both passive and active translators. A better approximation of the AT_NO_AUTOMOUNT behavior would be to honor active translators, but avoid starting passive ones; like what the file_name_lookup_carefully () routine from sutils/clookup.c in the Hurd source tree does. 2. On GNU/Hurd, translators are used much more pervasively than mounts on "traditional" Unix systems: among other things, translators underlie features like symlinks, device nodes, and sockets. And while on a "traditional" Unix system, the mountpoint and the root of the mounted tree may look similar enough for many purposes (they're both directories, for one thing), the Hurd allows for any combination of the two node types, and indeed it is common to have e.g. a device node "mounted" on top of a regular file node on the underlying filesystem. Ignoring the translator and stat'ing the underlying node is therefore likely to return very different results from what you'd get if you stat the translator's root node. In practice, mapping AT_NO_AUTOMOUNT to O_NOTRANS was breaking GNU Coreutils, including stat(1) and ls(1): $ stat /dev/hd0s1 File: /dev/hd0s1 Size: 0 Blocks: 8 IO Block: 8192 regular empty file Device: 0,8 Inode: 32866 Links: 1 This was also breaking GNOME's glib, where a g_local_file_stat () call that is supposed to stat () a file through a symlink uses AT_NO_AUTOMOUNT, which gets mapped to O_NOTRANS, which then causes the stat () call to stat symlink itself like lstat () would, rather then the file it points to, which is what the logic expects to happen. This reverts most of 13710e7e6af6c8965cc9a63a0660cb4ce1966557 "hurd: Add support for AT_NO_AUTOMOUNT". Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
* hurd: Move internal functions to internal headerSergey Bugaev2024-03-231-87/+0
| | | | | | | | | | | Move _hurd_self_sigstate (), _hurd_critical_section_lock (), and _hurd_critical_section_unlock () inline implementations (that were already guarded by #if defined _LIBC) to the internal version of the header. While at it, add <tls.h> to the includes, and use __LIBC_NO_TLS () unconditionally. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-ID: <20240323173301.151066-2-bugaevc@gmail.com>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-0111-11/+11
|
* hurd: Avoid including thread_state.h in installed headerSamuel Thibault2023-09-051-2/+1
| | | | | thread_state.h is not actually installed. It was only needed for struct machine_thread_all_state, which we can just declare, actually.
* hurd: Add prototype for and thus fix _hurdsig_abort_rpcs callSamuel Thibault2023-08-151-0/+6
| | | | This was actually not a problem since NULL was getting passed.
* Fix all the remaining misspellings -- BZ 25337Paul Pluzhnikov2023-06-021-1/+1
|
* hurd: Mark error functions as __COLDSergey Bugaev2023-04-291-4/+4
| | | | | | | | This should hopefully hint the compiler that they are unlikely to be called. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230429131223.2507236-2-bugaevc@gmail.com>
* hurd: Mark various conditions as unlikelySergey Bugaev2023-04-292-7/+7
| | | | | Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230429131354.2507443-3-bugaevc@gmail.com>
* hurd: Simplify _hurd_critical_section_lock a bitSergey Bugaev2023-04-291-13/+6
| | | | | | | | This block of code was doing exactly what _hurd_self_sigstate does; so just call that and let it do its job. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230429131354.2507443-1-bugaevc@gmail.com>
* hurd: Remove __hurd_local_reply_portSergey Bugaev2023-04-141-7/+0
| | | | | | | | | | | | | | | | | | Now that the signal code no longer accesses it, the only real user of it was mig-reply.c, so move the logic for managing the port there. If we're in SHARED and outside of rtld, we know that __LIBC_NO_TLS () always evaluates to 0, and a TLS reply port will always be used, not __hurd_reply_port0. Still, the compiler does not see that __hurd_reply_port0 is never used due to its address being taken. To deal with this, explicitly compile out __hurd_reply_port0 when we know we won't use it. Also, instead of accessing the port via THREAD_SELF->reply_port, this uses THREAD_GETMEM and THREAD_SETMEM directly, avoiding possible miscompilations. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
* hurd: Microoptimize _hurd_self_sigstate ()Sergey Bugaev2023-04-031-3/+5
| | | | | | | | | When THREAD_GETMEM is defined with inline assembly, the compiler may not optimize away the two reads of _hurd_sigstate. Help it out a little bit by only reading it once. This also makes for a slightly cleaner code. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-32-bugaevc@gmail.com>
* hurd: Remove __hurd_threadvar_stack_{offset,mask}Sergey Bugaev2023-04-031-15/+0
| | | | | | | | | | | Noone is or should be using __hurd_threadvar_stack_{offset,mask}, we have proper TLS now. These two remaining variables are never set to anything other than zero, so any code that would try to use them as described would just dereference a zero pointer and crash. So remove them entirely. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-6-bugaevc@gmail.com>
* hurd: Make exception subcode a longSergey Bugaev2023-04-031-2/+3
| | | | | | | On EXC_BAD_ACCESS, exception subcode is used to pass the faulting memory address, so it needs to be (at least) pointer-sized. Thus, make it into a long. This matches the corresponding change in GNU Mach. Message-Id: <20230319151017.531737-5-bugaevc@gmail.com>
* mach, hurd: Cast through uintptr_tSergey Bugaev2023-02-121-1/+1
| | | | | | | | | | | | | | | | When casting between a pointer and an integer of a different size, GCC emits a warning (which is escalated to a build failure by -Werror). Indeed, if what you start with is a pointer, which you then cast to a shorter integer and then back again, you're going to cut off some bits of the pointer. But if you start with an integer (such as mach_port_t), then cast it to a longer pointer (void *), and then back to a shorter integer, you are fine. To keep GCC happy, cast through an intermediary uintptr_t, which is always the same size as a pointer. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230212111044.610942-4-bugaevc@gmail.com>
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-0611-11/+11
|
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-0111-11/+11
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* hurd: let csu initialize tlsSamuel Thibault2021-12-281-15/+24
| | | | | | | | Since 9cec82de715b ("htl: Initialize later"), we let csu initialize pthreads. We can thus let it initialize tls later too, to better align with the generic order. Initialization however accesses ports which links/unlinks into the sigstate for unwinding. We can however easily skip that during initialization.
* hurd: Add support for AT_NO_AUTOMOUNTSamuel Thibault2021-08-101-0/+6
|
* hurd: handle EINTR during critical sectionsSamuel Thibault2021-03-231-0/+4
| | | | | | | | | During critical sections, signal handling is deferred and thus RPCs return EINTR, even if SA_RESTART is set. We thus have to restart the whole critical section in that case. This also adds HURD_CRITICAL_UNLOCK in the cases where one wants to break the section in the middle.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2021-01-0211-11/+11
| | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 6694 files FOO. I then removed trailing white space from benchtests/bench-pthread-locks.c and iconvdata/tst-iconv-big5-hkscs-to-2ucs4.c, to work around this diagnostic from Savannah: remote: *** pre-commit check failed ... remote: *** error: lines with trailing whitespace found remote: error: hook declined to update refs/heads/master
* hurd: set sigaction for signal preemptors in arch-independent fileSamuel Thibault2020-12-261-1/+2
| | | | | | Instead of having the arch-specific trampoline setup code detect whether preemption happened or not, we'd rather pass it the sigaction. In the future, this may also allow to change sa_flags from post_signal().
* Hurd: make sigstates hold a reference on thread portsRichard Braun2020-12-211-4/+15
| | | | | | | | | | | | | This change is required in order to correctly release per-thread resources. Directly reusing the threading library reference isn't possible since the sigstate is also used early in the main thread, before threading is initialized. * hurd/hurd/signal.h (_hurd_self_sigstate): Drop thread reference after calling _hurd_thread_sigstate. (_hurd_critical_section_lock): Likewise. * hurd/hurdsig.c (_hurd_thread_sigstate): Add a reference on the thread. (_hurd_sigstate_delete): Drop thread reference.
* hurd: implement SA_SIGINFO signal handlers.Jeremie Koenig2020-12-211-0/+5
| | | | | | | SA_SIGINFO is actually just another way of expressing what we were already passing over with struct sigcontext. This just introduces the SIGINFO interface and fixes the posix values when that interface is requested by the application.
* hurd: Remove some remnants of cthreadsSamuel Thibault2020-11-153-7/+5
| | | | | Libc has actually been using mach's lock-internal.h mutex for a long time already.
* hurd: clean fd and port on thread cancelSamuel Thibault2020-06-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HURD_*PORT_USE link fd and port with a stack-stored structure, so on thread cancel we need to cleanup this. * hurd/fd-cleanup.c: New file. * hurd/port-cleanup.c (_hurd_port_use_cleanup): New function. * hurd/Makefile (routines): Add fd-cleanup. * sysdeps/hurd/include/hurd.h (__USEPORT_CANCEL): New macro. * sysdeps/hurd/include/hurd/fd.h (_hurd_fd_port_use_data): New structure. (_hurd_fd_port_use_cleanup): New prototype. (HURD_DPORT_USE_CANCEL, HURD_FD_PORT_USE_CANCEL): New macros. * sysdeps/hurd/include/hurd/port.h (_hurd_port_use_data): New structure. (_hurd_port_use_cleanup): New prototype. (HURD_PORT_USE_CANCEL): New macro. * hurd/hurd/fd.h (HURD_FD_PORT_USE): Also refer to HURD_FD_PORT_USE_CANCEL. * hurd/hurd.h (__USEPORT): Also refer to __USEPORT_CANCEL. * hurd/hurd/port.h (HURD_PORT_USE): Also refer to HURD_PORT_USE_CANCEL. * hurd/fd-read.c (_hurd_fd_read): Call HURD_FD_PORT_USE_CANCEL instead of HURD_FD_PORT_USE. * hurd/fd-write.c (_hurd_fd_write): Likewise. * sysdeps/mach/hurd/send.c (__send): Call HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE. * sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Likewise. * sysdeps/mach/hurd/sendto.c (__sendto): Likewise. * sysdeps/mach/hurd/recv.c (__recv): Likewise. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise. * sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Call __USEPORT_CANCEL instead of __USEPORT, and HURD_DPORT_USE_CANCEL instead of HURD_DPORT_USE.
* Hurd: Move <hurd/sigpreempt.h> internals into wrapper headerFlorian Weimer2020-05-281-10/+0
| | | | | | | | _hurdsig_preemptors and _hurdsig_preempted_set are not ABI symbols, so do not declare them. HURD_PREEMPT_SIGNAL_P is an implementation detail, so move it as well. Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* Hurd: Use __sigmask in favor of deprecated sigmaskFlorian Weimer2020-05-281-1/+1
| | | | | | | | | This fixes various build errors due to deprecation warnings. Fixes commit 02802fafcf6e11ea3f998f685035ffe568dfddeb ("signal: Deprecate additional legacy signal handling functions"). Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* hurd: Add THREAD_GET/SETMEM/_NCSamuel Thibault2020-02-151-5/+6
| | | | Store them in the TCB, and use them for accessing _hurd_sigstate.
* Update copyright dates with scripts/update-copyrights.Joseph Myers2020-01-0111-11/+11
|
* hurd: Global signal dispositionJeremie Koenig2019-12-291-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds _hurd_sigstate_set_global_rcv used by libpthread to enable POSIX-confirming behavior of signals on a per-thread basis. This also provides a sigstate destructor _hurd_sigstate_delete, and a global process signal state, which needs to be locked and check when global disposition is enabled, thus the addition of _hurd_sigstate_lock _hurd_sigstate_actions _hurd_sigstate_pending _hurd_sigstate_unlock helpers. This also updates all the glibc code accordingly. This also drops support for get_int(INIT_SIGMASK), which did not make sense any more since we do not have a single signal thread any more. During fork/spawn, this also reinitializes the child global sigstate's lock. That cures an issue that would very rarely cause a deadlock in the child in fork, tries to unlock ss' critical section lock at the end of fork. This will typically (always?) be observed in /bin/sh, which is not surprising as that is the foremost caller of fork. To reproduce an intermediate state, add an endless loop if _hurd_global_sigstate is locked after __proc_dostop (cast through volatile); that is, while still being in the fork's parent process. When that triggers (use the libtool testsuite), the signal thread has already locked ss (which is _hurd_global_sigstate), and is stuck at hurdsig.c:685 in post_signal, trying to lock _hurd_siglock (which the main thread already has locked and keeps locked until after __task_create). This is the case that ss->thread == MACH_PORT_NULL, that is, a global signal. In the main thread, between __proc_dostop and __task_create is the __thread_abort call on the signal thread which would abort any current kernel operation (but leave ss locked). Later in fork, in the parent, when _hurd_siglock is unlocked in fork, the parent's signal thread can proceed and will unlock eventually the global sigstate. In the client, _hurd_siglock will likewise be unlocked, but the global sigstate never will be, as the client's signal thread has been configured to restart execution from _hurd_msgport_receive. Thus, when the child tries to unlock ss' critical section lock at the end of fork, it will first lock the global sigstate, will spin trying to lock it, which can never be successful, and we get our deadlock. Options seem to be: * Move the locking of _hurd_siglock earlier in post_signal -- but that may generally impact performance, if this locking isn't generally needed anyway? On the other hand, would it actually make sense to wait here until we are not any longer in a critical section (which is meant to disable signal delivery anyway (but not for preempted signals?))? * Clear the global sigstate in the fork's child with the rationale that we're anyway restarting the signal thread from a clean state. This has now been implemented. Why has this problem not been observed before Jérémie's patches? (Or has it? Perhaps even more rarely?) In _S_msg_sig_post, the signal is now posted to a *global receiver thread*, whereas previously it was posted to the *designated signal-receiving thread*. The latter one was in a critical section in fork, so didn't try to handle the signal until after leaving the critical section? (Not completely analyzed and verified.) Another question is what the signal is that is being received during/around the time __proc_dostop executes.
* Prefer https to http for gnu.org and fsf.org URLsPaul Eggert2019-09-0711-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 comment styleSamuel Thibault2019-03-161-2/+1
|
* hurd: Document how EINTR should be handled in critical sectionsSamuel Thibault2019-03-161-1/+7
| | | | | * hurd/hurd/signal.h (_hurd_critical_section_lock): Document how EINTR should be handled.
* Break some lines before not after operators.Joseph Myers2019-02-222-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0111-11/+11
| | | | | | | * 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.
* hurd: Fix spawni's user_link reallocationSamuel Thibault2018-11-111-2/+2
| | | | | * hurd/hurd/userlink.h (_hurd_userlink_move): Make new_link's predecessor point to new_link instead of link.
* Hurd: Fix ulinks in fd table reallocationSamuel Thibault2018-11-102-0/+49
| | | | | | | * hurd/hurd/userlink.h (_hurd_userlink_move): New function. * hurd/hurd/port.h (_hurd_port_move): New function. * sysdeps/mach/hurd/spawni.c (NEW_ULINK_TABLE): New macro. (EXPAND_DTABLE): Use NEW_ULINK_TABLE macro for ulink_dtable.
* hurd: Fix coding styleSamuel Thibault2018-03-182-2/+2
|
* hurd: Replace threadvars with TLSSamuel Thibault2018-03-172-90/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gets rid of a lot of kludge and gets closer to other ports. * hurd/Makefile (headers): Remove threadvar.h. (inline-headers): Remove threadvar.h. * hurd/Versions (GLIBC_2.0: Remove __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables, __hurd_threadvar_max, __hurd_errno_location. (HURD_CTHREADS_0.3): Add pthread_getattr_np, pthread_attr_getstack. * hurd/hurd/signal.h: Do not include <hurd/threadvar.h>. (_hurd_self_sigstate): Use THREAD_SELF to get _hurd_sigstate. (_HURD_SIGNAL_H_EXTERN_INLINE): Use THREAD_SELF to get _hurd_sigstate, unless TLS is not initialized yet, in which case we do not need a critical section yet anyway. * hurd/hurd/threadvar.h: Include <tls.h>, do not include <machine-sp.h>. (__hurd_sigthread_variables, __hurd_threadvar_max): Remove variables declarations. (__hurd_threadvar_index): Remove enum. (_HURD_THREADVAR_H_EXTERN_INLINE): Remove macro. (__hurd_threadvar_location_from_sp,__hurd_threadvar_location): Remove inlines. (__hurd_reply_port0): New variable declaration. (__hurd_local_reply_port): New macro. * hurd/hurdsig.c (__hurd_sigthread_variables): Remove variable. (interrupted_reply_port_location): Add thread_t parameter. Use it with THREAD_TCB to access thread-local variables. (_hurdsig_abort_rpcs): Pass ss->thread to interrupted_reply_port_location. (_hurd_internal_post_signal): Likewise. (_hurdsig_init): Use presence of cthread_fork instead of __hurd_threadvar_stack_mask to start signal thread by hand. Remove signal thread threadvar initialization. * hurd/hurdstartup.c: Do not include <hurd/threadvar.h> * hurd/sigunwind.c: Include <hurd/threadvar.h> (_hurdsig_longjmp_from_handler): Use __hurd_local_reply_port instead of threadvar. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE): Add __libc_lock_self0. (ld.GLIBC_2.0): Remove __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables. (ld.GLIBC_PRIVATE): Add __libc_lock_self0. * sysdeps/mach/hurd/cthreads.c: Add __libc_lock_self0. * sysdeps/mach/hurd/dl-sysdep.c (errno, __hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables, threadvars, __hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): Do not define variables. * sysdeps/mach/hurd/errno-loc.c: Do not include <errno.h> and <hurd/threadvar.h>. [IS_IN(rtld)] (rtld_errno): New variable. [IS_IN(rtld)] (__errno_location): New weak function. [!IS_IN(rtld)]: Include "../../../csu/errno-loc.c". * sysdeps/mach/hurd/errno.c: Remove file. * sysdeps/mach/hurd/fork.c: Include <hurd/threadvar.h> (__fork): Remove THREADVAR_SPACE macro and its use. * sysdeps/mach/hurd/i386/init-first.c (__hurd_threadvar_max): Remove variable. (init): Do not initialize threadvar. * sysdeps/mach/hurd/i386/libc.abilist (__hurd_threadvar_max): Remove symbol. * sysdeps/mach/hurd/i386/sigreturn.c (__sigreturn): Use __hurd_local_reply_port instead of threadvar. * sysdeps/mach/hurd/i386/tls.h (tcbhead_t): Add reply_port and _hurd_sigstate fields. (HURD_DESC_TLS, __LIBC_NO_TLS, THREAD_TCB): New macro. * sysdeps/mach/hurd/i386/trampoline.c: Remove outdated comment. * sysdeps/mach/hurd/libc-lock.h: Do not include <hurd/threadvar.h>. (__libc_lock_owner_self): Use &__libc_lock_self0 and THREAD_SELF instead of threadvar. * sysdeps/mach/hurd/libc-tsd.h: Remove file. * sysdeps/mach/hurd/mig-reply.c (GETPORT, reply_port): Remove macros. (use_threadvar, global_reply_port): Remove variables. (__hurd_reply_port0): New variable. (__mig_get_reply_port): Use __hurd_local_reply_port and __hurd_reply_port0 instead of threadvar. (__mig_dealloc_reply_port): Likewise. (__mig_init): Do not initialize threadvar. * sysdeps/mach/hurd/profil.c: Fix comment.
* hurd: Fix includability of <hurd/signal.h> in all standardsSamuel Thibault2018-03-051-0/+1
| | | | | | | | | | | | | * bits/sigaction.h: Add include guard. * sysdeps/unix/sysv/linux/alpha/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/hppa/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sigaction.h: Likewise. * sysdeps/unix/sysv/linux/tile/bits/sigaction.h: Likewise. * hurd/hurd/signal.h: Include <bits/sigaction.h>.
* Separate out error_t definitionSamuel Thibault2018-03-046-0/+8
| | | | | | | | | | | | | | | | | | so interfaces needing it can get it. * stdlib/errno.h (error_t): Move definition to... * bits/types/error_t.h: ... new header. * stdlib/Makefile (headers): Add bits/types/error_t.h. * sysdeps/mach/hurd/bits/errno.h (error_t): Move definition to... * sysdeps/mach/hurd/bits/types/error_t.h: ... new header. * sysdeps/mach/hurd/errnos.awk (error_t): Likewise. * hurd/hurd.h: Include <bits/types/error_t.h> * hurd/hurd/fd.h: Include <bits/types/error_t.h> * hurd/hurd/id.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/lookup.h: Include <errno.h> and <bits/types/error_t.h> * hurd/hurd/resource.h: Include <bits/types/error_t.h> * hurd/hurd/signal.h: Include <bits/types/error_t.h> * hurd/hurd/sigpreempt.h: Include <bits/types/error_t.h>
* hurd: Make almost all hurd headers includable in all standardsSamuel Thibault2018-03-043-14/+17
| | | | | | | | | | | | | | * hurd/hurd.h: Include <bits/types/sigset_t.h> * hurd/hurd/fd.h: Include <sys/select.h> and <bits/types/sigset_t.h> (_hurd_fd_read, _hurd_fd_write): Use __loff_t instead of loff_t. * hurd/hurd/signal.h: Include <bits/types/stack_t.h> and <bits/types/sigset_t.h>. [!defined __USE_GNU]: Do not #error out. (struct hurd_sigstate): Use _NSIG instead of NSIG. * hurd/hurd/sigpreempt.h (__need_size_t): Define. Include <stddef.h> and <bits/types/sigset_t.h> (struct hurd_signal_preemptor, hurd_catch_signal): Use __sighandler_t instead of sighandler_t.
* hurd: fix header conformitySamuel Thibault2018-03-041-1/+1
| | | | | * hurd/hurd/fd.h (_hurd_fd_error): Fix struct initializer to be trivial, for C++ conformity.
* hurd: avoid including hurd/signal.h when not neededSamuel Thibault2018-03-042-2/+5
| | | | | | | | | thus making <hurd/port.h> and <hurd/userlink.h> includable without _GNU_SOURCE. * hurd/hurd/port.h: Do not include <hurd/signal.h>. * hurd/hurd/userlink.h [!defined __USE_EXTERN_INLINES || !defined _LIBC || !IS_IN (libc)]: Do not include <hurd/signal.h>.
* hurd: Add missing includesSamuel Thibault2018-03-033-0/+4
| | | | | | * hurd/hurd/id.h: Include <hurd/hurd_types.h> * hurd/hurd/ioctl.h: Include <mach/port.h> * hurd/hurd/lookup.h: Include <hurd/hurd_types.h>
* hurd: Fix preprocessor indentationSamuel Thibault2018-01-295-35/+35
|
* hurd: Include <sigsetops.h> from hurd/hurd/signal.hSamuel Thibault2018-01-281-0/+5
| | | | | * hurd/hurd/signal.h [__USE_EXTERN_INLINES][_LIBC][IS_IN(libc) || IS_IN(libpthread)]: Include <sigsetops.h>.
* hurd: fix typoSamuel Thibault2018-01-281-1/+1
|
* hurd: take __USE_EXTERN_INLINES into account and restrict inlinesSamuel Thibault2018-01-285-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * hurd/hurd.h (__hurd_fail): Always declare function, and provide inline version only if __USE_EXTERN_INLINES is defined. * hurd/hurd/fd.h (_hurd_fd_error_signal, _hurd_fd_error, __hurd_dfail, __hurd_sockfail): Likewise. (_hurd_fd_get): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined and IS_IN(libc). * hurd/hurd/port.h (_hurd_port_init, _hurd_port_locked_get, _hurd_port_get, _hurd_port_free, _hurd_port_locked_set, _hurd_port_set): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined and IS_IN(libc). * hurd/hurd/signal.h (_hurd_self_sigstate, _hurd_critical_section_lock, _hurd_critical_section_unlock): Likewise. * hurd/hurd/threadvar.h (__hurd_threadvar_location_from_sp, * __hurd_threadvar_location): Likewise. * hurd/hurd/userlink.h (_hurd_userlink_link, _hurd_userlink_unlink, _hurd_userlink_clear): Likewise. * mach/lock-intern.h (__spin_lock_init, __spin_lock, __mutex_lock, __mutex_unlock, __mutex_trylock): Always declare functions, and provide inline versions only if __USE_EXTERN_INLINES and _LIBC are defined. * mach/mach/mig_support.h (__mig_strncpy): Likewise. * sysdeps/generic/machine-lock.h (__spin_unlock, __spin_try_lock, __spin_lock_locked): Likewise. * sysdeps/mach/i386/machine-lock.h (__spin_unlock, __spin_try_lock, __spin_lock_locked): Likewise. * mach/spin-lock.c (__USE_EXTERN_INLINES): Define to 1. * hurd/Versions (libc: GLIBC_2.27): Add _hurd_fd_error_signal, _hurd_fd_error, __hurd_dfail, __hurd_sockfail, _hurd_port_locked_set, __hurd_threadvar_location_from_sp, __hurd_threadvar_location, _hurd_userlink_link, _hurd_userlink_unlink, _hurd_userlink_clear.
* hurd: Fix warningsSamuel Thibault2018-01-281-9/+9
| | | | | | | | | | | | | * hurd/hurd/lookup.h (__hurd_file_name_lookup, hurd_file_name_lookup, __hurd_file_name_split, hurd_file_name_split, __hurd_directory_name_split, hurd_directory_name_split, __hurd_file_name_lookup_retry, hurd_file_name_lookup_retry, hurd_file_name_path_lookup): Make lookup function parameter take a const char *name instead of char *name. * hurd/hurdlookup.c (__hurd_file_name_lookup, __hurd_file_name_split, __hurd_directory_name_split): Likewise. * hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Likewise. * hurd/path-lookup.c (hurd_file_name_path_lookup): Likewise.