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 "".
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;
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)
{
return pid;
}
+char *
+weak_function
+__getcwd (char *buf, size_t size)
+{
+ abort ();
+ return NULL;
+}
+
void weak_function
_exit (int status)
{
/* Try for ever and ever. */
ABORT_INSTRUCTION;
}
-
+\f
/* 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
timeout, notify);
}
-char * weak_function
-__getcwd (char *buf, size_t size) /* XXX loser elf/dl-object.c */
-{
- abort ();
- return NULL;
-}
-\f
+
void
internal_function
_dl_show_auxv (void)
*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);
-}