1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

* hurd/hurdinit.c (_hurd_ports_use): Return error _hurd_ports is null.

* hurd/hurdsig.c (_hurdsig_init): Conditionalize exception port setup
	for old CMU and new OSF Mach interface flavors.
	* hurd/hurdfault.c (_hurdsig_fault_init): Likewise.
	* sysdeps/mach/hurd/fork.c (__fork): Likewise.

	* hurd/hurdsig.c (_hurd_internal_post_signal): Leave msgh_seqno unset.

	* sysdeps/mach/hurd/spawni.c (__spawni) [KERN_INVALID_LEDGER]:
	Pass extra arguments to task_create for OSF variant.
	* sysdeps/mach/hurd/fork.c (__fork): Likewise.
This commit is contained in:
Roland McGrath
2002-01-02 10:23:33 +00:00
parent f58f41f1f4
commit 7595ddb8f9
6 changed files with 71 additions and 10 deletions

View File

@ -1,5 +1,18 @@
2002-01-02 Roland McGrath <roland@frob.com> 2002-01-02 Roland McGrath <roland@frob.com>
* hurd/hurdinit.c (_hurd_ports_use): Return error _hurd_ports is null.
* hurd/hurdsig.c (_hurdsig_init): Conditionalize exception port setup
for old CMU and new OSF Mach interface flavors.
* hurd/hurdfault.c (_hurdsig_fault_init): Likewise.
* sysdeps/mach/hurd/fork.c (__fork): Likewise.
* hurd/hurdsig.c (_hurd_internal_post_signal): Leave msgh_seqno unset.
* sysdeps/mach/hurd/spawni.c (__spawni) [KERN_INVALID_LEDGER]:
Pass extra arguments to task_create for OSF variant.
* sysdeps/mach/hurd/fork.c (__fork): Likewise.
* sysdeps/powerpc/elf/libc-start.c: Make AUXVEC diddling code * sysdeps/powerpc/elf/libc-start.c: Make AUXVEC diddling code
conditional on [HAVE_AUX_VECTOR]. conditional on [HAVE_AUX_VECTOR].

View File

@ -1,5 +1,5 @@
/* Handle faults in the signal thread. /* Handle faults in the signal thread.
Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. Copyright (C) 1994,95,96,97,2002 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -156,8 +156,19 @@ _hurdsig_fault_init (void)
assert_perror (err); assert_perror (err);
/* Direct signal thread exceptions to the proc server. */ /* Direct signal thread exceptions to the proc server. */
#ifdef THREAD_EXCEPTION_PORT
err = __thread_set_special_port (_hurd_msgport_thread, err = __thread_set_special_port (_hurd_msgport_thread,
THREAD_EXCEPTION_PORT, sigexc); THREAD_EXCEPTION_PORT, sigexc);
#elif defined (EXC_MASK_ALL)
__thread_set_exception_ports (_hurd_msgport_thread,
EXC_MASK_ALL & ~(EXC_MASK_SYSCALL
| EXC_MASK_MACH_SYSCALL
| EXC_MASK_RPC_ALERT),
sigexc,
EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
#else
# error thread_set_exception_ports?
#endif
__mach_port_deallocate (__mach_task_self (), sigexc); __mach_port_deallocate (__mach_task_self (), sigexc);
assert_perror (err); assert_perror (err);
} }

View File

@ -1,4 +1,5 @@
/* Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc. /* Copyright (C) 1992,93,94,95,96,97,98,99,2000,01
Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -39,6 +40,12 @@ int __libc_argc;
error_t error_t
_hurd_ports_use (int which, error_t (*operate) (mach_port_t)) _hurd_ports_use (int which, error_t (*operate) (mach_port_t))
{ {
if (__builtin_expect (_hurd_ports == NULL, 0))
/* This means that _hurd_init has not been called yet, which is
normally only the case in the bootstrap filesystem, and there
only in the early phases of booting. */
return EGRATUITOUS;
return HURD_PORT_USE (&_hurd_ports[which], (*operate) (port)); return HURD_PORT_USE (&_hurd_ports[which], (*operate) (port));
} }

View File

@ -1030,7 +1030,6 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
msg.msgh_local_port = MACH_PORT_NULL; msg.msgh_local_port = MACH_PORT_NULL;
/* These values do not matter. */ /* These values do not matter. */
msg.msgh_id = 8675309; /* Jenny, Jenny. */ msg.msgh_id = 8675309; /* Jenny, Jenny. */
msg.msgh_seqno = 17; /* Random. */
ss->suspended = MACH_PORT_NULL; ss->suspended = MACH_PORT_NULL;
err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0, err = __mach_msg (&msg, MACH_SEND_MSG, sizeof msg, 0,
MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE,
@ -1300,8 +1299,19 @@ _hurdsig_init (const int *intarray, size_t intarraysize)
} }
/* Receive exceptions on the signal port. */ /* Receive exceptions on the signal port. */
#ifdef TASK_EXCEPTION_PORT
__task_set_special_port (__mach_task_self (), __task_set_special_port (__mach_task_self (),
TASK_EXCEPTION_PORT, _hurd_msgport); TASK_EXCEPTION_PORT, _hurd_msgport);
#elif defined (EXC_MASK_ALL)
__task_set_exception_ports (__mach_task_self (),
EXC_MASK_ALL & ~(EXC_MASK_SYSCALL
| EXC_MASK_MACH_SYSCALL
| EXC_MASK_RPC_ALERT),
_hurd_msgport,
EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
#else
# error task_set_exception_port?
#endif
/* Sanity check. Any pending, unblocked signals should have been /* Sanity check. Any pending, unblocked signals should have been
taken by our predecessor incarnation (i.e. parent or pre-exec state) taken by our predecessor incarnation (i.e. parent or pre-exec state)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1994,95,96,97,99,2001 Free Software Foundation, Inc. /* Copyright (C) 1994,95,96,97,99,2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -147,7 +147,11 @@ __fork (void)
__thread_abort (_hurd_msgport_thread); __thread_abort (_hurd_msgport_thread);
#endif #endif
/* Create the child task. It will inherit a copy of our memory. */ /* Create the child task. It will inherit a copy of our memory. */
err = __task_create (__mach_task_self (), 1, &newtask); err = __task_create (__mach_task_self (),
#ifdef KERN_INVALID_LEDGER
NULL, 0, /* OSF Mach */
#endif
1, &newtask);
} }
/* Unlock the global signal state lock, so we do not /* Unlock the global signal state lock, so we do not
@ -252,9 +256,21 @@ __fork (void)
__mach_port_deallocate (__mach_task_self (), old); __mach_port_deallocate (__mach_task_self (), old);
/* The new task will receive its own exceptions /* The new task will receive its own exceptions
on its message port. */ on its message port. */
if (err = __task_set_special_port (newtask, if (err =
TASK_EXCEPTION_PORT, #ifdef TASK_EXCEPTION_PORT
port)) __task_set_special_port (newtask,
TASK_EXCEPTION_PORT,
port)
#elif defined (EXC_MASK_ALL)
__task_set_exception_ports
(newtask, EXC_MASK_ALL & ~(EXC_MASK_SYSCALL
| EXC_MASK_MACH_SYSCALL
| EXC_MASK_RPC_ALERT),
port, EXCEPTION_DEFAULT, MACHINE_THREAD_STATE)
#else
# error task_set_exception_port?
#endif
)
LOSE; LOSE;
} }
if (err = __mach_port_insert_right (newtask, if (err = __mach_port_insert_right (newtask,

View File

@ -1,5 +1,5 @@
/* spawn a new process running an executable. Hurd version. /* spawn a new process running an executable. Hurd version.
Copyright (C) 2001 Free Software Foundation, Inc. Copyright (C) 2001,02 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -211,7 +211,11 @@ __spawni (pid_t *pid, const char *file,
memory, and then register it as our child like fork does. See fork.c memory, and then register it as our child like fork does. See fork.c
for comments about the sequencing of these proc operations. */ for comments about the sequencing of these proc operations. */
err = __task_create (__mach_task_self (), 0, &task); err = __task_create (__mach_task_self (),
#ifdef KERN_INVALID_LEDGER
NULL, 0, /* OSF Mach */
#endif
0, &task);
if (err) if (err)
return __hurd_fail (err); return __hurd_fail (err);
// From here down we must deallocate TASK and PROC before returning. // From here down we must deallocate TASK and PROC before returning.