]> sourceware.org Git - glibc.git/commitdiff
Fri Nov 17 17:57:00 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-951118 cvs/libc-951119
authorRoland McGrath <roland@gnu.org>
Sat, 18 Nov 1995 10:00:22 +0000 (10:00 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 18 Nov 1995 10:00:22 +0000 (10:00 +0000)
* sysdeps/generic/Makefile (make_siglist): Add missing backslash.

* sysdeps/generic/dl-sysdep.c (_dl_sysdep_start_cleanup): New
function.

* hurd/hurdfault.c: Replace __libc_fatal calls with assert_perror.
(_hurdsig_fault_init): Remove #if 0 from setting exception port.
Insert send right for SIGEXC before thread_set_special_port.
* hurd/hurdsig.c: Replace __libc_fatal calls with assert_perror.
(_hurdsig_init): Remove #if 0 from setting exception port.

* sysdeps/mach/hurd/ptrace.c (ptrace: PTRACE_CONT): Use
HURD_MSGPORT_RPC macro.

ChangeLog
hurd/hurdfault.c
hurd/hurdsig.c
sysdeps/generic/Makefile
sysdeps/generic/dl-sysdep.c
sysdeps/mach/hurd/ptrace.c

index 568a9553f61db083aa1e9049f659a8b771ef212d..207253f998e4806c777fc6f10c37bb86ded8c704 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Fri Nov 17 17:57:00 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
+
+       * sysdeps/generic/Makefile (make_siglist): Add missing backslash.
+
+       * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start_cleanup): New
+       function.
+
+       * hurd/hurdfault.c: Replace __libc_fatal calls with assert_perror.
+       (_hurdsig_fault_init): Remove #if 0 from setting exception port.
+       Insert send right for SIGEXC before thread_set_special_port.
+       * hurd/hurdsig.c: Replace __libc_fatal calls with assert_perror.
+       (_hurdsig_init): Remove #if 0 from setting exception port.
+
+       * sysdeps/mach/hurd/ptrace.c (ptrace: PTRACE_CONT): Use
+       HURD_MSGPORT_RPC macro.
+
 Thu Nov 16 06:07:49 1995  Roland McGrath  <roland@churchy.gnu.ai.mit.edu>
 
        * sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start_cleanup): New
index e8b54660b981a0927ebb39296eefadc1c2052995..e1f8c19acc174f1af42785312bf26b73d07e47d0 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle faults in the signal thread.
-Copyright (C) 1994 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995 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
@@ -114,30 +114,33 @@ _hurdsig_fault_init (void)
   struct machine_thread_state state;
   mach_port_t sigexc;
 
-  if (err = __mach_port_allocate (__mach_task_self (),
-                                 MACH_PORT_RIGHT_RECEIVE, &sigexc))
-    __libc_fatal ("hurd: Can't create receive right for signal thread exc\n");
-  if (err = __mach_port_allocate (__mach_task_self (),
-                                 MACH_PORT_RIGHT_RECEIVE, &forward_sigexc))
-    __libc_fatal ("hurd: Can't create receive right for signal thread exc\n");
+  err = __mach_port_allocate (__mach_task_self (),
+                             MACH_PORT_RIGHT_RECEIVE, &sigexc);
+  assert_perror (err);
+  err = __mach_port_allocate (__mach_task_self (),
+                             MACH_PORT_RIGHT_RECEIVE, &forward_sigexc);
+  assert_perror (err);
+
+  err = __mach_port_insert_right (__mach_task_self (),
+                                 sigexc, MACH_MSG_TYPE_MAKE_SEND);
+  assert_perror (err);
+  err = __thread_set_special_port (_hurd_msgport_thread,
+                                  THREAD_EXCEPTION_PORT, sigexc);
+  __mach_port_deallocate (__mach_task_self (), sigexc);
+  assert_perror (err);
 
   memset (&state, 0, sizeof state);
   MACHINE_THREAD_STATE_SET_PC (&state, faulted);
   MACHINE_THREAD_STATE_SET_SP (&state, faultstack, sizeof faultstack);
 
-#if 0                          /* Don't confuse gdb.  */
-  __thread_set_special_port (_hurd_msgport_thread,
-                            THREAD_EXCEPTION_PORT, sigexc);
-#endif
-
-  if (err = __USEPORT
-      (PROC,
-       __proc_handle_exceptions (port,
-                                sigexc,
-                                forward_sigexc, MACH_MSG_TYPE_MAKE_SEND,
-                                MACHINE_THREAD_STATE_FLAVOR,
-                                (natural_t *) &state,
-                                MACHINE_THREAD_STATE_COUNT)))
-    __libc_fatal ("hurd: proc won't handle signal thread exceptions\n");
+  err = __USEPORT
+    (PROC,
+     __proc_handle_exceptions (port,
+                              sigexc,
+                              forward_sigexc, MACH_MSG_TYPE_MAKE_SEND,
+                              MACHINE_THREAD_STATE_FLAVOR,
+                              (natural_t *) &state,
+                              MACHINE_THREAD_STATE_COUNT));
+  assert_perror (err);
 }
 
index 68be2e9bd0430d40bcabb7a269bd4596216b3f49..13ffb71822e5103c35dab93c119610b7e6d6a7cc 100644 (file)
@@ -1113,17 +1113,17 @@ _hurdsig_init (void)
 
   __mutex_init (&_hurd_siglock);
 
-  if (err = __mach_port_allocate (__mach_task_self (),
-                                 MACH_PORT_RIGHT_RECEIVE,
-                                 &_hurd_msgport))
-    __libc_fatal ("hurd: Can't create message port receive right\n");
+  err = __mach_port_allocate (__mach_task_self (),
+                             MACH_PORT_RIGHT_RECEIVE,
+                             &_hurd_msgport);
+  assert_perror (err);
 
   /* Make a send right to the signal port.  */
-  if (err = __mach_port_insert_right (__mach_task_self (),
-                                     _hurd_msgport,
-                                     _hurd_msgport,
-                                     MACH_MSG_TYPE_MAKE_SEND))
-    __libc_fatal ("hurd: Can't create send right to message port\n");
+  err = __mach_port_insert_right (__mach_task_self (),
+                                 _hurd_msgport,
+                                 _hurd_msgport,
+                                 MACH_MSG_TYPE_MAKE_SEND);
+  assert_perror (err);
 
   /* Set the default thread to receive task-global signals
      to this one, the main (first) user thread.  */
@@ -1131,15 +1131,15 @@ _hurdsig_init (void)
 
   /* Start the signal thread listening on the message port.  */
 
-  if (err = __thread_create (__mach_task_self (), &_hurd_msgport_thread))
-    __libc_fatal ("hurd: Can't create signal thread\n");
+  err = __thread_create (__mach_task_self (), &_hurd_msgport_thread);
+  assert_perror (err);
 
   stacksize = __vm_page_size * 4; /* Small stack for signal thread.  */
-  if (err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread,
-                                _hurd_msgport_receive,
-                                (vm_address_t *) &__hurd_sigthread_stack_base,
-                                &stacksize))
-    __libc_fatal ("hurd: Can't setup signal thread\n");
+  err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread,
+                            _hurd_msgport_receive,
+                            (vm_address_t *) &__hurd_sigthread_stack_base,
+                            &stacksize);
+  assert_perror (err);
 
   __hurd_sigthread_stack_end = __hurd_sigthread_stack_base + stacksize;
   __hurd_sigthread_variables =
@@ -1151,14 +1151,12 @@ _hurdsig_init (void)
      variable for the cached reply port.  */
   __mig_init ((void *) __hurd_sigthread_stack_base);
 
-  if (err = __thread_resume (_hurd_msgport_thread))
-    __libc_fatal ("hurd: Can't resume signal thread\n");
+  err = __thread_resume (_hurd_msgport_thread);
+  assert_perror (err);
 
-#if 0                          /* Don't confuse poor gdb.  */
   /* Receive exceptions on the signal port.  */
   __task_set_special_port (__mach_task_self (),
                           TASK_EXCEPTION_PORT, _hurd_msgport);
-#endif
 }
 \f                              /* XXXX */
 /* Reauthenticate with the proc server.  */
index dc31a50fcdfe07fcf4e610cd4f3eb6ccda7c5751..9dfc82c92876f083b6506003d47c600446c54ccd 100644 (file)
@@ -52,7 +52,7 @@ $(objpfx)siglist.c: $(objpfx)make_siglist
        mv $@-tmp $@
 
 $(objpfx)make_siglist: $(sysdep_dir)/generic/make_siglist.c
-       $(native-compile)
+       $(native-compile) \
        -DSIGNUM_H=\"`cd $(dir $(firstword $(wildcard \
                         $(+sysdep_dirs:%=%/signum.h)))); pwd`/signum.h\"
 
index b7b895ffce4d7718e1c3ed48be30636cd4641f58..49379761ad23b2a49a00608342c755a966f36119 100644 (file)
@@ -80,6 +80,11 @@ _dl_sysdep_start (void **start_argptr,
   return user_entry;
 }
 
+void
+_dl_sysdep_start_cleanup (void)
+{
+}
+
 int
 _dl_sysdep_open_zero_fill (void)
 {
index 90fd7649ee84b8bf1490c7f86ff9c3517f877700..f68d3b41ed494e7dab6e65da2a1f779ca3f3d806 100644 (file)
@@ -106,17 +106,15 @@ ptrace (enum __ptrace_request request, ... )
       {
        /* Send a DATA signal to PID, telling it to take the signal
           normally even if it's traced.  */
-       error_t err; task_t task = __pid2task (pid);
+       error_t err;
+       task_t task = __pid2task (pid);
        if (task == MACH_PORT_NULL)
          return -1;
        if (data == SIGKILL)
          err = __task_terminate (task);
        else
          {
-           mach_port_t msgport;
-           err = __USEPORT (PROC, __proc_getmsgport (port, pid, &msgport));
-
-           if (!err && addr != (void *) 1)
+           if (addr != (void *) 1)
              {
                /* Move the user thread's PC to ADDR.  */
                thread_t thread;
@@ -135,15 +133,18 @@ ptrace (enum __ptrace_request request, ... )
                                                  MACHINE_THREAD_STATE_FLAVOR,
                                                  (natural_t *) &state, count);
                      }
-                   
+
                  }
                __mach_port_deallocate (__mach_task_self (), thread);
              }
+           else
+             err = 0;
 
            if (! err)
              /* Tell the process to take the signal (or just resume if 0).  */
-             err = __msg_sig_post_untraced (msgport, data, task);
-           __mach_port_deallocate (__mach_task_self (), msgport);
+             err = HURD_MSGPORT_RPC
+               (__USEPORT (PROC, __proc_getmsgport (port, pid, &msgport)),
+                0, 0, __msg_sig_post_untraced (msgport, data, task));
          }
        __mach_port_deallocate (__mach_task_self (), task);
        return err ? __hurd_fail (err) : 0;
@@ -201,7 +202,7 @@ ptrace (enum __ptrace_request request, ... )
          }
        __mach_port_deallocate (__mach_task_self (), task);
        return err ? __hurd_fail (err) : 0;
-      }      
+      }
 
     case PTRACE_PEEKTEXT:
     case PTRACE_PEEKDATA:
This page took 0.058528 seconds and 5 git commands to generate.