diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-06-01 21:50:19 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-06-01 21:50:19 +0200 |
commit | f2f10e176025f565068c620488f0d9b36fabc0af (patch) | |
tree | dbe0fae961d8f5f38d681715f4926f164ed5eb17 /sysdeps/mach/hurd | |
parent | 1c17efdfa175c23dc806e0d96f200aa5b3a83564 (diff) | |
parent | d79a29a53840ee1f47a7d0f1c7f751944f4af15a (diff) |
Merge commit 'refs/top-bases/tschwinge/Roger_Whittaker' into tschwinge/Roger_Whittaker
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r-- | sysdeps/mach/hurd/futimens.c | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/makecontext-helper.c | 71 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/makecontext.S | 8 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/tls.h | 6 | ||||
-rw-r--r-- | sysdeps/mach/hurd/utime-helper.c | 8 |
5 files changed, 11 insertions, 88 deletions
diff --git a/sysdeps/mach/hurd/futimens.c b/sysdeps/mach/hurd/futimens.c index 3159cb078c..8810e3d0e5 100644 --- a/sysdeps/mach/hurd/futimens.c +++ b/sysdeps/mach/hurd/futimens.c @@ -55,16 +55,18 @@ __futimens (int fd, const struct timespec tsp[2]) /* Setting the number of microseconds to `-1' tells the underlying filesystems to use the current time. */ atim.microseconds = mtim.microseconds = -1; - else if (tsp[0].tv_nsec == UTIME_OMIT || tsp[1].tv_nsec == UTIME_OMIT) - return EOPNOTSUPP; else { if (tsp[0].tv_nsec == UTIME_NOW) atim.microseconds = -1; + else if (tsp[0].tv_nsec == UTIME_OMIT) + atim.microseconds = -2; else TIMESPEC_TO_TIME_VALUE (&atim, &(tsp[0])); if (tsp[1].tv_nsec == UTIME_NOW) mtim.microseconds = -1; + else if (tsp[1].tv_nsec == UTIME_OMIT) + mtim.microseconds = -2; else TIMESPEC_TO_TIME_VALUE (&mtim, &(tsp[1])); } diff --git a/sysdeps/mach/hurd/i386/makecontext-helper.c b/sysdeps/mach/hurd/i386/makecontext-helper.c deleted file mode 100644 index e604488264..0000000000 --- a/sysdeps/mach/hurd/i386/makecontext-helper.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Helper for makecontext: handle threadvars. - Copyright (C) 2013 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <hurd/threadvar.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ucontext.h> - -#if 0 - -void -__makecontext_helper (ucontext_t *ucp) -{ - if (__hurd_threadvar_stack_mask == 0) - { - /* We are not using threads, so per init-first.c:init, the threadvars - live in a malloced space, addressed relative to the base of the - virtual address space. Just keep using that one. */ - } - else - { - /* The following is only prepared to work with libpthread, which only - keeps the threadvars at the bottom of the stack -- contrary to - libthreads, which also puts additional data there. */ - - void *s = ucp->uc_stack.ss_sp; - size_t s_size = ucp->uc_stack.ss_size; - - /* Is the new stack suitable? Check that that the last threadvar - occupies the last storage unit within the bounds of the new stack. - Alignment according to (sp & __hurd_threadvar_stack_mask) == sp is not - actually a requirement (though, in practice it often will be). */ - if (__hurd_threadvar_location_from_sp (_HURD_THREADVAR_MAX, s) - != s + s_size) - { - /* Instead of having makecontext return an error, we bail out the - hard way, as we can't expect its caller to be able to properly - react to this situation. */ - fprintf (stderr, - "*** makecontext: a stack at %p with size %#x is not " - "usable with threadvars\n", - s, s_size); - abort (); - } - - /* Copy the threadvars to the new stack. */ - void *t_old = __hurd_threadvar_location (0); - void *t_new = __hurd_threadvar_location_from_sp (0, s); - size_t t_size = __hurd_threadvar_max * sizeof (unsigned long int); - memcpy (t_new, t_old, t_size); - /* Account for the space taken by the threadvars. */ - ucp->uc_stack.ss_size -= t_size; - } -} -#endif diff --git a/sysdeps/mach/hurd/i386/makecontext.S b/sysdeps/mach/hurd/i386/makecontext.S index 95ae3411a8..8364fb98ee 100644 --- a/sysdeps/mach/hurd/i386/makecontext.S +++ b/sysdeps/mach/hurd/i386/makecontext.S @@ -24,14 +24,6 @@ ENTRY(__makecontext) movl 4(%esp), %eax - subl $4, %esp - cfi_adjust_cfa_offset (4) - movl %eax, (%esp) - /* call HIDDEN_JUMPTARGET (__makecontext_helper) */ - addl $4, %esp - cfi_adjust_cfa_offset (-4) - - movl 4(%esp), %eax /* Load the address of the function we are supposed to run. */ movl 8(%esp), %ecx diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h index 97e2fe4ef6..b06a1e5218 100644 --- a/sysdeps/mach/hurd/i386/tls.h +++ b/sysdeps/mach/hurd/i386/tls.h @@ -128,7 +128,7 @@ _hurd_tls_init (tcbhead_t *tcb) /* Get the first available selector. */ int sel = -1; - kern_return_t err = __i386_set_gdt (self, &sel, desc); + error_t err = __i386_set_gdt (tcb->self, &sel, desc); if (err == MIG_BAD_ID) { /* Old kernel, use a per-thread LDT. */ @@ -207,7 +207,7 @@ _hurd_tls_fork (thread_t child, thread_t orig, struct i386_thread_state *state) return 0; struct descriptor desc, *_desc = &desc; - kern_return_t err; + error_t err; unsigned int count = 1; if (__glibc_unlikely (__i386_selector_is_ldt(sel))) @@ -238,7 +238,7 @@ _hurd_tls_new (thread_t child, struct i386_thread_state *state, tcbhead_t *tcb) return 0; HURD_TLS_DESC_DECL (desc, tcb); - kern_return_t err; + error_t err; tcb->tcb = tcb; tcb->self = child; diff --git a/sysdeps/mach/hurd/utime-helper.c b/sysdeps/mach/hurd/utime-helper.c index 93a556a6ed..357dfe9705 100644 --- a/sysdeps/mach/hurd/utime-helper.c +++ b/sysdeps/mach/hurd/utime-helper.c @@ -1,5 +1,5 @@ -/* Threshold at which to diagnose ELOOP. Hurd version. - Copyright (C) 2015 Free Software Foundation, Inc. +/* Helpers for utimes/utimens conversions. + Copyright (C) 2015-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,7 @@ /* Initializes atime/mtime timespec structures from an array of timeval. */ static inline void utime_ts_from_tval (const struct timeval tvp[2], - struct timespec *atime, struct timespec *mtime) + struct timespec *atime, struct timespec *mtime) { if (tvp == NULL) { @@ -45,7 +45,7 @@ utime_ts_from_tval (const struct timeval tvp[2], /* Initializes atime/mtime time_value_t structures from an array of timeval. */ static inline void utime_tvalue_from_tval (const struct timeval tvp[2], - time_value_t *atime, time_value_t *mtime) + time_value_t *atime, time_value_t *mtime) { if (tvp == NULL) /* Setting the number of microseconds to `-1' tells the |