diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-07-29 18:41:02 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-07-29 18:41:02 +0000 |
commit | ddbf7fef451eeb417ea28ca114f8f12c58dd5ca8 (patch) | |
tree | 4dbe0d974d84993dd580f97744121ae965ca4e2e /sysdeps/mach/hurd | |
parent | ef5742267ce858e059ee27033014c24f009bb326 (diff) | |
download | glibc-ddbf7fef451eeb417ea28ca114f8f12c58dd5ca8.tar.gz glibc-ddbf7fef451eeb417ea28ca114f8f12c58dd5ca8.tar.xz glibc-ddbf7fef451eeb417ea28ca114f8f12c58dd5ca8.zip |
Update.
1998-07-29 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/dl-sysdep.c (__lseek): New function. (__getpid): New function. (abort): New function. * nis/nis_cache2_xdr.c: Removed.
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index abaf0b2676..2495af4de9 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -500,6 +500,18 @@ __libc_read (int fd, void *buf, size_t nbytes) return nread; } +off_t weak_function +__lseek (int fd, off_t offset, int whence) +{ + error_t err; + + err = __io_seek ((mach_port_t) fd, offset, whence, &offset); + if (err) + return __hurd_fail (err); + + return offset; +} + __ptr_t weak_function __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) { @@ -570,7 +582,6 @@ __fxstat (int vers, int fd, struct stat *buf) return __hurd_fail (err); return 0; - } int weak_function @@ -590,6 +601,19 @@ __xstat (int vers, const char *file, struct stat *buf) return 0; } +pid_t weak_function +__getpid () +{ + pid_t pid, ppid; + int orphaned; + + if (__proc_getpids (_dl_hurd_data->portarray[INIT_PORT_PROC], + &pid, &ppid, &orphaned)) + return -1; + + return pid; +} + void weak_function _exit (int status) { @@ -598,6 +622,29 @@ _exit (int status) while (__task_terminate (__mach_task_self ())) __mach_task_self_ = (__mach_task_self) (); } + +/* Try to get a machine dependent instruction which will make the + program crash. This is used in case everything else fails. */ +#include <abort-instr.h> +#ifndef ABORT_INSTRUCTION +/* No such instruction is available. */ +# define ABORT_INSTRUCTION +#endif + +void weak_function +abort (void) +{ + /* Try to abort using the system specific command. */ + ABORT_INSTRUCTION; + + /* If the abort instruction failed, exit. */ + _exit (127); + + /* If even this fails, make sure we never return. */ + while (1) + /* Try for ever and ever. */ + ABORT_INSTRUCTION; +} /* This function is called by interruptible RPC stubs. For initial dynamic linking, just use the normal mach_msg. Since this defn is |