aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-01-02 10:23:33 +0000
committerRoland McGrath <roland@gnu.org>2002-01-02 10:23:33 +0000
commit7595ddb8f97e4262b38e6e2a3c211204581171cc (patch)
tree6251a7cc722edc97d19aa7efe5e64eb91a0b4f3c /sysdeps
parentf58f41f1f479e299a8e61235934befc014992609 (diff)
downloadglibc-7595ddb8f97e4262b38e6e2a3c211204581171cc.zip
glibc-7595ddb8f97e4262b38e6e2a3c211204581171cc.tar.gz
glibc-7595ddb8f97e4262b38e6e2a3c211204581171cc.tar.bz2
* 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.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/mach/hurd/fork.c26
-rw-r--r--sysdeps/mach/hurd/spawni.c8
2 files changed, 27 insertions, 7 deletions
diff --git a/sysdeps/mach/hurd/fork.c b/sysdeps/mach/hurd/fork.c
index 6aa4345..635110a 100644
--- a/sysdeps/mach/hurd/fork.c
+++ b/sysdeps/mach/hurd/fork.c
@@ -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.
The GNU C Library is free software; you can redistribute it and/or
@@ -147,7 +147,11 @@ __fork (void)
__thread_abort (_hurd_msgport_thread);
#endif
/* 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
@@ -252,9 +256,21 @@ __fork (void)
__mach_port_deallocate (__mach_task_self (), old);
/* The new task will receive its own exceptions
on its message port. */
- if (err = __task_set_special_port (newtask,
- TASK_EXCEPTION_PORT,
- port))
+ if (err =
+#ifdef TASK_EXCEPTION_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;
}
if (err = __mach_port_insert_right (newtask,
diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c
index 4e2d089..656d9ff 100644
--- a/sysdeps/mach/hurd/spawni.c
+++ b/sysdeps/mach/hurd/spawni.c
@@ -1,5 +1,5 @@
/* 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.
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
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)
return __hurd_fail (err);
// From here down we must deallocate TASK and PROC before returning.