aboutsummaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-23 22:09:31 +0000
committerMiles Bader <miles@gnu.org>1997-02-23 22:09:31 +0000
commit6bac11d99322f3cdf751b43dc3b3456039fab26c (patch)
treebdec620c134a6b498fc21ea5d3825762a79ed558 /hurd
parent4dea6fa212ba120779f4a1f9237e02b20ab74aa5 (diff)
downloadglibc-6bac11d99322f3cdf751b43dc3b3456039fab26c.tar
glibc-6bac11d99322f3cdf751b43dc3b3456039fab26c.tar.gz
glibc-6bac11d99322f3cdf751b43dc3b3456039fab26c.tar.bz2
glibc-6bac11d99322f3cdf751b43dc3b3456039fab26c.zip
(__libc_argv, __libc_argc): Make extern. (__hurd_threadvar_max, __hurd_threadvar_stack_offset, __hurd_threadvar_stack_mask): New variables.cvs/libc-970224
Diffstat (limited to 'hurd')
-rw-r--r--hurd/fchroot.c8
-rw-r--r--hurd/getdport.c3
-rw-r--r--hurd/hurd.h5
-rw-r--r--hurd/hurd/threadvar.h1
-rw-r--r--hurd/hurdfault.c5
-rw-r--r--hurd/hurdinit.c2
-rw-r--r--hurd/hurdsig.c10
-rw-r--r--hurd/hurdstartup.c9
-rw-r--r--hurd/report-wait.c13
9 files changed, 37 insertions, 19 deletions
diff --git a/hurd/fchroot.c b/hurd/fchroot.c
index d745fb0866..143ea23807 100644
--- a/hurd/fchroot.c
+++ b/hurd/fchroot.c
@@ -35,7 +35,13 @@ fchroot (int fd)
}));
if (! err)
- _hurd_port_set (&_hurd_ports[INIT_PORT_CRDIR], dir);
+ {
+ file_t root;
+ err = __file_reparent (dir, MACH_PORT_NULL, &root);
+ __mach_port_deallocate (__mach_task_self (), dir);
+ if (! err)
+ _hurd_port_set (&_hurd_ports[INIT_PORT_CRDIR], root);
+ }
return err ? __hurd_fail (err) : 0;
}
diff --git a/hurd/getdport.c b/hurd/getdport.c
index a274a710f7..b58832dbe4 100644
--- a/hurd/getdport.c
+++ b/hurd/getdport.c
@@ -20,7 +20,8 @@
/* This is initialized in dtable.c when that gets linked in.
If dtable.c is not linked in, it will be zero. */
-file_t (*_hurd_getdport_fn) (int fd);
+static file_t (*_default_hurd_getdport_fn) (int fd) = 0;
+weak_alias (_default_hurd_getdport_fn, _hurd_getdport_fn)
file_t
__getdport (int fd)
diff --git a/hurd/hurd.h b/hurd/hurd.h
index 3874fb277b..7e72bf6cf3 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -109,11 +109,10 @@ extern pid_t _hurd_pid, _hurd_ppid, _hurd_pgrp;
extern int _hurd_orphaned;
/* This variable is incremented every time the process IDs change. */
-
-unsigned int _hurd_pids_changed_stamp;
+extern unsigned int _hurd_pids_changed_stamp;
/* This condition is broadcast every time the process IDs change. */
-struct condition _hurd_pids_changed_sync;
+extern struct condition _hurd_pids_changed_sync;
/* Unix `data break', for brk and sbrk.
If brk and sbrk are not used, this info will not be initialized or used. */
diff --git a/hurd/hurd/threadvar.h b/hurd/hurd/threadvar.h
index 091e745914..b10efe9ada 100644
--- a/hurd/hurd/threadvar.h
+++ b/hurd/hurd/threadvar.h
@@ -60,6 +60,7 @@ enum __hurd_threadvar_index
_HURD_THREADVAR_ERRNO, /* `errno' value for this thread. */
_HURD_THREADVAR_SIGSTATE, /* This thread's `struct hurd_sigstate'. */
_HURD_THREADVAR_DYNAMIC_USER, /* Dynamically-assigned user variables. */
+ _HURD_THREADVAR_MALLOC, /* For use of malloc. */
_HURD_THREADVAR_MAX /* Default value for __hurd_threadvar_max. */
};
diff --git a/hurd/hurdfault.c b/hurd/hurdfault.c
index 2865ff7d34..671f8cb21a 100644
--- a/hurd/hurdfault.c
+++ b/hurd/hurdfault.c
@@ -1,5 +1,5 @@
/* Handle faults in the signal thread.
- Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997 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
@@ -31,6 +31,9 @@
jmp_buf _hurdsig_fault_env;
struct hurd_signal_preemptor _hurdsig_fault_preemptor;
+/* XXX temporary to deal with spelling fix */
+weak_alias (_hurdsig_fault_preemptor, _hurdsig_fault_preempter)
+
static mach_port_t forward_sigexc;
kern_return_t
diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c
index 425b9b717c..0d0f4b4ea9 100644
--- a/hurd/hurdinit.c
+++ b/hurd/hurdinit.c
@@ -31,7 +31,9 @@ struct hurd_port *_hurd_ports;
unsigned int _hurd_nports;
mode_t _hurd_umask;
sigset_t _hurdsig_traced;
+
char **__libc_argv;
+int __libc_argc;
error_t
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index b30134ca5b..6ebd7bed14 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -39,6 +39,11 @@ thread_t _hurd_msgport_thread;
/* Thread which receives task-global signals. */
thread_t _hurd_sigthread;
+/* These are set up by _hurdsig_init. */
+unsigned long int __hurd_sigthread_stack_base;
+unsigned long int __hurd_sigthread_stack_end;
+unsigned long int *__hurd_sigthread_variables;
+
/* Linked-list of per-thread signal state. */
struct hurd_sigstate *_hurd_sigstates;
@@ -424,6 +429,9 @@ abort_all_rpcs (int signo, struct machine_thread_all_state *state, int live)
struct hurd_signal_preemptor *_hurdsig_preemptors;
sigset_t _hurdsig_preempted_set;
+/* XXX temporary to deal with spelling fix */
+weak_alias (_hurdsig_preemptors, _hurdsig_preempters)
+
/* Mask of stop signals. */
#define STOPSIGS (sigmask (SIGTTIN) | sigmask (SIGTTOU) | \
sigmask (SIGSTOP) | sigmask (SIGTSTP))
diff --git a/hurd/hurdstartup.c b/hurd/hurdstartup.c
index 3531c0e8cf..543d135120 100644
--- a/hurd/hurdstartup.c
+++ b/hurd/hurdstartup.c
@@ -35,15 +35,6 @@
mach_port_t *_hurd_init_dtable;
mach_msg_type_number_t _hurd_init_dtablesize;
-unsigned int __hurd_threadvar_max;
-unsigned long int __hurd_threadvar_stack_mask;
-unsigned long int __hurd_threadvar_stack_offset;
-
-/* These are set up by _hurdsig_init. */
-unsigned long int __hurd_sigthread_stack_base;
-unsigned long int __hurd_sigthread_stack_end;
-unsigned long int *__hurd_sigthread_variables;
-
extern void __mach_init (void);
/* Entry point. This is the first thing in the text segment.
diff --git a/hurd/report-wait.c b/hurd/report-wait.c
index 751619233c..e8f4f1af4a 100644
--- a/hurd/report-wait.c
+++ b/hurd/report-wait.c
@@ -93,8 +93,15 @@ describe_port (string_t description, mach_port_t port)
}
-/* Common defn so we don't link in the itimer code unnecessarily. */
-thread_t _hurd_itimer_thread; /* XXX */
+/* We want _HURD_ITIMER_THREAD, but don't want to link in the itimer code
+ unnecessarily. */
+#if 0 /* libc.so.0.0 needs this defined, so make it a weak alias for now. */
+extern thread_t _hurd_itimer_thread; /* XXX */
+weak_extern (_hurd_itimer_thread)
+#else
+static thread_t default_hurd_itimer_thread;
+weak_alias (default_hurd_itimer_thread, _hurd_itimer_thread)
+#endif
kern_return_t
_S_msg_report_wait (mach_port_t msgport, thread_t thread,
@@ -105,7 +112,7 @@ _S_msg_report_wait (mach_port_t msgport, thread_t thread,
if (thread == _hurd_msgport_thread)
/* Cute. */
strcpy (description, "msgport");
- else if (thread == _hurd_itimer_thread)
+ else if (&_hurd_msgport_thread && thread == _hurd_itimer_thread)
strcpy (description, "itimer");
else
{