summaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:51:23 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:51:23 +0000
commit9a47d57c4784163dcf838c7461c53de29ca7a61f (patch)
tree80c130f3da27db25996b0a5f93270df554dcd8b4 /hurd
parente0b77a51a258fc7554aeb194ac6b219ee3078f0d (diff)
parent82dd75a7f436a19047325d62182590c9f9e23a78 (diff)
Merge branch 't/tls' into refs/top-bases/tschwinge/Roger_Whittaker
Diffstat (limited to 'hurd')
-rw-r--r--hurd/Makefile9
-rw-r--r--hurd/Versions8
-rw-r--r--hurd/alloc-fd.c2
-rw-r--r--hurd/catch-exc.c2
-rw-r--r--hurd/catch-signal.c29
-rw-r--r--hurd/compat-20.c2
-rw-r--r--hurd/ctty-input.c2
-rw-r--r--hurd/ctty-output.c2
-rw-r--r--hurd/dtable.c2
-rw-r--r--hurd/exc2signal.c3
-rw-r--r--hurd/fchroot.c2
-rw-r--r--hurd/fcntl-internal.h17
-rw-r--r--hurd/fd-close.c2
-rw-r--r--hurd/fd-read.c2
-rw-r--r--hurd/fd-write.c2
-rw-r--r--hurd/fopenport.c4
-rw-r--r--hurd/get-host.c6
-rw-r--r--hurd/getdport.c2
-rw-r--r--hurd/geteuids.c2
-rw-r--r--hurd/getumask.c2
-rw-r--r--hurd/hurd-raise.c3
-rw-r--r--hurd/hurd.h20
-rw-r--r--hurd/hurd/fd.h19
-rw-r--r--hurd/hurd/id.h5
-rw-r--r--hurd/hurd/ioctl.h3
-rw-r--r--hurd/hurd/lookup.h24
-rw-r--r--hurd/hurd/port.h27
-rw-r--r--hurd/hurd/resource.h3
-rw-r--r--hurd/hurd/signal.h33
-rw-r--r--hurd/hurd/sigpreempt.h18
-rw-r--r--hurd/hurd/threadvar.h14
-rw-r--r--hurd/hurd/userlink.h20
-rw-r--r--hurd/hurd/xattr.h2
-rw-r--r--hurd/hurdauth.c18
-rw-r--r--hurd/hurdchdir.c2
-rw-r--r--hurd/hurdexec.c55
-rw-r--r--hurd/hurdfault.c3
-rw-r--r--hurd/hurdfault.h2
-rw-r--r--hurd/hurdfchdir.c2
-rw-r--r--hurd/hurdhost.h2
-rw-r--r--hurd/hurdid.c2
-rw-r--r--hurd/hurdinit.c3
-rw-r--r--hurd/hurdioctl.c2
-rw-r--r--hurd/hurdkill.c2
-rw-r--r--hurd/hurdlock.c99
-rw-r--r--hurd/hurdlock.h36
-rw-r--r--hurd/hurdlookup.c10
-rw-r--r--hurd/hurdmalloc.h6
-rw-r--r--hurd/hurdmsg.c4
-rw-r--r--hurd/hurdpid.c2
-rw-r--r--hurd/hurdports.c2
-rw-r--r--hurd/hurdprio.c4
-rw-r--r--hurd/hurdrlimit.c2
-rw-r--r--hurd/hurdselect.c2
-rw-r--r--hurd/hurdsig.c26
-rw-r--r--hurd/hurdsock.c2
-rw-r--r--hurd/hurdsocket.h2
-rw-r--r--hurd/hurdstartup.c2
-rw-r--r--hurd/hurdstartup.h2
-rw-r--r--hurd/intern-fd.c3
-rw-r--r--hurd/intr-msg.c3
-rw-r--r--hurd/intr-rpc.defs2
-rw-r--r--hurd/intr-rpc.h2
-rw-r--r--hurd/longjmp-ts.c2
-rw-r--r--hurd/lookup-at.c2
-rw-r--r--hurd/lookup-retry.c8
-rw-r--r--hurd/msgportdemux.c2
-rw-r--r--hurd/new-fd.c2
-rw-r--r--hurd/openport.c2
-rw-r--r--hurd/path-lookup.c35
-rw-r--r--hurd/pid2task.c2
-rw-r--r--hurd/port-cleanup.c2
-rw-r--r--hurd/port2fd.c2
-rw-r--r--hurd/ports-get.c2
-rw-r--r--hurd/ports-set.c2
-rw-r--r--hurd/preempt-sig.c2
-rw-r--r--hurd/privports.c2
-rw-r--r--hurd/report-wait.c2
-rw-r--r--hurd/set-host.c2
-rw-r--r--hurd/setauth.c2
-rw-r--r--hurd/seteuids.c2
-rw-r--r--hurd/siginfo.c5
-rw-r--r--hurd/sigunwind.c2
-rw-r--r--hurd/stack_chk_fail_local.c1
-rw-r--r--hurd/task2pid.c2
-rw-r--r--hurd/thread-cancel.c2
-rw-r--r--hurd/thread-self.c2
-rw-r--r--hurd/trampoline.c4
-rw-r--r--hurd/vpprintf.c2
-rw-r--r--hurd/xattr.c8
90 files changed, 403 insertions, 297 deletions
diff --git a/hurd/Makefile b/hurd/Makefile
index 3c301b50f3..0063ed4eb3 100644
--- a/hurd/Makefile
+++ b/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2016 Free Software Foundation, Inc.
+# Copyright (C) 1991-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
@@ -81,10 +81,17 @@ shared-only-routines = compat-20
$(inlines:%=$(objpfx)%.c): $(objpfx)%-inlines.c: %.h
(h="`echo $(subst /,_,$*) | tr '[a-z]' '[A-Z]'`"; \
echo "#define _$${h}_H_EXTERN_INLINE /* Define real function. */"; \
+ echo "#define _$${h}_H_HIDDEN_DEF /* Declare hidden definition. */"; \
echo '#include "$<"') > $@-new
mv -f $@-new $@
generated += $(inlines:=.c)
+
+# Avoid ssp before TLS is initialized.
+CFLAGS-hurdstartup.o = $(no-stack-protector)
+CFLAGS-RPC_exec_startup_get_info.o = $(no-stack-protector)
+# Make generated headers compatible with all support standards
+migheaderpipe := | sed -e 's/\<ino64_t\>/__ino64_t/' -e 's/\<loff_t\>/__loff_t/'
include ../mach/Machrules
include ../Rules
diff --git a/hurd/Versions b/hurd/Versions
index bd5fd90806..b8d52b3d54 100644
--- a/hurd/Versions
+++ b/hurd/Versions
@@ -4,7 +4,6 @@ libc {
_end;
# variables used in macros & inline functions
- __hurd_threadvar_max;
__hurd_threadvar_stack_mask; __hurd_threadvar_stack_offset;
# functions used in libmachuser and libhurduser
@@ -131,7 +130,12 @@ libc {
_hurd_sigstate_pending;
_hurd_sigstate_unlock;
_hurd_sigstate_delete;
- GLIBC_2.19 {
+ }
+ GLIBC_2.26 {
+ # "quasi-internal" functions
+ _hurd_exec_paths;
+ }
+ GLIBC_2.27 {
# These always existed as inlines but the real functions were not exported.
_hurd_fd_error_signal; _hurd_fd_error;
__hurd_dfail; __hurd_sockfail;
diff --git a/hurd/alloc-fd.c b/hurd/alloc-fd.c
index 8630b2eb47..19775bf964 100644
--- a/hurd/alloc-fd.c
+++ b/hurd/alloc-fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/catch-exc.c b/hurd/catch-exc.c
index 98633fded3..8d3cb7d798 100644
--- a/hurd/catch-exc.c
+++ b/hurd/catch-exc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c
index bb9d8199a1..56ce86532d 100644
--- a/hurd/catch-signal.c
+++ b/hurd/catch-signal.c
@@ -1,5 +1,5 @@
/* Convenience function to catch expected signals during an operation.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
@@ -22,10 +22,10 @@
#include <assert.h>
error_t
-hurd_catch_signal (sigset_t sigset,
- unsigned long int first, unsigned long int last,
- error_t (*operate) (struct hurd_signal_preemptor *),
- sighandler_t handler)
+__hurd_catch_signal (sigset_t sigset,
+ unsigned long int first, unsigned long int last,
+ error_t (*operate) (struct hurd_signal_preemptor *),
+ sighandler_t handler)
{
/* We need to restore the signal mask, because otherwise the
signal-handling code will have blocked the caught signal and for
@@ -73,6 +73,7 @@ hurd_catch_signal (sigset_t sigset,
return error;
}
+strong_alias (__hurd_catch_signal, hurd_catch_signal)
error_t
@@ -83,9 +84,9 @@ hurd_safe_memset (void *dest, int byte, size_t nbytes)
memset (dest, byte, nbytes);
return 0;
}
- return hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
- (vm_address_t) dest, (vm_address_t) dest + nbytes,
- &operate, SIG_ERR);
+ return __hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
+ (vm_address_t) dest, (vm_address_t) dest + nbytes,
+ &operate, SIG_ERR);
}
@@ -97,9 +98,9 @@ hurd_safe_copyout (void *dest, const void *src, size_t nbytes)
memcpy (dest, src, nbytes);
return 0;
}
- return hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
- (vm_address_t) dest, (vm_address_t) dest + nbytes,
- &operate, SIG_ERR);
+ return __hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
+ (vm_address_t) dest, (vm_address_t) dest + nbytes,
+ &operate, SIG_ERR);
}
error_t
@@ -110,9 +111,9 @@ hurd_safe_copyin (void *dest, const void *src, size_t nbytes)
memcpy (dest, src, nbytes);
return 0;
}
- return hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
- (vm_address_t) src, (vm_address_t) src + nbytes,
- &operate, SIG_ERR);
+ return __hurd_catch_signal (sigmask (SIGBUS) | sigmask (SIGSEGV),
+ (vm_address_t) src, (vm_address_t) src + nbytes,
+ &operate, SIG_ERR);
}
error_t
diff --git a/hurd/compat-20.c b/hurd/compat-20.c
index bb5ca7e098..86401819d1 100644
--- a/hurd/compat-20.c
+++ b/hurd/compat-20.c
@@ -1,5 +1,5 @@
/* Old-versioned functions for binary compatibility with glibc-2.0.
- Copyright (C) 1998-2016 Free Software Foundation, Inc.
+ Copyright (C) 1998-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
diff --git a/hurd/ctty-input.c b/hurd/ctty-input.c
index b17e43750f..de4cb950e8 100644
--- a/hurd/ctty-input.c
+++ b/hurd/ctty-input.c
@@ -1,5 +1,5 @@
/* _hurd_ctty_input -- Do an input RPC and generate SIGTTIN if necessary.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/ctty-output.c b/hurd/ctty-output.c
index 0cbe2e09ef..dc9bba8af1 100644
--- a/hurd/ctty-output.c
+++ b/hurd/ctty-output.c
@@ -1,5 +1,5 @@
/* _hurd_ctty_output -- Do an output RPC and generate SIGTTOU if necessary.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/dtable.c b/hurd/dtable.c
index 73e60280ef..c36d60fc86 100644
--- a/hurd/dtable.c
+++ b/hurd/dtable.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/exc2signal.c b/hurd/exc2signal.c
index 2027630d56..1537e8d86a 100644
--- a/hurd/exc2signal.c
+++ b/hurd/exc2signal.c
@@ -1,5 +1,5 @@
/* Translate Mach exception codes into signal numbers. Stub version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
@@ -81,6 +81,7 @@ _hurd_exception2signal (struct hurd_signal_detail *detail, int *signo)
{
exception2signal (detail, signo, 1);
}
+libc_hidden_def (_hurd_exception2signal)
void
_hurd_exception2signal_legacy (struct hurd_signal_detail *detail, int *signo)
diff --git a/hurd/fchroot.c b/hurd/fchroot.c
index 9027919e3f..ea97a1b388 100644
--- a/hurd/fchroot.c
+++ b/hurd/fchroot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-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
diff --git a/hurd/fcntl-internal.h b/hurd/fcntl-internal.h
index f7c74b27ce..d795e4089c 100644
--- a/hurd/fcntl-internal.h
+++ b/hurd/fcntl-internal.h
@@ -19,16 +19,19 @@
#include <fcntl.h>
#include <sys/socket.h>
-#include <verify.h>
/* Do some compile-time checks for the SOCK_* constants, which we rely on. */
-verify (SOCK_CLOEXEC == O_CLOEXEC);
-verify ((SOCK_MAX | SOCK_TYPE_MASK) == SOCK_TYPE_MASK);
-verify ((SOCK_CLOEXEC & SOCK_TYPE_MASK) == 0);
-verify ((SOCK_NONBLOCK & SOCK_TYPE_MASK) == 0);
+_Static_assert (SOCK_CLOEXEC == O_CLOEXEC,
+ "SOCK_CLOEXEC is assumed to be the same as O_CLOEXEC");
+_Static_assert (((SOCK_MAX - 1) | SOCK_TYPE_MASK) == SOCK_TYPE_MASK,
+ "SOCK_TYPE_MASK must contain SOCK_MAX - 1");
+_Static_assert ((SOCK_CLOEXEC & SOCK_TYPE_MASK) == 0,
+ "SOCK_TYPE_MASK must not contain SOCK_CLOEXEC");
+_Static_assert ((SOCK_NONBLOCK & SOCK_TYPE_MASK) == 0,
+ "SOCK_TYPE_MASK must not contain SOCK_NONBLOCK");
-/* Convert from SOCK_* flags to O_* flags */
+/* Convert from SOCK_* flags to O_* flags. */
__extern_always_inline
int
sock_to_o_flags (int in)
@@ -43,7 +46,7 @@ sock_to_o_flags (int in)
return out;
}
-/* Convert from O_* flags to SOCK_* flags */
+/* Convert from O_* flags to SOCK_* flags. */
__extern_always_inline
int
o_to_sock_flags (int in)
diff --git a/hurd/fd-close.c b/hurd/fd-close.c
index f1e067f15a..d5bd0ffbc2 100644
--- a/hurd/fd-close.c
+++ b/hurd/fd-close.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/fd-read.c b/hurd/fd-read.c
index b4a6d983da..ba3fce818b 100644
--- a/hurd/fd-read.c
+++ b/hurd/fd-read.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/fd-write.c b/hurd/fd-write.c
index 45123d42f5..699f23d7e6 100644
--- a/hurd/fd-write.c
+++ b/hurd/fd-write.c
@@ -1,5 +1,5 @@
/* _hurd_fd_write -- write to a file descriptor; handles job control et al.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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
diff --git a/hurd/fopenport.c b/hurd/fopenport.c
index e0ab908dba..edb12b83f4 100644
--- a/hurd/fopenport.c
+++ b/hurd/fopenport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -62,7 +62,7 @@ writeio (void *cookie, const char *buf, size_t n)
Returns zero if successful, nonzero if not. */
static int
seekio (void *cookie,
- _IO_off64_t *pos,
+ off64_t *pos,
int whence)
{
error_t err = __io_seek ((file_t) cookie, *pos, whence, pos);
diff --git a/hurd/get-host.c b/hurd/get-host.c
index a76ba5c095..2001fc5a86 100644
--- a/hurd/get-host.c
+++ b/hurd/get-host.c
@@ -1,5 +1,5 @@
/* Get a host configuration item kept as the whole contents of a file.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
@@ -65,7 +65,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
}
/* If the file is empty, give an empty value. */
- if (nread == 0)
+ if (nread == 0 && more == 0)
{
if (buflen != 0)
*buf = '\0';
@@ -80,7 +80,7 @@ _hurd_get_host_config (const char *item, char *buf, size_t buflen)
if (nread < buflen)
buf[nread] = '\0';
else
- if (buf[nread - 1] != '\0')
+ if (nread != 0 && buf[nread - 1] != '\0')
more = 1;
if (more)
diff --git a/hurd/getdport.c b/hurd/getdport.c
index 53e5a66502..337c6a47ba 100644
--- a/hurd/getdport.c
+++ b/hurd/getdport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/hurd/geteuids.c b/hurd/geteuids.c
index 18cf7d2af1..bf8d576238 100644
--- a/hurd/geteuids.c
+++ b/hurd/geteuids.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/getumask.c b/hurd/getumask.c
index 2816115212..5d68662e51 100644
--- a/hurd/getumask.c
+++ b/hurd/getumask.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
diff --git a/hurd/hurd-raise.c b/hurd/hurd-raise.c
index 64909c03bd..9fe5541311 100644
--- a/hurd/hurd-raise.c
+++ b/hurd/hurd-raise.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -48,3 +48,4 @@ _hurd_raise_signal (struct hurd_sigstate *ss,
other thread. */
return __msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
}
+libc_hidden_def (_hurd_raise_signal)
diff --git a/hurd/hurd.h b/hurd/hurd.h
index 19110a298b..d3c868928b 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
@@ -41,6 +41,8 @@
#include <hurd/port.h>
#include <errno.h>
+#include <bits/types/error_t.h>
+#include <bits/types/sigset_t.h>
#ifndef _HURD_H_EXTERN_INLINE
#define _HURD_H_EXTERN_INLINE __extern_inline
@@ -145,8 +147,7 @@ extern struct mutex _hurd_brk_lock;
extern int _hurd_set_brk (vm_address_t newbrk);
-#define __need_FILE
-#include <stdio.h>
+#include <bits/types/FILE.h>
/* Calls to get and set basic ports. */
@@ -245,12 +246,21 @@ extern FILE *fopenport (io_t port, const char *mode);
extern FILE *__fopenport (io_t port, const char *mode);
-/* Execute a file, replacing TASK's current program image. */
+/* Deprecated: use _hurd_exec_paths instead. */
extern error_t _hurd_exec (task_t task,
file_t file,
char *const argv[],
- char *const envp[]);
+ char *const envp[]) __attribute_deprecated__;
+
+/* Execute a file, replacing TASK's current program image. */
+
+extern error_t _hurd_exec_paths (task_t task,
+ file_t file,
+ const char *path,
+ const char *abspath,
+ char *const argv[],
+ char *const envp[]);
/* Inform the proc server we have exited with STATUS, and kill the
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index bd6001b310..af5fdcf759 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -1,5 +1,5 @@
/* File descriptors.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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
@@ -26,7 +26,9 @@
#include <hurd/hurd_types.h>
#include <hurd/port.h>
#include <sys/socket.h>
+#include <sys/select.h>
#include <fcntl.h>
+#include <bits/types/sigset_t.h>
/* Structure representing a file descriptor. */
@@ -62,7 +64,7 @@ extern struct mutex _hurd_dtable_lock; /* Locks those two variables. */
extern struct hurd_fd *_hurd_fd_get (int fd);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_FD_H_EXTERN_INLINE struct hurd_fd *
_hurd_fd_get (int fd)
{
@@ -95,7 +97,7 @@ _hurd_fd_get (int fd)
return descriptor;
}
-# endif
+# endif
#endif
@@ -140,6 +142,7 @@ _hurd_fd_get (int fd)
__result; })
#include <errno.h>
+#include <bits/types/error_t.h>
/* Check if ERR should generate a signal.
Returns the signal to take, or zero if none. */
@@ -179,7 +182,7 @@ _hurd_fd_error (int fd, error_t err)
if (signo)
{
const struct hurd_signal_detail detail
- = { code: fd, error: err, exc: 0 };
+ = { exc: 0, exc_code: 0, exc_subcode: 0, code: fd, error: err };
_hurd_raise_signal (NULL, signo, &detail);
}
return err;
@@ -252,9 +255,9 @@ extern error_t _hurd_fd_close (struct hurd_fd *fd);
If successful, stores the amount actually read or written in *NBYTES. */
extern error_t _hurd_fd_read (struct hurd_fd *fd,
- void *buf, size_t *nbytes, loff_t offset);
+ void *buf, size_t *nbytes, __loff_t offset);
extern error_t _hurd_fd_write (struct hurd_fd *fd,
- const void *buf, size_t *nbytes, loff_t offset);
+ const void *buf, size_t *nbytes, __loff_t offset);
/* Call *RPC on PORT and/or CTTY; if a call on CTTY returns EBACKGROUND,
@@ -281,7 +284,7 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds,
__hurd_file_name_lookup. */
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_FD_H_EXTERN_INLINE error_t
__hurd_at_flags (int *at_flags, int *flags)
{
@@ -298,7 +301,7 @@ __hurd_at_flags (int *at_flags, int *flags)
return 0;
}
-# endif
+# endif
#endif
/* Variant of file_name_lookup used in *at function implementations.
diff --git a/hurd/hurd/id.h b/hurd/hurd/id.h
index 4093c57ed0..38988bfe72 100644
--- a/hurd/hurd/id.h
+++ b/hurd/hurd/id.h
@@ -1,5 +1,5 @@
/* User and group IDs.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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
@@ -20,6 +20,9 @@
#define _HURD_ID_H 1
#include <features.h>
+#include <hurd/hurd_types.h>
+#include <errno.h>
+#include <bits/types/error_t.h>
#include <cthreads.h> /* For `struct mutex'. */
diff --git a/hurd/hurd/ioctl.h b/hurd/hurd/ioctl.h
index ae7fdf1257..ae74898255 100644
--- a/hurd/hurd/ioctl.h
+++ b/hurd/hurd/ioctl.h
@@ -1,5 +1,5 @@
/* User-registered handlers for specific `ioctl' requests.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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
@@ -22,6 +22,7 @@
#define __need___va_list
#include <stdarg.h>
#include <bits/ioctls.h>
+#include <mach/port.h>
/* Type of handler function, called like ioctl to do its entire job. */
diff --git a/hurd/hurd/lookup.h b/hurd/hurd/lookup.h
index da7f48a6b6..d0fa87b3d6 100644
--- a/hurd/hurd/lookup.h
+++ b/hurd/hurd/lookup.h
@@ -1,5 +1,5 @@
/* Declarations of file name translation functions for the GNU Hurd.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
@@ -19,6 +19,10 @@
#ifndef _HURD_LOOKUP_H
#define _HURD_LOOKUP_H 1
+#include <errno.h>
+#include <bits/types/error_t.h>
+#include <hurd/hurd_types.h>
+
/* These functions all take two callback functions as the first two arguments.
The first callback function USE_INIT_PORT is called as follows:
@@ -48,7 +52,7 @@ error_t __hurd_file_name_lookup (error_t (*use_init_port)
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
+ (file_t dir, const char *name, int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
const char *file_name,
@@ -59,7 +63,7 @@ error_t hurd_file_name_lookup (error_t (*use_init_port)
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
+ (file_t dir, const char *name, int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
const char *file_name,
@@ -75,7 +79,7 @@ error_t __hurd_file_name_split (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
- error_t (*lookup) (file_t dir, char *name,
+ error_t (*lookup) (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
@@ -85,7 +89,7 @@ error_t hurd_file_name_split (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
- error_t (*lookup) (file_t dir, char *name,
+ error_t (*lookup) (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
@@ -99,7 +103,7 @@ error_t __hurd_directory_name_split (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
- error_t (*lookup) (file_t dir, char *name,
+ error_t (*lookup) (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
@@ -109,7 +113,7 @@ error_t hurd_directory_name_split (error_t (*use_init_port)
(int which,
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
- error_t (*lookup) (file_t dir, char *name,
+ error_t (*lookup) (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
@@ -128,7 +132,7 @@ error_t __hurd_file_name_lookup_retry (error_t (*use_init_port)
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name,
+ (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry,
string_t retry_name,
@@ -142,7 +146,7 @@ error_t hurd_file_name_lookup_retry (error_t (*use_init_port)
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name,
+ (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry,
string_t retry_name,
@@ -178,7 +182,7 @@ error_t hurd_file_name_path_lookup (error_t (*use_init_port)
error_t (*operate) (mach_port_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name,
+ (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry,
string_t retry_name,
diff --git a/hurd/hurd/port.h b/hurd/hurd/port.h
index c82fa4f04c..0779578d03 100644
--- a/hurd/hurd/port.h
+++ b/hurd/hurd/port.h
@@ -1,5 +1,5 @@
/* Lightweight user references for ports.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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,6 @@
#include <mach.h>
#include <hurd/userlink.h>
#include <spin-lock.h>
-#include <hurd/signal.h>
/* Structure describing a cell containing a port. With the lock held, a
@@ -63,7 +62,7 @@ struct hurd_port
extern void _hurd_port_init (struct hurd_port *port, mach_port_t init);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_init (struct hurd_port *port, mach_port_t init)
{
@@ -71,7 +70,7 @@ _hurd_port_init (struct hurd_port *port, mach_port_t init)
port->users = NULL;
port->port = init;
}
-# endif
+# endif
#endif
@@ -86,7 +85,7 @@ _hurd_port_locked_get (struct hurd_port *port,
struct hurd_userlink *link);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE mach_port_t
_hurd_port_locked_get (struct hurd_port *port,
struct hurd_userlink *link)
@@ -102,7 +101,7 @@ _hurd_port_locked_get (struct hurd_port *port,
__spin_unlock (&port->lock);
return result;
}
-# endif
+# endif
#endif
/* Same, but locks PORT first. */
@@ -112,7 +111,7 @@ _hurd_port_get (struct hurd_port *port,
struct hurd_userlink *link);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE mach_port_t
_hurd_port_get (struct hurd_port *port,
struct hurd_userlink *link)
@@ -124,7 +123,7 @@ _hurd_port_get (struct hurd_port *port,
HURD_CRITICAL_END;
return result;
}
-# endif
+# endif
#endif
@@ -136,7 +135,7 @@ _hurd_port_free (struct hurd_port *port,
mach_port_t used_port);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_free (struct hurd_port *port,
struct hurd_userlink *link,
@@ -156,7 +155,7 @@ _hurd_port_free (struct hurd_port *port,
if (dealloc)
__mach_port_deallocate (__mach_task_self (), used_port);
}
-# endif
+# endif
#endif
@@ -166,7 +165,7 @@ _hurd_port_free (struct hurd_port *port,
extern void _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_locked_set (struct hurd_port *port, mach_port_t newport)
{
@@ -177,7 +176,7 @@ _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport)
if (old != MACH_PORT_NULL)
__mach_port_deallocate (__mach_task_self (), old);
}
-# endif
+# endif
#endif
/* Same, but locks PORT first. */
@@ -185,7 +184,7 @@ _hurd_port_locked_set (struct hurd_port *port, mach_port_t newport)
extern void _hurd_port_set (struct hurd_port *port, mach_port_t newport);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_PORT_H_EXTERN_INLINE void
_hurd_port_set (struct hurd_port *port, mach_port_t newport)
{
@@ -194,7 +193,7 @@ _hurd_port_set (struct hurd_port *port, mach_port_t newport)
_hurd_port_locked_set (port, newport);
HURD_CRITICAL_END;
}
-# endif
+# endif
#endif
diff --git a/hurd/hurd/resource.h b/hurd/hurd/resource.h
index c52ee36cd5..eb93110799 100644
--- a/hurd/hurd/resource.h
+++ b/hurd/hurd/resource.h
@@ -1,5 +1,5 @@
/* Resource limits for the Hurd.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/resource.h>
#include <errno.h>
+#include <bits/types/error_t.h>
#include <hurd/process.h>
/* This array contains the current resource limits for the process. */
diff --git a/hurd/hurd/signal.h b/hurd/hurd/signal.h
index 971342c375..0acffc5bc3 100644
--- a/hurd/hurd/signal.h
+++ b/hurd/hurd/signal.h
@@ -1,5 +1,5 @@
/* Implementing POSIX.1 signals under the Hurd.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-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
@@ -20,10 +20,6 @@
#define _HURD_SIGNAL_H 1
#include <features.h>
-/* Make sure <signal.h> is going to define NSIG. */
-#ifndef __USE_GNU
-#error "Must have `_GNU_SOURCE' feature test macro to use this file"
-#endif
#define __need_size_t
#define __need_NULL
@@ -35,12 +31,21 @@
#include <hurd/hurd_types.h>
#include <signal.h>
#include <errno.h>
+#include <bits/types/error_t.h>
+#include <bits/types/stack_t.h>
+#include <bits/types/sigset_t.h>
+#include <bits/sigaction.h>
#include <hurd/msg.h>
#include <cthreads.h> /* For `struct mutex'. */
#include <setjmp.h> /* For `jmp_buf'. */
#include <spin-lock.h>
struct hurd_signal_preemptor; /* <hurd/sigpreempt.h> */
+#if defined __USE_EXTERN_INLINES && defined _LIBC
+# if IS_IN (libc) || IS_IN (libpthread)
+# include <sigsetops.h>
+# endif
+#endif
/* Full details of a signal. */
@@ -75,9 +80,9 @@ struct hurd_sigstate
semantics: if sa_handler is SIG_IGN instead of SIG_DFL, this thread
will receive global signals and use the process-wide action vector
instead of this one. */
- struct sigaction actions[NSIG];
+ struct sigaction actions[_NSIG];
- struct sigaltstack sigaltstack;
+ stack_t sigaltstack;
/* Chain of thread-local signal preemptors; see <hurd/sigpreempt.h>.
Each element of this chain is in local stack storage, and the chain
@@ -86,7 +91,7 @@ struct hurd_sigstate
struct hurd_signal_preemptor *preemptors;
/* For each signal that may be pending, the details to deliver it with. */
- struct hurd_signal_detail pending_data[NSIG];
+ struct hurd_signal_detail pending_data[_NSIG];
/* If `suspended' is set when this thread gets a signal,
the signal thread sends an empty message to it. */
@@ -159,7 +164,7 @@ extern void _hurd_sigstate_delete (thread_t thread);
#endif
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
_hurd_self_sigstate (void)
{
@@ -172,7 +177,7 @@ _hurd_self_sigstate (void)
}
return *location;
}
-# endif
+# endif
#endif
/* Thread listening on our message port; also called the "signal thread". */
@@ -197,7 +202,7 @@ extern int _hurd_core_limit;
extern void *_hurd_critical_section_lock (void);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_SIGNAL_H_EXTERN_INLINE void *
_hurd_critical_section_lock (void)
{
@@ -233,13 +238,13 @@ _hurd_critical_section_lock (void)
_hurd_critical_section_unlock to unlock it. */
return ss;
}
-# endif
+# endif
#endif
extern void _hurd_critical_section_unlock (void *our_lock);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_SIGNAL_H_EXTERN_INLINE void
_hurd_critical_section_unlock (void *our_lock)
{
@@ -262,7 +267,7 @@ _hurd_critical_section_unlock (void *our_lock)
__msg_sig_post (_hurd_msgport, 0, 0, __mach_task_self ());
}
}
-# endif
+# endif
#endif
/* Convenient macros for simple uses of critical sections.
diff --git a/hurd/hurd/sigpreempt.h b/hurd/hurd/sigpreempt.h
index 75dcd59e00..51b422c512 100644
--- a/hurd/hurd/sigpreempt.h
+++ b/hurd/hurd/sigpreempt.h
@@ -1,5 +1,5 @@
/* Preemption of Hurd signals before POSIX.1 semantics take over.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
@@ -19,8 +19,12 @@
#ifndef _HURD_SIGPREEMPT_H
#define _HURD_SIGPREEMPT_H 1
+#define __need_size_t
+#include <stddef.h>
#include <errno.h>
-#include <signal.h> /* For sigset_t, sighandler_t, SIG_ERR. */
+#include <bits/types/error_t.h>
+#include <signal.h> /* For sighandler_t, SIG_ERR. */
+#include <bits/types/sigset_t.h>
struct hurd_sigstate; /* <hurd/signal.h> */
struct hurd_signal_detail; /* <hurd/signal.h> */
@@ -37,11 +41,11 @@ struct hurd_signal_preemptor
is tried, or the normal handling is done for the signal (which may
have been changed by the preemptor function). Otherwise, the signal
is processed as if the return value were its handler setting. */
- sighandler_t (*preemptor) (struct hurd_signal_preemptor *preemptor,
- struct hurd_sigstate *ss,
- int *signo, struct hurd_signal_detail *detail);
+ __sighandler_t (*preemptor) (struct hurd_signal_preemptor *preemptor,
+ struct hurd_sigstate *ss,
+ int *signo, struct hurd_signal_detail *detail);
/* If PREEMPTOR is null, act as if it returned HANDLER. */
- sighandler_t handler;
+ __sighandler_t handler;
struct hurd_signal_preemptor *next; /* List structure. */
};
@@ -78,7 +82,7 @@ void hurd_unpreempt_signals (struct hurd_signal_preemptor *preemptor);
error_t hurd_catch_signal (sigset_t sigset,
unsigned long int first, unsigned long int last,
error_t (*operate) (struct hurd_signal_preemptor *),
- sighandler_t handler);
+ __sighandler_t handler);
/* Convenience functions using `hurd_catch_signal'. */
diff --git a/hurd/hurd/threadvar.h b/hurd/hurd/threadvar.h
index ff43598d2c..c61e3bb9d9 100644
--- a/hurd/hurd/threadvar.h
+++ b/hurd/hurd/threadvar.h
@@ -1,5 +1,5 @@
/* Internal per-thread variables for the Hurd.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
@@ -29,13 +29,11 @@
extern unsigned long int __hurd_sigthread_stack_base;
extern unsigned long int __hurd_sigthread_stack_end;
-
-/* We do not use threadvars any more, this is kept as zero for compatibility with cthreads */
-extern unsigned long int __hurd_threadvar_stack_mask;
-extern unsigned long int __hurd_threadvar_stack_offset;
-extern unsigned int __hurd_threadvar_max;
-
+/* Store the MiG reply port reply port until we enable TLS. */
extern mach_port_t __hurd_reply_port0;
-#define __hurd_local_reply_port (*(__LIBC_NO_TLS() ? &__hurd_reply_port0 : &THREAD_SELF->reply_port))
+
+/* This returns either the TLS reply port variable, or a single-thread variable
+ when TLS is not initialized yet. */
+#define __hurd_local_reply_port (*(__LIBC_NO_TLS () ? &__hurd_reply_port0 : &THREAD_SELF->reply_port))
#endif /* hurd/threadvar.h */
diff --git a/hurd/hurd/userlink.h b/hurd/hurd/userlink.h
index 128ce59726..f9362557cb 100644
--- a/hurd/hurd/userlink.h
+++ b/hurd/hurd/userlink.h
@@ -1,5 +1,5 @@
/* Support for chains recording users of a resource; `struct hurd_userlink'.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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,11 @@
#define __need_NULL
#include <stddef.h>
-#include <hurd/signal.h>
+#if defined __USE_EXTERN_INLINES && defined _LIBC
+# if IS_IN (libc)
+# include <hurd/signal.h>
+# endif
+#endif
#include <setjmp.h>
@@ -81,7 +85,7 @@ _hurd_userlink_link (struct hurd_userlink **chainp,
struct hurd_userlink *link);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_USERLINK_H_EXTERN_INLINE void
_hurd_userlink_link (struct hurd_userlink **chainp,
struct hurd_userlink *link)
@@ -102,7 +106,7 @@ _hurd_userlink_link (struct hurd_userlink **chainp,
link->thread.prevp = thread_chainp;
*thread_chainp = link;
}
-# endif
+# endif
#endif
@@ -112,7 +116,7 @@ _hurd_userlink_link (struct hurd_userlink **chainp,
extern int _hurd_userlink_unlink (struct hurd_userlink *link);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_USERLINK_H_EXTERN_INLINE int
_hurd_userlink_unlink (struct hurd_userlink *link)
{
@@ -135,7 +139,7 @@ _hurd_userlink_unlink (struct hurd_userlink *link)
return dealloc;
}
-# endif
+# endif
#endif
@@ -148,7 +152,7 @@ _hurd_userlink_unlink (struct hurd_userlink *link)
extern int _hurd_userlink_clear (struct hurd_userlink **chainp);
#if defined __USE_EXTERN_INLINES && defined _LIBC
-# if IS_IN (libc)
+# if IS_IN (libc)
_HURD_USERLINK_H_EXTERN_INLINE int
_hurd_userlink_clear (struct hurd_userlink **chainp)
{
@@ -161,7 +165,7 @@ _hurd_userlink_clear (struct hurd_userlink **chainp)
*chainp = NULL;
return 0;
}
-# endif
+# endif
#endif
#endif /* hurd/userlink.h */
diff --git a/hurd/hurd/xattr.h b/hurd/hurd/xattr.h
index 69640934dc..e9690831bb 100644
--- a/hurd/hurd/xattr.h
+++ b/hurd/hurd/xattr.h
@@ -1,5 +1,5 @@
/* Access to extended attributes on files for GNU/Hurd.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-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
diff --git a/hurd/hurdauth.c b/hurd/hurdauth.c
index 695e3abbbb..c61af64a53 100644
--- a/hurd/hurdauth.c
+++ b/hurd/hurdauth.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -52,8 +52,8 @@ _S_msg_add_auth (mach_port_t me,
int i, j, k;
vm_size_t offset;
- urp = vm_allocate (mach_task_self (), (vm_address_t *) newlistp,
- nexist + nnew * sizeof (uid_t), 1);
+ urp = __vm_allocate (mach_task_self (), (vm_address_t *) newlistp,
+ nexist + nnew * sizeof (uid_t), 1);
if (urp)
return urp;
@@ -75,10 +75,10 @@ _S_msg_add_auth (mach_port_t me,
offset = (round_page (nexist + nnew * sizeof (uid_t))
- round_page (j * sizeof (uid_t)));
if (offset)
- vm_deallocate (mach_task_self (),
- (vm_address_t) (*newlistp
- + (nexist + nnew * sizeof (uid_t))),
- offset);
+ __vm_deallocate (mach_task_self (),
+ (vm_address_t) (*newlistp
+ + (nexist + nnew * sizeof (uid_t))),
+ offset);
*newlistlen = j;
return 0;
}
@@ -136,8 +136,8 @@ _S_msg_add_auth (mach_port_t me,
#define freeup(array, len) \
if (array) \
- vm_deallocate (mach_task_self (), (vm_address_t) array, \
- len * sizeof (uid_t));
+ __vm_deallocate (mach_task_self (), (vm_address_t) array, \
+ len * sizeof (uid_t));
freeup (genuids, ngenuids);
freeup (auxuids, nauxuids);
diff --git a/hurd/hurdchdir.c b/hurd/hurdchdir.c
index 373df2745b..1adc9895e3 100644
--- a/hurd/hurdchdir.c
+++ b/hurd/hurdchdir.c
@@ -1,5 +1,5 @@
/* Change a port cell to a directory by looking up a name.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-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
diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c
index 7f1df34101..99f0488e0c 100644
--- a/hurd/hurdexec.c
+++ b/hurd/hurdexec.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -30,11 +30,30 @@
/* Overlay TASK, executing FILE with arguments ARGV and environment ENVP.
If TASK == mach_task_self (), some ports are dealloc'd by the exec server.
- ARGV and ENVP are terminated by NULL pointers. */
+ ARGV and ENVP are terminated by NULL pointers.
+ Deprecated: use _hurd_exec_paths instead. */
error_t
_hurd_exec (task_t task, file_t file,
char *const argv[], char *const envp[])
{
+ return _hurd_exec_paths (task, file, NULL, NULL, argv, envp);
+}
+
+link_warning (_hurd_exec,
+ "_hurd_exec is deprecated, use _hurd_exec_paths instead");
+
+/* Overlay TASK, executing FILE with arguments ARGV and environment ENVP.
+ If TASK == mach_task_self (), some ports are dealloc'd by the exec server.
+ ARGV and ENVP are terminated by NULL pointers. PATH is the relative path to
+ FILE and ABSPATH is the absolute path to FILE. Passing NULL, though possible,
+ should be avoided, since then the exec server may not know the path to
+ FILE if FILE is a script, and will then pass /dev/fd/N to the
+ interpreter. */
+error_t
+_hurd_exec_paths (task_t task, file_t file,
+ const char *path, const char *abspath,
+ char *const argv[], char *const envp[])
+{
error_t err;
char *args, *env;
size_t argslen, envlen;
@@ -216,7 +235,7 @@ _hurd_exec (task_t task, file_t file,
/* We have euid != svuid or egid != svgid. POSIX.1 says that exec
sets svuid = euid and svgid = egid. So we must get a new auth
port and reauthenticate everything with it. We'll pass the new
- ports in file_exec instead of our own ports. */
+ ports in file_exec_paths instead of our own ports. */
auth_t newauth;
@@ -360,13 +379,28 @@ _hurd_exec (task_t task, file_t file,
if (__sigismember (&_hurdsig_traced, SIGKILL))
flags |= EXEC_SIGTRAP;
#endif
- err = __file_exec (file, task, flags,
- args, argslen, env, envlen,
- dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
- ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
- ints, INIT_INT_MAX,
- please_dealloc, pdp - please_dealloc,
- &_hurd_msgport, task == __mach_task_self () ? 1 : 0);
+ err = __file_exec_paths (file, task, flags,
+ path ? path : "",
+ abspath ? abspath : "",
+ args, argslen, env, envlen,
+ dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+ ports, MACH_MSG_TYPE_COPY_SEND,
+ _hurd_nports,
+ ints, INIT_INT_MAX,
+ please_dealloc, pdp - please_dealloc,
+ &_hurd_msgport,
+ task == __mach_task_self () ? 1 : 0);
+ /* Fall back for backwards compatibility. This can just be removed
+ when __file_exec goes away. */
+ if (err == MIG_BAD_ID)
+ err = __file_exec (file, task, flags,
+ args, argslen, env, envlen,
+ dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+ ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
+ ints, INIT_INT_MAX,
+ please_dealloc, pdp - please_dealloc,
+ &_hurd_msgport,
+ task == __mach_task_self () ? 1 : 0);
}
/* Release references to the standard ports. */
@@ -402,3 +436,4 @@ _hurd_exec (task_t task, file_t file,
free (env);
return err;
}
+libc_hidden_def (_hurd_exec_paths)
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
index 1618692231..e9a9a4f9cc 100644
--- a/hurd/hurdfault.c
+++ b/hurd/hurdfault.c
@@ -1,5 +1,5 @@
/* Handle faults in the signal thread.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
@@ -204,7 +204,6 @@ _hurdsig_fault_init (void)
/* This state will be restored when we fault.
It runs the function above. */
memset (&state, 0, sizeof state);
-
MACHINE_THREAD_STATE_FIX_NEW (&state);
MACHINE_THREAD_STATE_SET_PC (&state, faulted);
MACHINE_THREAD_STATE_SET_SP (&state, faultstack, sizeof faultstack);
diff --git a/hurd/hurdfault.h b/hurd/hurdfault.h
index 075955bde0..04ae3903c3 100644
--- a/hurd/hurdfault.h
+++ b/hurd/hurdfault.h
@@ -1,5 +1,5 @@
/* Declarations for handling faults in the signal thread.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
diff --git a/hurd/hurdfchdir.c b/hurd/hurdfchdir.c
index 027da108c5..3759e3c734 100644
--- a/hurd/hurdfchdir.c
+++ b/hurd/hurdfchdir.c
@@ -1,5 +1,5 @@
/* Change a port cell to a directory in an open file descriptor.
- Copyright (C) 1999-2016 Free Software Foundation, Inc.
+ Copyright (C) 1999-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
diff --git a/hurd/hurdhost.h b/hurd/hurdhost.h
index 4e3ac33cbc..f2b3e68331 100644
--- a/hurd/hurdhost.h
+++ b/hurd/hurdhost.h
@@ -1,5 +1,5 @@
/* Host configuration items kept as the whole contents of a file.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
diff --git a/hurd/hurdid.c b/hurd/hurdid.c
index 97c4d06f9b..71b50df1eb 100644
--- a/hurd/hurdid.c
+++ b/hurd/hurdid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c
index a310404f68..9d654f0d1e 100644
--- a/hurd/hurdinit.c
+++ b/hurd/hurdinit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
@@ -110,6 +110,7 @@ _hurd_init (int flags, char **argv,
assume the availability of the POSIX.1 services we provide. */
RUN_HOOK (_hurd_subinit, ());
}
+libc_hidden_def (_hurd_init)
#include <hurd/signal.h>
diff --git a/hurd/hurdioctl.c b/hurd/hurdioctl.c
index c36dd613cf..c40fa9ea2b 100644
--- a/hurd/hurdioctl.c
+++ b/hurd/hurdioctl.c
@@ -1,5 +1,5 @@
/* ioctl commands which must be done in the C library.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
diff --git a/hurd/hurdkill.c b/hurd/hurdkill.c
index 2ae96312d0..d1e28df5aa 100644
--- a/hurd/hurdkill.c
+++ b/hurd/hurdkill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/hurdlock.c b/hurd/hurdlock.c
index d498e8a170..382e9f2aa9 100644
--- a/hurd/hurdlock.c
+++ b/hurd/hurdlock.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Hurd helpers for lowlevellocks.
+ Copyright (C) 1999-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
@@ -17,11 +18,13 @@
#include "hurdlock.h"
#include <hurd.h>
+#include <hurd/hurd.h>
#include <time.h>
#include <errno.h>
+#include <unistd.h>
/* Convert an absolute timeout in nanoseconds to a relative
- * timeout in milliseconds. */
+ timeout in milliseconds. */
static inline int __attribute__ ((gnu_inline))
compute_reltime (const struct timespec *abstime, clockid_t clk)
{
@@ -37,68 +40,67 @@ compute_reltime (const struct timespec *abstime, clockid_t clk)
ts.tv_nsec += 1000000000;
}
- return (ts.tv_sec < 0 ? -1 :
- (int)(ts.tv_sec * 1000 + ts.tv_nsec / 1000000));
+ return ts.tv_sec < 0 ? -1 : (int)(ts.tv_sec * 1000 + ts.tv_nsec / 1000000);
}
-int __lll_abstimed_wait (void *ptr, int val,
+int
+__lll_abstimed_wait (void *ptr, int val,
const struct timespec *tsp, int flags, int clk)
{
int mlsec = compute_reltime (tsp, clk);
- return (mlsec < 0 ? KERN_TIMEDOUT :
- lll_timed_wait (ptr, val, mlsec, flags));
+ return mlsec < 0 ? KERN_TIMEDOUT : lll_timed_wait (ptr, val, mlsec, flags);
}
-int __lll_abstimed_xwait (void *ptr, int lo, int hi,
+int
+__lll_abstimed_xwait (void *ptr, int lo, int hi,
const struct timespec *tsp, int flags, int clk)
{
int mlsec = compute_reltime (tsp, clk);
- return (mlsec < 0 ? KERN_TIMEDOUT :
- lll_timed_xwait (ptr, lo, hi, mlsec, flags));
+ return mlsec < 0 ? KERN_TIMEDOUT : lll_timed_xwait (ptr, lo, hi, mlsec,
+ flags);
}
-int __lll_abstimed_lock (void *ptr,
+int
+__lll_abstimed_lock (void *ptr,
const struct timespec *tsp, int flags, int clk)
{
if (lll_trylock (ptr) == 0)
- return (0);
+ return 0;
while (1)
{
if (atomic_exchange_acq ((int *)ptr, 2) == 0)
- return (0);
+ return 0;
else if (tsp->tv_nsec < 0 || tsp->tv_nsec >= 1000000000)
- return (EINVAL);
+ return EINVAL;
int mlsec = compute_reltime (tsp, clk);
- if (mlsec < 0 || lll_timed_wait (ptr,
- 2, mlsec, flags) == KERN_TIMEDOUT)
- return (ETIMEDOUT);
+ if (mlsec < 0 || lll_timed_wait (ptr, 2, mlsec, flags) == KERN_TIMEDOUT)
+ return ETIMEDOUT;
}
}
-/* Robust locks. */
+/* Robust locks. */
-extern int __getpid (void) __attribute__ ((const));
-extern task_t __pid2task (int);
-
-/* Test if a given process id is still valid. */
-static inline int valid_pid (int pid)
+/* Test if a given process id is still valid. */
+static inline int
+valid_pid (int pid)
{
task_t task = __pid2task (pid);
if (task == MACH_PORT_NULL)
- return (0);
+ return 0;
__mach_port_deallocate (__mach_task_self (), task);
- return (1);
+ return 1;
}
/* Robust locks have currently no support from the kernel; they
- * are simply implemented with periodic polling. When sleeping, the
- * maximum blocking time is determined by this constant. */
+ are simply implemented with periodic polling. When sleeping, the
+ maximum blocking time is determined by this constant. */
#define MAX_WAIT_TIME 1500
-int __lll_robust_lock (void *ptr, int flags)
+int
+__lll_robust_lock (void *ptr, int flags)
{
int *iptr = (int *)ptr;
int id = __getpid ();
@@ -106,14 +108,14 @@ int __lll_robust_lock (void *ptr, int flags)
unsigned int val;
/* Try to set the lock word to our PID if it's clear. Otherwise,
- * mark it as having waiters. */
+ mark it as having waiters. */
while (1)
{
val = *iptr;
if (!val && atomic_compare_and_exchange_bool_acq (iptr, id, 0) == 0)
- return (0);
+ return 0;
else if (atomic_compare_and_exchange_bool_acq (iptr,
- val | LLL_WAITERS, val) == 0)
+ val | LLL_WAITERS, val) == 0)
break;
}
@@ -121,11 +123,11 @@ int __lll_robust_lock (void *ptr, int flags)
{
val = *iptr;
if (!val && atomic_compare_and_exchange_bool_acq (iptr, id, 0) == 0)
- return (0);
+ return 0;
else if (val && !valid_pid (val & LLL_OWNER_MASK))
{
if (atomic_compare_and_exchange_bool_acq (iptr, id, val) == 0)
- return (EOWNERDEAD);
+ return EOWNERDEAD;
}
else
{
@@ -136,7 +138,8 @@ int __lll_robust_lock (void *ptr, int flags)
}
}
-int __lll_robust_abstimed_lock (void *ptr,
+int
+__lll_robust_abstimed_lock (void *ptr,
const struct timespec *tsp, int flags, int clk)
{
int *iptr = (int *)ptr;
@@ -148,7 +151,7 @@ int __lll_robust_abstimed_lock (void *ptr,
{
val = *iptr;
if (!val && atomic_compare_and_exchange_bool_acq (iptr, id, 0) == 0)
- return (0);
+ return 0;
else if (atomic_compare_and_exchange_bool_acq (iptr,
val | LLL_WAITERS, val) == 0)
break;
@@ -158,30 +161,31 @@ int __lll_robust_abstimed_lock (void *ptr,
{
val = *iptr;
if (!val && atomic_compare_and_exchange_bool_acq (iptr, id, 0) == 0)
- return (0);
+ return 0;
else if (val && !valid_pid (val & LLL_OWNER_MASK))
{
if (atomic_compare_and_exchange_bool_acq (iptr, id, val) == 0)
- return (EOWNERDEAD);
+ return EOWNERDEAD;
}
else
{
int mlsec = compute_reltime (tsp, clk);
if (mlsec < 0)
- return (ETIMEDOUT);
+ return ETIMEDOUT;
else if (mlsec > wait_time)
mlsec = wait_time;
int res = lll_timed_wait (iptr, val, mlsec, flags);
if (res == KERN_TIMEDOUT)
- return (ETIMEDOUT);
+ return ETIMEDOUT;
else if (wait_time < MAX_WAIT_TIME)
wait_time <<= 1;
}
}
}
-int __lll_robust_trylock (void *ptr)
+int
+__lll_robust_trylock (void *ptr)
{
int *iptr = (int *)ptr;
int id = __getpid ();
@@ -190,18 +194,19 @@ int __lll_robust_trylock (void *ptr)
if (!val)
{
if (atomic_compare_and_exchange_bool_acq (iptr, id, 0) == 0)
- return (0);
+ return 0;
}
- else if (!valid_pid (val & LLL_OWNER_MASK) &&
- atomic_compare_and_exchange_bool_acq (iptr, id, val) == 0)
- return (EOWNERDEAD);
+ else if (!valid_pid (val & LLL_OWNER_MASK)
+ && atomic_compare_and_exchange_bool_acq (iptr, id, val) == 0)
+ return EOWNERDEAD;
- return (EBUSY);
+ return EBUSY;
}
-void __lll_robust_unlock (void *ptr, int flags)
+void
+__lll_robust_unlock (void *ptr, int flags)
{
- unsigned int val = atomic_load_relaxed((unsigned int *)ptr);
+ unsigned int val = atomic_load_relaxed ((unsigned int *)ptr);
while (1)
{
if (val & LLL_WAITERS)
diff --git a/hurd/hurdlock.h b/hurd/hurdlock.h
index cf49a84af8..4a8f416a1a 100644
--- a/hurd/hurdlock.h
+++ b/hurd/hurdlock.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Low-level lock implementation. High-level Hurd helpers.
+ Copyright (C) 1999-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
@@ -22,75 +23,75 @@
struct timespec;
-/* Flags for robust locks. */
+/* Flags for robust locks. */
#define LLL_WAITERS (1U << 31)
#define LLL_DEAD_OWNER (1U << 30)
#define LLL_OWNER_MASK ~(LLL_WAITERS | LLL_DEAD_OWNER)
/* Wait on 64-bit address PTR, without blocking if its contents
- * are different from the pair <LO, HI>. */
+ are different from the pair <LO, HI>. */
#define lll_xwait(ptr, lo, hi, flags) \
__gsync_wait (__mach_task_self (), \
(vm_offset_t)ptr, lo, hi, 0, flags | GSYNC_QUAD)
-/* Same as 'lll_wait', but only block for MLSEC milliseconds. */
+/* Same as 'lll_wait', but only block for MLSEC milliseconds. */
#define lll_timed_wait(ptr, val, mlsec, flags) \
__gsync_wait (__mach_task_self (), \
(vm_offset_t)ptr, val, 0, mlsec, flags | GSYNC_TIMED)
-/* Same as 'lll_xwait', but only block for MLSEC milliseconds. */
+/* Same as 'lll_xwait', but only block for MLSEC milliseconds. */
#define lll_timed_xwait(ptr, lo, hi, mlsec, flags) \
__gsync_wait (__mach_task_self (), (vm_offset_t)ptr, \
lo, hi, mlsec, flags | GSYNC_TIMED | GSYNC_QUAD)
/* Same as 'lll_wait', but only block until TSP elapses,
- * using clock CLK. */
+ using clock CLK. */
extern int __lll_abstimed_wait (void *__ptr, int __val,
const struct timespec *__tsp, int __flags, int __clk);
/* Same as 'lll_xwait', but only block until TSP elapses,
- * using clock CLK. */
+ using clock CLK. */
extern int __lll_abstimed_xwait (void *__ptr, int __lo, int __hi,
const struct timespec *__tsp, int __flags, int __clk);
/* Same as 'lll_lock', but return with an error if TSP elapses,
- * using clock CLK. */
+ using clock CLK. */
extern int __lll_abstimed_lock (void *__ptr,
const struct timespec *__tsp, int __flags, int __clk);
/* Acquire the lock at PTR, but return with an error if
- * the process containing the owner thread dies. */
+ the process containing the owner thread dies. */
extern int __lll_robust_lock (void *__ptr, int __flags);
/* Same as '__lll_robust_lock', but only block until TSP
- * elapses, using clock CLK. */
+ elapses, using clock CLK. */
extern int __lll_robust_abstimed_lock (void *__ptr,
const struct timespec *__tsp, int __flags, int __clk);
/* Same as '__lll_robust_lock', but return with an error
- * if the lock cannot be acquired without blocking. */
+ if the lock cannot be acquired without blocking. */
extern int __lll_robust_trylock (void *__ptr);
/* Wake one or more threads waiting on address PTR,
- * setting its value to VAL before doing so. */
+ setting its value to VAL before doing so. */
#define lll_set_wake(ptr, val, flags) \
__gsync_wake (__mach_task_self (), \
(vm_offset_t)ptr, val, flags | GSYNC_MUTATE)
-/* Release the robust lock at PTR. */
+/* Release the robust lock at PTR. */
extern void __lll_robust_unlock (void *__ptr, int __flags);
/* Rearrange threads waiting on address SRC to instead wait on
- * DST, waking one of them if WAIT_ONE is non-zero. */
+ DST, waking one of them if WAIT_ONE is non-zero. */
#define lll_requeue(src, dst, wake_one, flags) \
__gsync_requeue (__mach_task_self (), (vm_offset_t)src, \
(vm_offset_t)dst, (boolean_t)wake_one, flags)
/* The following are hacks that allow us to simulate optional
- * parameters in C, to avoid having to pass the clock id for
- * every one of these calls, defaulting to CLOCK_REALTIME if
- * no argument is passed. */
+ parameters in C, to avoid having to pass the clock id for
+ every one of these calls, defaulting to CLOCK_REALTIME if
+ no argument is passed. */
#define lll_abstimed_wait(ptr, val, tsp, flags, ...) \
({ \
@@ -120,4 +121,5 @@ extern void __lll_robust_unlock (void *__ptr, int __flags);
__clk[sizeof (__clk) / sizeof (__clk[0]) - 1]); \
})
+
#endif
diff --git a/hurd/hurdlookup.c b/hurd/hurdlookup.c
index bd720c27ec..a642c49002 100644
--- a/hurd/hurdlookup.c
+++ b/hurd/hurdlookup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
@@ -42,7 +42,7 @@ __hurd_file_name_lookup (error_t (*use_init_port)
(int which, error_t (*operate) (file_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
+ (file_t dir, const char *name, int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
const char *file_name, int flags, mode_t mode,
@@ -72,7 +72,7 @@ __hurd_file_name_lookup (error_t (*use_init_port)
if (flags & O_NOFOLLOW) /* See lookup-retry.c about O_NOFOLLOW. */
flags |= O_NOTRANS;
- if (flags & O_DIRECTORY && !(flags & O_NOFOLLOW))
+ if (flags & O_DIRECTORY && (flags & O_NOFOLLOW) == 0)
{
/* The caller wants to require that the file we look up is a directory.
We can do this without an extra RPC by appending a trailing slash
@@ -105,7 +105,7 @@ __hurd_file_name_split (error_t (*use_init_port)
(int which, error_t (*operate) (file_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
+ (file_t dir, const char *name, int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
const char *file_name,
@@ -158,7 +158,7 @@ __hurd_directory_name_split (error_t (*use_init_port)
(int which, error_t (*operate) (file_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
+ (file_t dir, const char *name, int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
const char *file_name,
diff --git a/hurd/hurdmalloc.h b/hurd/hurdmalloc.h
index ab572e2814..3520ffacd8 100644
--- a/hurd/hurdmalloc.h
+++ b/hurd/hurdmalloc.h
@@ -12,9 +12,9 @@ extern void *_hurd_malloc (size_t);
extern void *_hurd_realloc (void *, size_t);
extern void _hurd_free (void *);
-extern void _hurd_malloc_fork_prepare(void);
-extern void _hurd_malloc_fork_parent(void);
-extern void _hurd_malloc_fork_child(void);
+extern void _hurd_malloc_fork_prepare (void);
+extern void _hurd_malloc_fork_parent (void);
+extern void _hurd_malloc_fork_child (void);
#define malloc _hurd_malloc
#define realloc _hurd_realloc
diff --git a/hurd/hurdmsg.c b/hurd/hurdmsg.c
index 5204a82c2a..0a73b54574 100644
--- a/hurd/hurdmsg.c
+++ b/hurd/hurdmsg.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992-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
@@ -328,7 +328,7 @@ _S_msg_set_env_variable (mach_port_t msgport, mach_port_t auth,
{
AUTHCHECK;
- if (setenv (variable, value, replace)) /* XXX name space */
+ if (__setenv (variable, value, replace)) /* XXX name space */
return errno;
return 0;
}
diff --git a/hurd/hurdpid.c b/hurd/hurdpid.c
index 859a7744ad..33659cc1ba 100644
--- a/hurd/hurdpid.c
+++ b/hurd/hurdpid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/hurdports.c b/hurd/hurdports.c
index 287ccf63fe..410beab292 100644
--- a/hurd/hurdports.c
+++ b/hurd/hurdports.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/hurdprio.c b/hurd/hurdprio.c
index ee98195f26..3783fe9397 100644
--- a/hurd/hurdprio.c
+++ b/hurd/hurdprio.c
@@ -1,5 +1,5 @@
/* Support code for dealing with priorities in the Hurd.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
@@ -50,7 +50,7 @@ _hurd_priority_which_map (enum __priority_which which, int who,
case PRIO_USER:
if (who == 0)
- who = geteuid ();
+ who = __geteuid ();
err = __USEPORT (PROC, __proc_getallpids (port, &pids, &npids));
for (i = 0; !err && i < npids; ++i)
{
diff --git a/hurd/hurdrlimit.c b/hurd/hurdrlimit.c
index ba24867ed7..231a9a4f51 100644
--- a/hurd/hurdrlimit.c
+++ b/hurd/hurdrlimit.c
@@ -1,5 +1,5 @@
/* Resource limits.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index 9004a9050c..15cc8fee21 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -1,5 +1,5 @@
/* Guts of both `select' and `poll' for Hurd.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 86ee00a857..fbc536c9bd 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
@@ -20,10 +20,10 @@
#include <string.h>
#include <cthreads.h> /* For `struct mutex'. */
-#include <pthread.h>
#include <pthreadP.h>
#include <mach.h>
#include <mach/thread_switch.h>
+#include <mach/mig_support.h>
#include <hurd.h>
#include <hurd/id.h>
@@ -33,6 +33,8 @@
#include "hurdmalloc.h" /* XXX */
#include "../locale/localeinfo.h"
+#include <libc-diag.h>
+
const char *_hurdsig_getenv (const char *);
struct mutex _hurd_siglock;
@@ -131,6 +133,7 @@ _hurd_thread_sigstate (thread_t thread)
__mutex_unlock (&_hurd_siglock);
return ss;
}
+libc_hidden_def (_hurd_thread_sigstate)
/* Destroy a sigstate structure. Called by libpthread just before the
* corresponding thread is terminated. */
@@ -229,7 +232,6 @@ _hurd_sigstate_actions (struct hurd_sigstate *ss)
else
return ss->actions;
}
-
/* Signal delivery itself is on this page. */
@@ -356,8 +358,14 @@ interrupted_reply_port_location (thread_t thread,
/* Faulted trying to read the TCB. */
return NULL;
+ DIAG_PUSH_NEEDS_COMMENT;
+ /* GCC 6 and before seem to be confused by the setjmp call inside
+ _hurdsig_catch_memory_fault and think that we may be returning a second
+ time to here with portloc uninitialized (but we never do). */
+ DIAG_IGNORE_NEEDS_COMMENT (6, "-Wmaybe-uninitialized");
/* Fault now if this pointer is bogus. */
*(volatile mach_port_t *) portloc = *portloc;
+ DIAG_POP_NEEDS_COMMENT;
if (sigthread)
_hurdsig_end_catch_fault ();
@@ -1468,9 +1476,6 @@ _hurdsig_init (const int *intarray, size_t intarraysize)
/* Start the signal thread listening on the message port. */
#pragma weak __cthread_fork
-#pragma weak __cthread_detach
-#pragma weak __pthread_getattr_np
-#pragma weak __pthread_attr_getstack
if (!__cthread_fork)
{
err = __thread_create (__mach_task_self (), &_hurd_msgport_thread);
@@ -1506,11 +1511,16 @@ _hurdsig_init (const int *intarray, size_t intarraysize)
we'll let the signal thread's per-thread variables be found as for
any normal cthread, and just leave the magic __hurd_sigthread_*
values all zero so they'll be ignored. */
- __cthread_detach (thread = __cthread_fork ((__cthread_fn_t) &_hurd_msgport_receive, 0));
+#pragma weak __cthread_detach
+#pragma weak __pthread_getattr_np
+#pragma weak __pthread_attr_getstack
+ __cthread_t thread = __cthread_fork (
+ (cthread_fn_t) &_hurd_msgport_receive, 0);
+ __cthread_detach (thread);
if (__pthread_getattr_np)
{
- /* Record stack layout for fork() */
+ /* Record signal thread stack layout for fork() */
pthread_attr_t attr;
void *addr;
size_t size;
diff --git a/hurd/hurdsock.c b/hurd/hurdsock.c
index 03d45e78a1..e9334ba78d 100644
--- a/hurd/hurdsock.c
+++ b/hurd/hurdsock.c
@@ -1,5 +1,5 @@
/* _hurd_socket_server - Find the server for a socket domain.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
diff --git a/hurd/hurdsocket.h b/hurd/hurdsocket.h
index aef3faadda..dab74febce 100644
--- a/hurd/hurdsocket.h
+++ b/hurd/hurdsocket.h
@@ -1,5 +1,5 @@
/* Hurd-specific socket functions
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-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
diff --git a/hurd/hurdstartup.c b/hurd/hurdstartup.c
index edfd96fcbd..b148125c96 100644
--- a/hurd/hurdstartup.c
+++ b/hurd/hurdstartup.c
@@ -1,5 +1,5 @@
/* Initial program startup for running under the GNU Hurd.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
diff --git a/hurd/hurdstartup.h b/hurd/hurdstartup.h
index cba69b6e93..64d12e19ba 100644
--- a/hurd/hurdstartup.h
+++ b/hurd/hurdstartup.h
@@ -1,5 +1,5 @@
/* Data from initial program startup for running under the GNU Hurd.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/intern-fd.c b/hurd/intern-fd.c
index 91158f25c0..085ae2bd10 100644
--- a/hurd/intern-fd.c
+++ b/hurd/intern-fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -48,3 +48,4 @@ _hurd_intern_fd (io_t port, int flags, int dealloc)
return fd;
}
+libc_hidden_def (_hurd_intern_fd)
diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c
index 95e5c5acfb..2f83ac6ce7 100644
--- a/hurd/intr-msg.c
+++ b/hurd/intr-msg.c
@@ -1,5 +1,5 @@
/* Replacement for mach_msg used in interruptible Hurd RPCs.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
@@ -422,3 +422,4 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
return err;
}
+libc_hidden_def (_hurd_intr_rpc_mach_msg)
diff --git a/hurd/intr-rpc.defs b/hurd/intr-rpc.defs
index 7e61d799a9..c48443dd6f 100644
--- a/hurd/intr-rpc.defs
+++ b/hurd/intr-rpc.defs
@@ -1,5 +1,5 @@
/* Special MiG definitions for interruptible RPC stubs.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
diff --git a/hurd/intr-rpc.h b/hurd/intr-rpc.h
index f6a9783ad7..5e7937b7cb 100644
--- a/hurd/intr-rpc.h
+++ b/hurd/intr-rpc.h
@@ -1,5 +1,5 @@
/* Special MiG definitions for interruptible RPC stubs.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/longjmp-ts.c b/hurd/longjmp-ts.c
index 3252dcb25f..5a8bf6fe06 100644
--- a/hurd/longjmp-ts.c
+++ b/hurd/longjmp-ts.c
@@ -1,5 +1,5 @@
/* Perform a `longjmp' on a Mach thread_state. Stub version.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c
index 5b03a4c9d0..deddc2264c 100644
--- a/hurd/lookup-at.c
+++ b/hurd/lookup-at.c
@@ -1,5 +1,5 @@
/* Lookup helper function for Hurd implementation of *at functions.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-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
diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c
index 10ba361ab4..53cacdab15 100644
--- a/hurd/lookup-retry.c
+++ b/hurd/lookup-retry.c
@@ -1,5 +1,5 @@
/* hairy bits of Hurd file name lookup
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-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
@@ -48,7 +48,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
(int which, error_t (*operate) (file_t)),
file_t (*get_dtable_port) (int fd),
error_t (*lookup)
- (file_t dir, char *name,
+ (file_t dir, const char *name,
int flags, mode_t mode,
retry_type *do_retry, string_t retry_name,
mach_port_t *result),
@@ -150,9 +150,9 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
err = __io_stat (*result, &st);
if (!err)
{
- if (flags & O_DIRECTORY && !S_ISDIR(st.st_mode))
+ if (flags & O_DIRECTORY && !S_ISDIR (st.st_mode))
err = ENOTDIR;
- if (S_ISLNK(st.st_mode))
+ if (S_ISLNK (st.st_mode))
err = ELOOP;
else if (st.st_mode & (S_IPTRANS|S_IATRANS))
{
diff --git a/hurd/msgportdemux.c b/hurd/msgportdemux.c
index c7ebf89c39..370cf4fb81 100644
--- a/hurd/msgportdemux.c
+++ b/hurd/msgportdemux.c
@@ -1,5 +1,5 @@
/* Demux messages sent on the signal port.
- Copyright (C) 1991-2016 Free Software Foundation, Inc.
+ Copyright (C) 1991-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
diff --git a/hurd/new-fd.c b/hurd/new-fd.c
index e5c9f9ea63..eab03471bf 100644
--- a/hurd/new-fd.c
+++ b/hurd/new-fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/openport.c b/hurd/openport.c
index fbb59ceb03..308e19a4ad 100644
--- a/hurd/openport.c
+++ b/hurd/openport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/path-lookup.c b/hurd/path-lookup.c
index 3186e8bf3d..5607d5809c 100644
--- a/hurd/path-lookup.c
+++ b/hurd/path-lookup.c
@@ -1,5 +1,5 @@
/* Filename lookup using a search path
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -33,7 +33,7 @@ file_name_path_scan (const char *file_name, const char *path,
error_t (*fun)(const char *name),
char **prefixed_name)
{
- if (path == NULL || index (file_name, '/'))
+ if (path == NULL || strchr (file_name, '/'))
{
if (prefixed_name)
*prefixed_name = 0;
@@ -47,7 +47,7 @@ file_name_path_scan (const char *file_name, const char *path,
for (;;)
{
error_t err;
- const char *next = index (path, ':') ?: path + strlen (path);
+ const char *next = strchr (path, ':') ?: path + strlen (path);
size_t pfx_len = next - path;
char pfxed_name[pfx_len + 2 + file_name_len + 1];
@@ -63,7 +63,7 @@ file_name_path_scan (const char *file_name, const char *path,
if (err == 0)
{
if (prefixed_name)
- *prefixed_name = strdup (pfxed_name);
+ *prefixed_name = __strdup (pfxed_name);
return 0;
}
if (!real_err && err != ENOENT)
@@ -87,16 +87,16 @@ file_name_path_scan (const char *file_name, const char *path,
if it is looked up using a prefix from PATH, *PREFIXED_NAME is set to
malloced storage containing the prefixed name. */
error_t
-hurd_file_name_path_lookup (error_t (*use_init_port)
- (int which, error_t (*operate) (mach_port_t)),
- file_t (*get_dtable_port) (int fd),
- error_t (*lookup)
- (file_t dir, char *name, int flags, mode_t mode,
- retry_type *do_retry, string_t retry_name,
- mach_port_t *result),
- const char *file_name, const char *path,
- int flags, mode_t mode,
- file_t *result, char **prefixed_name)
+__hurd_file_name_path_lookup (error_t (*use_init_port)
+ (int which, error_t (*operate) (mach_port_t)),
+ file_t (*get_dtable_port) (int fd),
+ error_t (*lookup)
+ (file_t dir, const char *name, int flags, mode_t mode,
+ retry_type *do_retry, string_t retry_name,
+ mach_port_t *result),
+ const char *file_name, const char *path,
+ int flags, mode_t mode,
+ file_t *result, char **prefixed_name)
{
error_t scan_lookup (const char *name)
{
@@ -106,6 +106,7 @@ hurd_file_name_path_lookup (error_t (*use_init_port)
}
return file_name_path_scan (file_name, path, scan_lookup, prefixed_name);
}
+strong_alias (__hurd_file_name_path_lookup, hurd_file_name_path_lookup)
file_t
file_name_path_lookup (const char *file_name, const char *path,
@@ -114,9 +115,9 @@ file_name_path_lookup (const char *file_name, const char *path,
error_t err;
file_t result;
- err = hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, 0,
- file_name, path, flags, mode,
- &result, prefixed_name);
+ err = __hurd_file_name_path_lookup (&_hurd_ports_use, &__getdport, 0,
+ file_name, path, flags, mode,
+ &result, prefixed_name);
return err ? (__hurd_fail (err), MACH_PORT_NULL) : result;
}
diff --git a/hurd/pid2task.c b/hurd/pid2task.c
index 80ee017a17..fd3ca02f3f 100644
--- a/hurd/pid2task.c
+++ b/hurd/pid2task.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/port-cleanup.c b/hurd/port-cleanup.c
index fe1c6ce4ca..fe22b458cc 100644
--- a/hurd/port-cleanup.c
+++ b/hurd/port-cleanup.c
@@ -1,5 +1,5 @@
/* Cleanup function for `struct hurd_port' users who longjmp.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/port2fd.c b/hurd/port2fd.c
index 9b52c74a2e..858a409f4a 100644
--- a/hurd/port2fd.c
+++ b/hurd/port2fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/ports-get.c b/hurd/ports-get.c
index fb34fe64ba..648f029ed8 100644
--- a/hurd/ports-get.c
+++ b/hurd/ports-get.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/ports-set.c b/hurd/ports-set.c
index ce7456eb31..9ecd69cc39 100644
--- a/hurd/ports-set.c
+++ b/hurd/ports-set.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/preempt-sig.c b/hurd/preempt-sig.c
index bece0f26bf..c31e85e53d 100644
--- a/hurd/preempt-sig.c
+++ b/hurd/preempt-sig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
diff --git a/hurd/privports.c b/hurd/privports.c
index 94d8156b5d..68121e77f0 100644
--- a/hurd/privports.c
+++ b/hurd/privports.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/report-wait.c b/hurd/report-wait.c
index f11a0902c3..db63fbe844 100644
--- a/hurd/report-wait.c
+++ b/hurd/report-wait.c
@@ -1,5 +1,5 @@
/* Report on what a thread in our task is waiting for.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
diff --git a/hurd/set-host.c b/hurd/set-host.c
index 252ce7be0d..6e20d15d4b 100644
--- a/hurd/set-host.c
+++ b/hurd/set-host.c
@@ -1,5 +1,5 @@
/* Set a host configuration item kept as the whole contents of a file.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-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
diff --git a/hurd/setauth.c b/hurd/setauth.c
index a8a625d65a..a8af439c97 100644
--- a/hurd/setauth.c
+++ b/hurd/setauth.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/seteuids.c b/hurd/seteuids.c
index c09fb0eb4a..0dbe44d78b 100644
--- a/hurd/seteuids.c
+++ b/hurd/seteuids.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1993-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
diff --git a/hurd/siginfo.c b/hurd/siginfo.c
index 743abed941..75e02d5282 100644
--- a/hurd/siginfo.c
+++ b/hurd/siginfo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -17,10 +17,11 @@
#include <hurd/signal.h>
#include <stdio.h>
+#include <libioP.h>
void
_hurd_siginfo_handler (int signo)
{
/* XXX */
- puts ("got a SIGINFO");
+ _IO_puts ("got a SIGINFO");
}
diff --git a/hurd/sigunwind.c b/hurd/sigunwind.c
index a999173c50..40e0f679f7 100644
--- a/hurd/sigunwind.c
+++ b/hurd/sigunwind.c
@@ -1,5 +1,5 @@
/* longjmp cleanup function for unwinding past signal handlers.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/stack_chk_fail_local.c b/hurd/stack_chk_fail_local.c
new file mode 100644
index 0000000000..305871fbc0
--- /dev/null
+++ b/hurd/stack_chk_fail_local.c
@@ -0,0 +1 @@
+#include <debug/stack_chk_fail_local.c>
diff --git a/hurd/task2pid.c b/hurd/task2pid.c
index addbc39358..265cb88326 100644
--- a/hurd/task2pid.c
+++ b/hurd/task2pid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/thread-cancel.c b/hurd/thread-cancel.c
index ef2b8a028c..cd06597f2e 100644
--- a/hurd/thread-cancel.c
+++ b/hurd/thread-cancel.c
@@ -1,5 +1,5 @@
/* Thread cancellation support.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/thread-self.c b/hurd/thread-self.c
index d8785680ea..d6d96617f1 100644
--- a/hurd/thread-self.c
+++ b/hurd/thread-self.c
@@ -1,5 +1,5 @@
/* Cheap function to get current thread from sigstate without a syscall.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-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
diff --git a/hurd/trampoline.c b/hurd/trampoline.c
index b733b672e1..9bc278215a 100644
--- a/hurd/trampoline.c
+++ b/hurd/trampoline.c
@@ -1,5 +1,5 @@
/* Set thread_state for sighandler, and sigcontext to recover. Stub version.
- Copyright (C) 1994-2016 Free Software Foundation, Inc.
+ Copyright (C) 1994-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
@@ -28,7 +28,7 @@
struct sigcontext *
_hurd_setup_sighandler (int flags,
__sighandler_t handler,
- struct sigaltstack *sigaltstack,
+ stack_t *sigaltstack,
int signo, int sigcode,
void *state)
{
diff --git a/hurd/vpprintf.c b/hurd/vpprintf.c
index 9022604399..76cd31f922 100644
--- a/hurd/vpprintf.c
+++ b/hurd/vpprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1991-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
diff --git a/hurd/xattr.c b/hurd/xattr.c
index 5a694ab11f..23d9fcb691 100644
--- a/hurd/xattr.c
+++ b/hurd/xattr.c
@@ -1,5 +1,5 @@
/* Support for *xattr interfaces on GNU/Hurd.
- Copyright (C) 2006-2016 Free Software Foundation, Inc.
+ Copyright (C) 2006-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
@@ -67,14 +67,14 @@ _hurd_xattr_get (io_t port, const char *name, void *value, size_t *size)
if (value != NULL && *size < bufsz)
{
if (buf != value)
- munmap (buf, bufsz);
+ __munmap (buf, bufsz);
return -ERANGE;
}
if (buf != value && bufsz > 0)
{
if (value != NULL)
memcpy (value, buf, bufsz);
- munmap (buf, bufsz);
+ __munmap (buf, bufsz);
}
*size = bufsz;
return 0;
@@ -150,7 +150,7 @@ _hurd_xattr_set (io_t port, const char *name, const void *value, size_t size,
return err;
if (bufsz > 0)
{
- munmap (buf, bufsz);
+ __munmap (buf, bufsz);
return ENODATA;
}
}