diff options
author | Roland McGrath <roland@gnu.org> | 1998-11-29 16:32:43 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1998-11-29 16:32:43 +0000 |
commit | 3dc9c97969f0612fe8a0133c14eed5462ebbae11 (patch) | |
tree | 3e784a40394c752d799c3244508ff1909059dd84 | |
parent | f69139ec74b8f85d1487dde63bf7687ce69540c0 (diff) | |
download | glibc-3dc9c97969f0612fe8a0133c14eed5462ebbae11.tar.gz glibc-3dc9c97969f0612fe8a0133c14eed5462ebbae11.tar.xz glibc-3dc9c97969f0612fe8a0133c14eed5462ebbae11.zip |
* sysdeps/mach/hurd/dl-sysdep.c: Do not define
__hurd_threadvar_max. Add comment explaining why we define __hurd_threadvar_stack_offset and __hurd_threadvar_stack_mask here. 1998-07-29 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/mach/hurd/dl-sysdep.c (__hurd_sigthread_stack_base, __hurd_sigthread_stack_end, __hurd_sigthread_variables): Define to prevent inclusion of Hurd signal handling code. (__libc_write): New function. (_dl_sysdep_output): Removed. The implementation in `elf/dl-misc.c' now also works for the Hurd. 1998-09-12 Mark Kettenis <kettenis@phys.uva.nl>
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | sysdeps/mach/hurd/dl-sysdep.c | 69 |
2 files changed, 50 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog index b45aaac1e6..47c812fd7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 1998-09-12 Mark Kettenis <kettenis@phys.uva.nl> + * sysdeps/mach/hurd/dl-sysdep.c: Do not define + __hurd_threadvar_max. Add comment explaining why we define + __hurd_threadvar_stack_offset and __hurd_threadvar_stack_mask here. + +1998-07-29 Mark Kettenis <kettenis@phys.uva.nl> + + * sysdeps/mach/hurd/dl-sysdep.c (__hurd_sigthread_stack_base, + __hurd_sigthread_stack_end, __hurd_sigthread_variables): Define to + prevent inclusion of Hurd signal handling code. + (__libc_write): New function. + (_dl_sysdep_output): Removed. The implementation in + `elf/dl-misc.c' now also works for the Hurd. + +1998-09-12 Mark Kettenis <kettenis@phys.uva.nl> + * hurd/hurdstartup.c: Do not include hurdmalloc.h; _hurd_startup does not use any of malloc/realloc/free anymore. Include set-hooks.h with <> instead of "". diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c index 7e8ed23a8b..efe33d7d0f 100644 --- a/sysdeps/mach/hurd/dl-sysdep.c +++ b/sysdeps/mach/hurd/dl-sysdep.c @@ -58,7 +58,16 @@ unsigned long int _dl_hwcap_mask = HWCAP_IMPORTANT; struct hurd_startup_data *_dl_hurd_data; -unsigned int __hurd_threadvar_max = _HURD_THREADVAR_MAX; +/* Defining these variables here avoids the inclusion of hurdsig.c. */ +unsigned long int __hurd_sigthread_stack_base; +unsigned long int __hurd_sigthread_stack_end; +unsigned long int *__hurd_sigthread_variables; + +/* Defining these variables here avoids the inclusion of init-first.c. + We need to provide temporary storage for the per-thread variables + of the main user thread here, since it is used for storing the + `errno' variable. Note that this information is lost once we + relocate the dynamic linker. */ static unsigned long int threadvars[_HURD_THREADVAR_MAX]; unsigned long int __hurd_threadvar_stack_offset = (unsigned long int) &threadvars; @@ -500,6 +509,21 @@ __libc_read (int fd, void *buf, size_t nbytes) return nread; } +__ssize_t weak_function +__libc_write (int fd, const void *buf, size_t nbytes) +{ + error_t err; + mach_msg_type_number_t nwrote; + + assert (fd < _hurd_init_dtablesize); + + err = __io_write (_hurd_init_dtable[fd], buf, nbytes, -1, &nwrote); + if (err) + return __hurd_fail (err); + + return nwrote; +} + off_t weak_function __lseek (int fd, off_t offset, int whence) { @@ -614,6 +638,14 @@ __getpid () return pid; } +char * +weak_function +__getcwd (char *buf, size_t size) +{ + abort (); + return NULL; +} + void weak_function _exit (int status) { @@ -645,7 +677,7 @@ abort (void) /* 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 weak, the real defn in libc.so will override it if we are linked into @@ -664,13 +696,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, timeout, notify); } -char * weak_function -__getcwd (char *buf, size_t size) /* XXX loser elf/dl-object.c */ -{ - abort (); - return NULL; -} - + void internal_function _dl_show_auxv (void) @@ -698,28 +724,3 @@ _dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz, *sz = 1; return result; } - - -void weak_function -_dl_sysdep_output (int fd, const char *msg, ...) -{ - va_list ap; - - assert(fd < _hurd_init_dtablesize); - - va_start (ap, msg); - do - { - size_t len = strlen (msg); - mach_msg_type_number_t nwrote; - do - { - if (__io_write (_hurd_init_dtable[fd], msg, len, -1, &nwrote)) - break; - len -= nwrote; - msg += nwrote; - } while (nwrote > 0); - msg = va_arg (ap, const char *); - } while (msg); - va_end (ap); -} |