From a334319f6530564d22e775935d9c91663623a1b4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 22 Dec 2004 20:10:10 +0000 Subject: (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. --- hurd/Depend | 9 --- hurd/Makefile | 6 +- hurd/exc2signal.c | 71 ------------------- hurd/getdport.c | 7 +- hurd/hurd/fd.h | 18 +---- hurd/hurd/lookup.h | 34 ++------- hurd/hurd/xattr.h | 35 --------- hurd/hurdfault.c | 5 +- hurd/hurdlookup.c | 14 +++- hurd/hurdmalloc.c | 58 ++++++++++++++- hurd/hurdsig.c | 6 +- hurd/intr-msg.c | 22 +++--- hurd/longjmp-ts.c | 32 --------- hurd/lookup-at.c | 110 ---------------------------- hurd/lookup-retry.c | 4 +- hurd/report-wait.c | 8 +-- hurd/sigunwind.c | 19 ++--- hurd/trampoline.c | 37 ---------- hurd/xattr.c | 201 ---------------------------------------------------- 19 files changed, 107 insertions(+), 589 deletions(-) delete mode 100644 hurd/Depend delete mode 100644 hurd/exc2signal.c delete mode 100644 hurd/hurd/xattr.h delete mode 100644 hurd/longjmp-ts.c delete mode 100644 hurd/lookup-at.c delete mode 100644 hurd/trampoline.c delete mode 100644 hurd/xattr.c (limited to 'hurd') diff --git a/hurd/Depend b/hurd/Depend deleted file mode 100644 index b108b24..0000000 --- a/hurd/Depend +++ /dev/null @@ -1,9 +0,0 @@ -# This file says that the mach subdirectory should appear before this one. -# The mach and hurd subdirectories have many generated header files which -# much of the rest of the library depends on, so it is best to build them -# first (and mach before hurd, at that). The before-compile additions in -# sysdeps/{mach,hurd}/Makefile should make it reliably work for these files -# not to exist when making in other directories, but it will be slower that -# way with more somewhat expensive `make' invocations. - -mach diff --git a/hurd/Makefile b/hurd/Makefile index ab5a848..ccf596c 100644 --- a/hurd/Makefile +++ b/hurd/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,93,94,95,96,97,98,99,2001,2002,2004,2006 +# Copyright (C) 1991,92,93,94,95,96,97,98,99,2001,2002 # Free Software Foundation, Inc. # This file is part of the GNU C Library. @@ -46,7 +46,7 @@ server-interfaces := hurd/msg faultexc routines = hurdstartup hurdinit \ hurdid hurdpid hurdrlimit hurdprio hurdexec hurdselect \ - hurdlookup lookup-retry lookup-at \ + hurdlookup lookup-retry \ get-host set-host \ path-lookup \ setauth \ @@ -60,7 +60,7 @@ routines = hurdstartup hurdinit \ vpprintf \ ports-get ports-set hurdports hurdmsg \ errno-loc \ - $(sig) $(dtable) $(inlines) port-cleanup report-wait xattr + $(sig) $(dtable) $(inlines) port-cleanup report-wait sig = hurdsig hurdfault siginfo hurd-raise preempt-sig \ trampoline longjmp-ts catch-exc exc2signal hurdkill sigunwind \ thread-self thread-cancel intr-msg catch-signal diff --git a/hurd/exc2signal.c b/hurd/exc2signal.c deleted file mode 100644 index de044bb..0000000 --- a/hurd/exc2signal.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Translate Mach exception codes into signal numbers. Stub version. - Copyright (C) 1991, 1992, 1994, 1995, 1997 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -/* This file must be modified with machine-dependent details. */ -#error "need to write sysdeps/mach/hurd/MACHINE/exc2signal.c" - -/* Translate the Mach exception codes, as received in an `exception_raise' RPC, - into a signal number and signal subcode. */ - -void -_hurd_exception2signal (int exception, int code, int subcode, - int *signo, int *sigcode, int *error) -{ - *error = 0; - - switch (exception) - { - default: - *signo = SIGIOT; - *sigcode = exception; - break; - - case EXC_BAD_ACCESS: - if (code == KERN_PROTECTION_FAILURE) - *signo = SIGSEGV; - else - *signo = SIGBUS; - *sigcode = subcode; - *error = code; - break; - - case EXC_BAD_INSTRUCTION: - *signo = SIGILL; - *sigcode = 0; - break; - - case EXC_ARITHMETIC: - *signo = SIGFPE; - *sigcode = 0; - break; - - case EXC_EMULATION: - case EXC_SOFTWARE: - *signo = SIGEMT; - *sigcode = 0; - break; - - case EXC_BREAKPOINT: - *signo = SIGTRAP; - *sigcode = 0; - break; - } -} diff --git a/hurd/getdport.c b/hurd/getdport.c index 41567d5..eeb5a86 100644 --- a/hurd/getdport.c +++ b/hurd/getdport.c @@ -35,11 +35,8 @@ __getdport (int fd) so we don't bother allocating a real table. */ if (_hurd_init_dtable == NULL) - { - /* Never had a descriptor table. */ - errno = EBADF; - return MACH_PORT_NULL; - } + /* Never had a descriptor table. */ + return EBADF; if (fd < 0 || (unsigned int) fd > _hurd_init_dtablesize || _hurd_init_dtable[fd] == MACH_PORT_NULL) diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h index ad11367..198791b 100644 --- a/hurd/hurd/fd.h +++ b/hurd/hurd/fd.h @@ -1,5 +1,5 @@ /* File descriptors. - Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006 + Copyright (C) 1993,94,95,96,97,98,99,2000,01,02 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -240,21 +240,5 @@ extern int _hurd_select (int nfds, struct pollfd *pollfds, const struct timespec *timeout, const sigset_t *sigmask); -/* Variant of file_name_lookup used in *at function implementations. - AT_FLAGS should contain only AT_SYMLINK_NOFOLLOW; other bits - cause EINVAL. */ -extern file_t __file_name_lookup_at (int fd, int at_flags, - const char *file_name, - int flags, mode_t mode); - -/* Variant of file_name_split used in *at function implementations. */ -extern file_t __file_name_split_at (int fd, const char *file_name, - char **name); - -/* Variant of directory_name_split used in *at function implementations. */ -extern file_t __directory_name_split_at (int fd, const char *directory_name, - char **name); - - #endif /* hurd/fd.h */ diff --git a/hurd/hurd/lookup.h b/hurd/hurd/lookup.h index 1d013d9..faa35e0 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, 1996, 1997, 2006 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997 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 @@ -76,8 +76,8 @@ 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, - int flags, mode_t mode, + 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, @@ -86,37 +86,13 @@ 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, - int flags, mode_t mode, + 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, file_t *dir, char **name); -/* Split DIRECTORY into a parent directory and a name within the directory. - This is the same as hurd_file_name_split, but ignores trailing slashes. */ - -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, - int flags, mode_t mode, - retry_type *do_retry, string_t retry_name, - mach_port_t *result), - const char *directory_name, - file_t *dir, char **name); -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, - int flags, mode_t mode, - retry_type *do_retry, string_t retry_name, - mach_port_t *result), - const char *directory_name, - file_t *dir, char **name); - /* Process the values returned by `dir_lookup' et al, and loop doing `dir_lookup' calls until one returns FS_RETRY_NONE. The arguments diff --git a/hurd/hurd/xattr.h b/hurd/hurd/xattr.h deleted file mode 100644 index aaa7fd8..0000000 --- a/hurd/hurd/xattr.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Access to extended attributes on files for GNU/Hurd. - Copyright (C) 2005 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _HURD_XATTR_H -#define _HURD_XATTR_H 1 - -#include /* This defines the XATTR_* flags. */ - -/* These are the internal versions of getxattr/setxattr/listxattr. */ -extern error_t _hurd_xattr_get (io_t port, const char *name, - void *value, size_t *size); -extern error_t _hurd_xattr_set (io_t port, const char *name, - const void *value, size_t size, int flags); -extern error_t _hurd_xattr_remove (io_t port, const char *name); -extern error_t _hurd_xattr_list (io_t port, void *buffer, size_t *size); - - - -#endif /* hurd/xattr.h */ diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c index 36653e1..6ab5a97 100644 --- a/hurd/hurdfault.c +++ b/hurd/hurdfault.c @@ -1,6 +1,5 @@ /* Handle faults in the signal thread. - Copyright (C) 1994,1995,1996,1997,2002,2005 - Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,2002 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 @@ -25,7 +24,7 @@ #include #include #include -#include +#include "thread_state.h" #include "faultexc_server.h" /* mig-generated header for our exc server. */ #include diff --git a/hurd/hurdlookup.c b/hurd/hurdlookup.c index 8270132..77de271 100644 --- a/hurd/hurdlookup.c +++ b/hurd/hurdlookup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992,1993,1994,1995,1996,1997,1999,2001,2004,2006 +/* Copyright (C) 1992,93,94,95,96,97,99,2001,2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -184,7 +184,19 @@ __hurd_directory_name_split (error_t (*use_init_port) --lastslash; /* Find the last one earlier in the string, before the trailing ones. */ +#if __GLIBC__ > 2 || __GLIBC_MINOR__ >= 2 lastslash = __memrchr (file_name, '/', lastslash - file_name); +#else + /* Keep backing up, looking for a slash. */ + do + if (lastslash == file_name) + { + /* Hit the start with no slash. */ + lastslash = NULL; + break; + } + while (*lastslash-- != '/'); +#endif } if (lastslash != NULL) diff --git a/hurd/hurdmalloc.c b/hurd/hurdmalloc.c index 12da1f2..4839d98 100644 --- a/hurd/hurdmalloc.c +++ b/hurd/hurdmalloc.c @@ -33,7 +33,63 @@ * the rights to redistribute these changes. */ /* - * (pre-GNU) HISTORY + * HISTORY + * $Log$ + * Revision 1.15 2001/09/19 03:04:09 drepper + * (bcopy): Removed. + * (realloc): Replace bcopy with memcpy. + * + * Revision 1.14 2001/04/01 05:03:14 roland + * 2001-03-11 Roland McGrath + * + * * mach/mach_error.h: Fix ancient #endif syntax. + * * hurd/hurdmalloc.c: Likewise. + * + * Revision 1.13 1996/12/20 01:32:01 drepper + * Update from main archive 961219 + * + * Revision 1.12 1996/11/15 19:44:13 thomas + * Tue Nov 12 16:58:41 1996 Thomas Bushnell, n/BSG + * + * * mach/msg-destroy.c (mach_msg_destroy_port, + * mach_msg_destroy_memory): Use prototype syntax. + * * hurd/hurdmalloc.c (more_memory, malloc_fork_prepare, + * malloc_fork_parent, malloc_fork_child): Likewise. + * + * Revision 1.11 1996/06/06 15:13:47 miles + * Changes to bring in line with the hurd libthreads/malloc.c: + * (more_memory): Use assert_perror instead of MACH_CALL. + * "cthread_internals.h": Include removed. + * (realloc): Use LOG2_MIN_SIZE. + * (LOG2_MIN_SIZE): New macro. + * (realloc): Don't bother allocating a new block if the + * new size request fits in the old one and doesn't waste any space. + * Only free the old block if we successfully got a new one. + * [MCHECK] (struct header): New type. + * (union header): Only define if !MCHECK. + * (HEADER_SIZE, HEADER_NEXT, HEADER_FREE, HEADER_CHECK): New macros. + * [MCHECK] (MIN_SIZE): Add correct definition for this case. + * (more_memory, malloc, free, realloc): Use above macros, and add + * appropriate checks & frobs in MCHECK case. + * + * Revision 1.6 1996/03/07 21:13:08 miles + * (realloc): + * Use LOG2_MIN_SIZE. + * Don't bother allocating a new block if the new size request fits in the old + * one and doesn't waste any space. + * Only free the old block if we successfully got a new one. + * (LOG2_MIN_SIZE): New macro. + * + * Revision 1.5 1996/03/06 23:51:04 miles + * [MCHECK] (struct header): New type. + * (union header): Only define if !MCHECK. + * (HEADER_SIZE, HEADER_NEXT, HEADER_FREE, HEADER_CHECK): New macros. + * [MCHECK] (MIN_SIZE): Add correct definition for this case. + * (more_memory, malloc, free, realloc): + * Use above macros, and add appropriate checks & frobs in MCHECK case. + * + * Revision 1.4 1994/05/05 11:21:42 roland + * entered into RCS * * Revision 2.7 91/05/14 17:57:34 mrt * Correcting copyright diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c index e12d19d..bbd0c17 100644 --- a/hurd/hurdsig.c +++ b/hurd/hurdsig.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2005 +/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2000,01,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -132,7 +132,7 @@ _hurd_thread_sigstate (thread_t thread) #include #include #include -#include +#include "thread_state.h" #include #include /* For __msg_sig_post_reply. */ #include @@ -256,7 +256,7 @@ interrupted_reply_port_location (struct machine_thread_all_state *thread_state, } #include -#include +#include "intr-msg.h" /* Timeout on interrupt_operation calls. */ mach_msg_timeout_t _hurdsig_interrupt_timeout = 1000; diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c index 0ca6af3..e75fca8 100644 --- a/hurd/intr-msg.c +++ b/hurd/intr-msg.c @@ -1,6 +1,5 @@ /* Replacement for mach_msg used in interruptible Hurd RPCs. - Copyright (C) 1995,96,97,98,99,2000,2001,2002,2005 - Free Software Foundation, Inc. + Copyright (C) 1995,96,97,98,99,2000,01,02 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 @@ -202,10 +201,9 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, case MACH_MSG_TYPE_MOVE_SEND: for (i = 0; i < number; i++) __mach_port_deallocate (__mach_task_self (), *ports++); - if (ty->msgtl_header.msgt_longform) - ty->msgtl_name = MACH_MSG_TYPE_COPY_SEND; - else - ty->msgtl_header.msgt_name = MACH_MSG_TYPE_COPY_SEND; + (ty->msgtl_header.msgt_longform + ? ty->msgtl_name : ty->msgtl_header.msgt_name) + = MACH_MSG_TYPE_COPY_SEND; break; case MACH_MSG_TYPE_COPY_SEND: case MACH_MSG_TYPE_MOVE_RECEIVE: @@ -225,29 +223,29 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, name = ty->msgtl_name; size = ty->msgtl_size; number = ty->msgtl_number; - ty = (void *) ty + sizeof (mach_msg_type_long_t); + (char *) ty += sizeof (mach_msg_type_long_t); } else { name = ty->msgtl_header.msgt_name; size = ty->msgtl_header.msgt_size; number = ty->msgtl_header.msgt_number; - ty = (void *) ty + sizeof (mach_msg_type_t); + (char *) ty += sizeof (mach_msg_type_t); } if (ty->msgtl_header.msgt_inline) { clean_ports ((void *) ty, 0); /* calculate length of data in bytes, rounding up */ - ty = (void *) ty + (((((number * size) + 7) >> 3) - + sizeof (mach_msg_type_t) - 1) - &~ (sizeof (mach_msg_type_t) - 1)); + (char *) ty += (((((number * size) + 7) >> 3) + + sizeof (mach_msg_type_t) - 1) + &~ (sizeof (mach_msg_type_t) - 1)); } else { clean_ports (*(void **) ty, ty->msgtl_header.msgt_deallocate); - ty = (void *) ty + sizeof (void *); + ++(void **) ty; } } #else /* Untyped Mach IPC flavor. */ diff --git a/hurd/longjmp-ts.c b/hurd/longjmp-ts.c deleted file mode 100644 index e9c297a..0000000 --- a/hurd/longjmp-ts.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Perform a `longjmp' on a Mach thread_state. Stub version. - Copyright (C) 1991, 1994, 1997 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - -/* Set up STATE to do the equivalent of `longjmp (ENV, VAL);'. */ - -void -_hurd_longjmp_thread_state (void *state, jmp_buf env, int val) -{ - /* Set all the registers in *STATE to the values described by ENV and - RETVAL. After this, setting that thread's state to STATE should be - just like calling `longjmp (ENV, RETVAL)'. */ - #error "Need to write sysdeps/mach/hurd/MACHINE/longjmp-ctx.c" -} diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c deleted file mode 100644 index a2d50cb..0000000 --- a/hurd/lookup-at.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Lookup helper function for Hurd implementation of *at functions. - Copyright (C) 2006 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include -#include -#include -#include - -file_t -__file_name_lookup_at (int fd, int at_flags, - const char *file_name, int flags, mode_t mode) -{ - error_t err; - file_t result; - - flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0; - at_flags &= ~AT_SYMLINK_NOFOLLOW; - if (at_flags != 0) - return __hurd_fail (EINVAL); - - if (fd == AT_FDCWD || file_name[0] == '/') - return __file_name_lookup (file_name, flags, mode); - - file_t startdir; - error_t use_init_port (int which, error_t (*operate) (mach_port_t)) - { - return (which == INIT_PORT_CWDIR ? (*operate) (startdir) : - _hurd_ports_use (which, operate)); - } - - err = HURD_DPORT_USE (fd, (startdir = port, - __hurd_file_name_lookup (&use_init_port, - &__getdport, NULL, - file_name, - flags, - mode & ~_hurd_umask, - &result))); - - return err ? (__hurd_dfail (fd, err), MACH_PORT_NULL) : result; -} - -file_t -__file_name_split_at (int fd, const char *file_name, char **name) -{ - error_t err; - file_t result; - - if (fd == AT_FDCWD || file_name[0] == '/') - return __file_name_split (file_name, name); - - err = __hurd_file_name_split (&_hurd_ports_use, &__getdport, 0, - file_name, &result, name); - - file_t startdir; - error_t use_init_port (int which, error_t (*operate) (mach_port_t)) - { - return (which == INIT_PORT_CWDIR ? (*operate) (startdir) : - _hurd_ports_use (which, operate)); - } - - err = HURD_DPORT_USE (fd, (startdir = port, - __hurd_file_name_split (&use_init_port, - &__getdport, 0, - file_name, - &result, name))); - - return err ? (__hurd_dfail (fd, err), MACH_PORT_NULL) : result; -} - -file_t -__directory_name_split_at (int fd, const char *directory_name, char **name) -{ - error_t err; - file_t result; - - if (fd == AT_FDCWD || directory_name[0] == '/') - return __directory_name_split (directory_name, name); - - file_t startdir; - error_t use_init_port (int which, error_t (*operate) (mach_port_t)) - { - return (which == INIT_PORT_CWDIR ? (*operate) (startdir) : - _hurd_ports_use (which, operate)); - } - - err = HURD_DPORT_USE (fd, (startdir = port, - __hurd_directory_name_split (&use_init_port, - &__getdport, 0, - directory_name, - &result, name))); - - return err ? (__hurd_dfail (fd, err), MACH_PORT_NULL) : result; -} diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c index 0a886229..1f53f91 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,1993,1994,1995,1996,1997,1999,2001,2002,2003,2005 + Copyright (C) 1992,1993,1994,1995,1996,1997,1999,2001,2002,2003 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -247,7 +247,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port) char *p; /* XXX want client's host */ if (err = __host_info (__mach_host_self (), HOST_BASIC_INFO, - (integer_t *) &hostinfo, + (natural_t *) &hostinfo, &hostinfocnt)) return err; if (hostinfocnt != HOST_BASIC_INFO_COUNT) diff --git a/hurd/report-wait.c b/hurd/report-wait.c index 296b2ee..2ec1c19 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,1997,1999,2002,2005 Free Software Foundation, Inc. + Copyright (C) 1996,97,99,2002 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 @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include "thread_state.h" +#include "intr-msg.h" static char * describe_number (string_t description, const char *flavor, long int i) @@ -140,7 +140,7 @@ _S_msg_report_wait (mach_port_t msgport, thread_t thread, error_t err; err = __thread_get_state (thread, MACHINE_THREAD_STATE_FLAVOR, - (natural_t *) &state, &count); + (integer_t *) &state, &count); if (err) return err; assert (count == MACHINE_THREAD_STATE_COUNT); diff --git a/hurd/sigunwind.c b/hurd/sigunwind.c index 31dbe2a..450a385 100644 --- a/hurd/sigunwind.c +++ b/hurd/sigunwind.c @@ -1,5 +1,5 @@ /* longjmp cleanup function for unwinding past signal handlers. - Copyright (C) 1995,1996,1997,1998,2005,2006 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 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 @@ -18,10 +18,9 @@ 02111-1307 USA. */ #include -#include -#include +#include "thread_state.h" +#include #include -#include /* _hurd_setup_sighandler puts a link on the `active resources' chain so that @@ -71,19 +70,11 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val) struct hurd_userlink *link; - inline uintptr_t demangle_ptr (uintptr_t x) - { -# ifdef PTR_DEMANGLE - PTR_DEMANGLE (x); -# endif - return x; - } - /* Continue _longjmp_unwind's job of running the unwind forms for frames being unwound, since we will not return to its loop like this one, which called us. */ for (link = ss->active_resources; - link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link, demangle_ptr); + link && _JMPBUF_UNWINDS (env[0].__jmpbuf, link); link = link->thread.next) if (_hurd_userlink_unlink (link)) { @@ -120,7 +111,7 @@ _hurdsig_longjmp_from_handler (void *data, jmp_buf env, int val) link = (void *) &scp[1]; assert (! link->resource.next && ! link->resource.prevp); assert (link->thread.next == ss->active_resources); - assert (link->thread.prevp == &ss->active_resources); + assert (link->thread.prevp = &ss->active_resources); if (link->thread.next) link->thread.next->thread.prevp = &link->thread.next; ss->active_resources = link; diff --git a/hurd/trampoline.c b/hurd/trampoline.c deleted file mode 100644 index 7045a0d..0000000 --- a/hurd/trampoline.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Set thread_state for sighandler, and sigcontext to recover. Stub version. - Copyright (C) 1994, 1997 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - -/* Set up STATE to run a signal handler in the thread it describes. - This should save the original state in a `struct sigcontext' on the - thread's stack (or possibly a signal stack described by SIGALTSTACK, - if the SA_ONSTACK bit is set in FLAGS), and return the address of - that structure. */ - -struct sigcontext * -_hurd_setup_sighandler (int flags, - __sighandler_t handler, - struct sigaltstack *sigaltstack, - int signo, int sigcode, - void *state) -{ -#error "Need to write sysdeps/mach/hurd/MACHINE/trampoline.c" -} diff --git a/hurd/xattr.c b/hurd/xattr.c deleted file mode 100644 index cf3e22d..0000000 --- a/hurd/xattr.c +++ /dev/null @@ -1,201 +0,0 @@ -/* Support for *xattr interfaces on GNU/Hurd. - Copyright (C) 2006 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include -#include -#include - -/* Right now we support only a fixed set of xattr names for Hurd features. - There are no RPC interfaces for free-form xattr names and values. - - Name Value encoding - ---- ----- -------- - gnu.author empty if st_author==st_uid - uid_t giving st_author value - gnu.translator empty if no passive translator - translator and arguments: "/hurd/foo\0arg1\0arg2\0" -*/ - -error_t -_hurd_xattr_get (io_t port, const char *name, void *value, size_t *size) -{ - if (strncmp (name, "gnu.", 4)) - return EOPNOTSUPP; - name += 4; - - if (!strcmp (name, "author")) - { - struct stat64 st; - error_t err = __io_stat (port, &st); - if (err) - return err; - if (st.st_author == st.st_uid) - *size = 0; - else if (value) - { - if (*size < sizeof st.st_author) - return ERANGE; - memcpy (value, &st.st_author, sizeof st.st_author); - } - *size = sizeof st.st_author; - return 0; - } - - if (!strcmp (name, "translator")) - { - char *buf = value; - size_t bufsz = value ? *size : 0; - error_t err = __file_get_translator (port, &buf, &bufsz); - if (err) - return err; - if (value != NULL && *size < bufsz) - { - if (buf != value) - munmap (buf, bufsz); - return -ERANGE; - } - if (buf != value && bufsz > 0) - { - if (value != NULL) - memcpy (value, buf, bufsz); - munmap (buf, bufsz); - } - *size = bufsz; - return 0; - } - - return EOPNOTSUPP; -} - -error_t -_hurd_xattr_set (io_t port, const char *name, const void *value, size_t size, - int flags) -{ - if (strncmp (name, "gnu.", 4)) - return EOPNOTSUPP; - name += 4; - - if (!strcmp (name, "author")) - switch (size) - { - default: - return EINVAL; - case 0: /* "Clear" author by setting to st_uid. */ - { - struct stat64 st; - error_t err = __io_stat (port, &st); - if (err) - return err; - if (st.st_author == st.st_uid) - { - /* Nothing to do. */ - if (flags & XATTR_REPLACE) - return ENODATA; - return 0; - } - if (flags & XATTR_CREATE) - return EEXIST; - return __file_chauthor (port, st.st_uid); - } - case sizeof (uid_t): /* Set the author. */ - { - uid_t id; - memcpy (&id, value, sizeof id); - if (flags & (XATTR_CREATE|XATTR_REPLACE)) - { - struct stat64 st; - error_t err = __io_stat (port, &st); - if (err) - return err; - if (st.st_author == st.st_uid) - { - if (flags & XATTR_REPLACE) - return ENODATA; - } - else if (flags & XATTR_CREATE) - return EEXIST; - if (st.st_author == id) - /* Nothing to do. */ - return 0; - } - return __file_chauthor (port, id); - } - } - - if (!strcmp (name, "translator")) - { - if (flags & XATTR_REPLACE) - { - /* Must make sure it's already there. */ - char *buf = NULL; - size_t bufsz = 0; - error_t err = __file_get_translator (port, &buf, &bufsz); - if (err) - return err; - if (bufsz > 0) - { - munmap (buf, bufsz); - return ENODATA; - } - } - return __file_set_translator (port, - FS_TRANS_SET | ((flags & XATTR_CREATE) - ? FS_TRANS_EXCL : 0), 0, 0, - value, size, - MACH_PORT_NULL, MACH_MSG_TYPE_COPY_SEND); - } - - return EOPNOTSUPP; -} - -error_t -_hurd_xattr_remove (io_t port, const char *name) -{ - return _hurd_xattr_set (port, name, NULL, 0, XATTR_REPLACE); -} - -error_t -_hurd_xattr_list (io_t port, void *buffer, size_t *size) -{ - size_t total = 0; - char *bufp = buffer; - inline void add (const char *name, size_t len) - { - total += len; - if (bufp != NULL && total <= *size) - bufp = __mempcpy (bufp, name, len); - } -#define add(s) add (s, sizeof s) - - struct stat64 st; - error_t err = __io_stat (port, &st); - if (err) - return err; - - if (st.st_author != st.st_uid) - add ("gnu.author"); - if (st.st_mode & S_IPTRANS) - add ("gnu.translator"); - - if (buffer != NULL && total > *size) - return ERANGE; - *size = total; - return 0; -} -- cgit v1.1