aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/dl-sysdep.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-08-14 22:49:23 +0000
committerRoland McGrath <roland@gnu.org>1995-08-14 22:49:23 +0000
commit54da5be39c868b55c234c23bb38eb42babc084d7 (patch)
tree64fe7cd0dfeaef3a8b6f469f3a7a83a3a974067a /sysdeps/mach/hurd/dl-sysdep.c
parent047f282dd7e83f24abce284dcc9d2d78cab42f9b (diff)
downloadglibc-54da5be39c868b55c234c23bb38eb42babc084d7.tar
glibc-54da5be39c868b55c234c23bb38eb42babc084d7.tar.gz
glibc-54da5be39c868b55c234c23bb38eb42babc084d7.tar.bz2
glibc-54da5be39c868b55c234c23bb38eb42babc084d7.zip
Mon Aug 14 16:51:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* hurd/thread-cancel.c: New file. * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): In rpc_wait case, frob mach_msg args to set timeout on receive. (_hurdsig_rcv_interrupted_p): Function removed. * sysdeps/mach/hurd/alpha/trampoline.c: Likewise. * sysdeps/mach/hurd/hppa/trampoline.c: Likewise. * sysdeps/mach/hurd/mips/trampoline.c: Likewise. * hurd/intr-msg.c: New file. * hurd/hurd/signal.h (struct hurd_sigstate): New member `cancel'. (_hurdsig_rcv_interrupted_p): Declaration removed. (HURD_EINTR_RPC): Macro removed. (_hurd_longjmp_thread_state, _hurd_interrupted_rpc_timeout): Declare these. * hurd/intr-rpc.h: New file. * hurd/intr-rpc.defs: Just import intr-rpc.h. * hurd/hurdsig.c (_hurd_interrupted_rpc_timeout): New variable. (interrupted_reply_port_location): Take new flag arg; only catch faults if it's set. (abort_rpcs): Rename to _hurdsig_abort_rpcs; take same new flag arg. No longer use _hurdsig_rcv_interrupted_p; instead compare PC to &_hurd_intr_rpc_msg_in_trap. If before it, mutate state to simulate MACH_SEND_INTERRUPTED return; on it, interrupt the operation. All callers changed. * hurd/hurd.h (hurd_thread_cancel, hurd_check_cancel): Declare these. * hurd/Makefile (distribute): Remove intr-rpc.awk. (sig): Add thread-cancel. (transform-user-stub, transform-user-stub-output): Variables removed. * sysdeps/mach/hurd/dl-sysdep.c: Change all RPCs from `__hurd_intr_rpc_*' to `__*'. (_hurd_intr_rpc_mach_msg): New function. (_hurd_thread_sigstate): Function removed. * sysdeps/mach/hurd/ioctl.c: Use _hurd_intr_rpc_mach_msg function, instead of __mach_msg inside HURD_EINTR_RPC macro. * sysdeps/generic/morecore.c [__GNU_LIBRARY__]: Declare `__sbrk' to take ptrdiff_t arg. * sysdeps/mach/hurd/fork.c: Remove _hurd_longjmp_thread_state decl. * sysdeps/mach/hurd/kill.c (kill_pid): Don't make `inline'. * libc-symbols.h [GCC >= 2.7] (strong_alias, weak_symbol, weak_alias): Use `extern' storage class.
Diffstat (limited to 'sysdeps/mach/hurd/dl-sysdep.c')
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 8f303bf6bb..e55a615287 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -125,6 +125,7 @@ fmh(); /* XXX */
_hurd_startup (start_argptr, &go);
LOSE;
+ abort ();
}
int
@@ -137,7 +138,6 @@ _dl_sysdep_open_zero_fill (void)
void
_dl_sysdep_fatal (const char *msg, ...)
{
- extern __typeof (__io_write) __hurd_intr_rpc_io_write;
va_list ap;
va_start (ap, msg);
@@ -147,8 +147,7 @@ _dl_sysdep_fatal (const char *msg, ...)
mach_msg_type_number_t nwrote;
do
{
- if (__hurd_intr_rpc_io_write (_hurd_init_dtable[2],
- msg, len, -1, &nwrote))
+ if (__io_write (_hurd_init_dtable[2], msg, len, -1, &nwrote))
break;
len -= nwrote;
msg += nwrote;
@@ -169,8 +168,6 @@ _dl_sysdep_fatal (const char *msg, ...)
int
open (const char *file_name, int mode, ...)
{
- extern __typeof (__dir_lookup) __hurd_intr_rpc_dir_lookup;
- extern __typeof (__io_reauthenticate) __hurd_intr_rpc_io_reauthenticate;
enum retry_type doretry;
char retryname[1024]; /* XXX string_t LOSES! */
file_t startdir, newpt, fileport;
@@ -187,7 +184,7 @@ open (const char *file_name, int mode, ...)
while (file_name[0] == '/')
file_name++;
- if (errno = __hurd_intr_rpc_dir_lookup (startdir, file_name, mode, 0,
+ if (errno = __dir_lookup (startdir, file_name, mode, 0,
&doretry, retryname, &fileport))
return -1;
@@ -207,7 +204,7 @@ open (const char *file_name, int mode, ...)
case FS_RETRY_REAUTH:
{
mach_port_t ref = __mach_reply_port ();
- errno = __hurd_intr_rpc_io_reauthenticate
+ errno = __io_reauthenticate
(fileport, ref, MACH_MSG_TYPE_MAKE_SEND);
if (! errno)
errno = __auth_user_authenticate
@@ -236,14 +233,12 @@ open (const char *file_name, int mode, ...)
if (retryname[0] == '\0')
{
mach_port_t memobj_rd, memobj_wr;
- extern __typeof (__io_map) __hurd_intr_rpc_io_map;
dealloc_dir = 1;
opened:
/* We have the file open. Now map it. */
- errno = __hurd_intr_rpc_io_map (fileport,
- &memobj_rd, &memobj_wr);
+ errno = __io_map (fileport, &memobj_rd, &memobj_wr);
if (dealloc_dir)
__mach_port_deallocate (__mach_task_self (), fileport);
if (errno)
@@ -359,7 +354,7 @@ open (const char *file_name, int mode, ...)
if (! err)
{
mach_port_t ref = __mach_reply_port ();
- err = __hurd_intr_rpc_io_reauthenticate
+ err = __io_reauthenticate
(unauth, ref, MACH_MSG_TYPE_MAKE_SEND);
if (! err)
err = __auth_user_authenticate
@@ -404,8 +399,8 @@ open (const char *file_name, int mode, ...)
return -1;
}
- errno = __hurd_intr_rpc_dir_lookup (startdir, file_name, mode, 0,
- &doretry, retryname, &fileport);
+ errno = __dir_lookup (startdir, file_name, mode, 0,
+ &doretry, retryname, &fileport);
}
}
@@ -445,9 +440,8 @@ mmap (caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
void
_exit (int status)
{
- extern __typeof (__proc_mark_exit) __hurd_intr_rpc_proc_mark_exit;
- __hurd_intr_rpc_proc_mark_exit (_dl_hurd_data->portarray[INIT_PORT_PROC],
- W_EXITCODE (status, 0));
+ __proc_mark_exit (_dl_hurd_data->portarray[INIT_PORT_PROC],
+ W_EXITCODE (status, 0));
while (__task_terminate (__mach_task_self ()))
__mach_task_self_ = (__mach_task_self) ();
}
@@ -513,11 +507,21 @@ longjmp (jmp_buf env, int val) { __longjmp (env[0].__jmpbuf, val); }
weak_symbol (longjmp)
-/* Stub out this function that is called by interruptible RPC stubs. It
- should never get called during initial dynamic linking, because we use
- only the raw MiG stub functions __hurd_intr_rpc_*. Since this defn is
+/* This function is called by interruptible RPC stubs. For initial
+ dynamic linking, just use the normal mach_msg. Since this defn is
weak, the real defn in libc.so will override it if we are linked into
the user program (-ldl). */
-struct hurd_sigstate *
-_hurd_thread_sigstate (thread_t thread) { thread = thread; abort (); }
-weak_symbol (_hurd_thread_sigstate)
+
+error_t
+_hurd_intr_rpc_mach_msg (mach_msg_header_t *msg,
+ mach_msg_option_t option,
+ mach_msg_size_t send_size,
+ mach_msg_size_t rcv_size,
+ mach_port_t rcv_name,
+ mach_msg_timeout_t timeout,
+ mach_port_t notify)
+{
+ return __mach_msg (msg, option, send_size, rcv_size, rcv_name,
+ timeout, notify);
+}
+weak_symbol (_hurd_intr_rpc_mach_msg)