glibc/hurd/hurdmsg.c

411 lines
9.4 KiB
C
Raw Normal View History

Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post rpc. * hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions instead of _hurd_split_args. (_S_msg_*_exec_flags): Functions removed. (_S_msg_startup_dosync): Stub removed. Sat May 4 02:11:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of EXEC_TRACED bit in _hurd_exec_flags. Pass sigcode arg in msg_sig_post_untraced rpc. * sysdeps/mach/hurd/access.c: Don't pass io port in auth_user_authenticate rpc. * posix/sched.h: Fix typos. * sysdeps/mach/hurd/fork.c: Use new critical section lock. Clear _hurdsig_traced instead of EXEC_TRACED. * sysdeps/stub/nanosleep.c (nanosleep): Fix typo. * wcsmbs/wcstol.c: Find strtol.c in ../stdlib. * wcsmbs/wcstof.c: Find strtod.c in ../stdlib. * wcsmbs/wcstod.c: Likewise. * wcsmbs/wcstold.c: Likewise. * wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype. * string/envz.c (envz_entry): Use const. (envz_get, envz_remove): Likewise. (envz_entry): Return char *, not const char *. * string/envz.h: Fix decl. * string/argz-create.c: Use const in prototype. * string/argz-next.c: Likewise. * sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post. * sysdeps/mach/hurd/i386/sigreturn.c: Likewise. * sysdeps/mach/hurd/sigsuspend.c: Likewise. * sysdeps/mach/hurd/kill.c: Likewise. * hurd/hurdexec.c (_hurd_exec): Use new critical section lock. * hurd/catch-exc.c (_S_catch_exception_raise): Likewise. * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise. * hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/sigaction.c: Likewise. * sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can change meaninglessly. * hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section flag with a spin lock. (_hurd_critical_section_lock): Use spin_try_lock on that to see if we get it. No need to take SS->lock at all. (_hurd_critical_section_unlock): Unlock SS->critical_section_lock instead of clearing the old flag member. * hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to test the critical section state. * hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray. * hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post. * hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). (_S_msg_sig_post): Take sigcode arg and pass it through. (_S_msg_sig_post_untraced): Likewise. (reauth_proc): Don't pass proc port in auth_user_authenticate. * hurd/setauth.c (_hurd_setauth): Don't pass object ports in auth_user_authenticate RPCs, just the one-off rendezvous port. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise. * hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec. Pass sigcode arg to msg_sig_post. * string/argz.h (argz_create): Use const in prototype. * hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). Pass sigcode arg to msg_sig_post. * hurd/hurd.h: Declare _hurdsig_traced. * string/argz.h (__argz_next): Cast ENTRY before returning it. * hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg to msg_sig_post. * hurd/path-lookup.c: New file. * hurd/Makefile (routines): Add path-lookup. * hurd/hurd/lookup.h: Declare file_name_path_scan, hurd_file_name_path_lookup. * hurd/hurd.h: Declare file_name_path_lookup. * sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID argument. Instead, use a separate reply port for each RPC and put them all in a port set to wait for slow replies.
1996-05-04 17:46:57 +08:00
/* Copyright (C) 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
1995-02-18 09:27:10 +08:00
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <hurd.h>
#include <hurd/msg_server.h>
#include <hurd/fd.h>
#include <unistd.h>
#include <limits.h>
#include <string.h>
Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post rpc. * hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions instead of _hurd_split_args. (_S_msg_*_exec_flags): Functions removed. (_S_msg_startup_dosync): Stub removed. Sat May 4 02:11:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of EXEC_TRACED bit in _hurd_exec_flags. Pass sigcode arg in msg_sig_post_untraced rpc. * sysdeps/mach/hurd/access.c: Don't pass io port in auth_user_authenticate rpc. * posix/sched.h: Fix typos. * sysdeps/mach/hurd/fork.c: Use new critical section lock. Clear _hurdsig_traced instead of EXEC_TRACED. * sysdeps/stub/nanosleep.c (nanosleep): Fix typo. * wcsmbs/wcstol.c: Find strtol.c in ../stdlib. * wcsmbs/wcstof.c: Find strtod.c in ../stdlib. * wcsmbs/wcstod.c: Likewise. * wcsmbs/wcstold.c: Likewise. * wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype. * string/envz.c (envz_entry): Use const. (envz_get, envz_remove): Likewise. (envz_entry): Return char *, not const char *. * string/envz.h: Fix decl. * string/argz-create.c: Use const in prototype. * string/argz-next.c: Likewise. * sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post. * sysdeps/mach/hurd/i386/sigreturn.c: Likewise. * sysdeps/mach/hurd/sigsuspend.c: Likewise. * sysdeps/mach/hurd/kill.c: Likewise. * hurd/hurdexec.c (_hurd_exec): Use new critical section lock. * hurd/catch-exc.c (_S_catch_exception_raise): Likewise. * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise. * hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/sigaction.c: Likewise. * sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can change meaninglessly. * hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section flag with a spin lock. (_hurd_critical_section_lock): Use spin_try_lock on that to see if we get it. No need to take SS->lock at all. (_hurd_critical_section_unlock): Unlock SS->critical_section_lock instead of clearing the old flag member. * hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to test the critical section state. * hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray. * hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post. * hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). (_S_msg_sig_post): Take sigcode arg and pass it through. (_S_msg_sig_post_untraced): Likewise. (reauth_proc): Don't pass proc port in auth_user_authenticate. * hurd/setauth.c (_hurd_setauth): Don't pass object ports in auth_user_authenticate RPCs, just the one-off rendezvous port. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise. * hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec. Pass sigcode arg to msg_sig_post. * string/argz.h (argz_create): Use const in prototype. * hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). Pass sigcode arg to msg_sig_post. * hurd/hurd.h: Declare _hurdsig_traced. * string/argz.h (__argz_next): Cast ENTRY before returning it. * hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg to msg_sig_post. * hurd/path-lookup.c: New file. * hurd/Makefile (routines): Add path-lookup. * hurd/hurd/lookup.h: Declare file_name_path_scan, hurd_file_name_path_lookup. * hurd/hurd.h: Declare file_name_path_lookup. * sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID argument. Instead, use a separate reply port for each RPC and put them all in a port set to wait for slow replies.
1996-05-04 17:46:57 +08:00
#include <argz.h>
1995-02-18 09:27:10 +08:00
#define AUTHCHECK \
if (auth != mach_task_self () && ! __USEPORT (AUTH, port == auth)) \
return EPERM
/* Snarfing and frobbing the init ports. */
kern_return_t
_S_msg_get_init_port (mach_port_t msgport, mach_port_t auth, int which,
mach_port_t *result, mach_msg_type_name_t *result_type)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
*result_type = MACH_MSG_TYPE_MOVE_SEND;
/* This function adds a new user reference for the *RESULT it gives back.
Our reply message uses a move-send right that consumes this reference. */
return _hurd_ports_get (which, result);
}
kern_return_t
_S_msg_set_init_port (mach_port_t msgport, mach_port_t auth,
int which, mach_port_t port)
1995-02-18 09:27:10 +08:00
{
error_t err;
AUTHCHECK;
err = _hurd_ports_set (which, port);
if (err == 0)
__mach_port_deallocate (__mach_task_self (), port);
return 0;
}
kern_return_t
_S_msg_get_init_ports (mach_port_t msgport, mach_port_t auth,
mach_port_t **ports,
mach_msg_type_name_t *ports_type,
mach_msg_type_number_t *nports)
1995-02-18 09:27:10 +08:00
{
mach_msg_type_number_t i;
error_t err;
AUTHCHECK;
if (err = __vm_allocate (__mach_task_self (), (vm_address_t *) ports,
_hurd_nports * sizeof (mach_port_t), 1))
return err;
*nports = _hurd_nports;
for (i = 0; i < _hurd_nports; ++i)
/* This function adds a new user ref for the *RESULT it gives back.
Our reply message uses move-send rights that consumes this ref. */
if (err = _hurd_ports_get (i, &(*ports)[i]))
{
/* Died part way through. Deallocate the ports already fetched. */
while (i-- > 0)
__mach_port_deallocate (__mach_task_self (), (*ports)[i]);
__vm_deallocate (__mach_task_self (),
(vm_address_t) *ports,
*nports * sizeof (mach_port_t));
return err;
}
*ports_type = MACH_MSG_TYPE_MOVE_SEND;
return 0;
}
kern_return_t
_S_msg_set_init_ports (mach_port_t msgport, mach_port_t auth,
mach_port_t *ports, mach_msg_type_number_t nports)
1995-02-18 09:27:10 +08:00
{
mach_msg_type_number_t i;
error_t err;
AUTHCHECK;
for (i = 0; i < _hurd_nports; ++i)
{
if (err = _hurd_ports_set (i, ports[i]))
return err;
else
__mach_port_deallocate (__mach_task_self (), ports[i]);
}
return 0;
}
/* Snarfing and frobbing the init ints. */
static kern_return_t
get_int (int which, int *value)
{
switch (which)
{
case INIT_UMASK:
*value = _hurd_umask;
return 0;
case INIT_SIGMASK:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
__spin_lock (&ss->lock);
*value = ss->blocked;
__spin_unlock (&ss->lock);
return 0;
}
case INIT_SIGPENDING:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
__spin_lock (&ss->lock);
*value = ss->pending;
__spin_unlock (&ss->lock);
return 0;
}
case INIT_SIGIGN:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
sigset_t ign;
int sig;
__spin_lock (&ss->lock);
__sigemptyset (&ign);
for (sig = 1; sig < NSIG; ++sig)
if (ss->actions[sig].sa_handler == SIG_IGN)
__sigaddset (&ign, sig);
__spin_unlock (&ss->lock);
*value = ign;
return 0;
}
default:
return EINVAL;
}
}
kern_return_t
_S_msg_get_init_int (mach_port_t msgport, mach_port_t auth,
int which, int *value)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
return get_int (which, value);
}
kern_return_t
_S_msg_get_init_ints (mach_port_t msgport, mach_port_t auth,
int **values, mach_msg_type_number_t *nvalues)
1995-02-18 09:27:10 +08:00
{
error_t err;
mach_msg_type_number_t i;
AUTHCHECK;
if (err = __vm_allocate (__mach_task_self (), (vm_address_t *) values,
INIT_INT_MAX * sizeof (int), 1))
return err;
*nvalues = INIT_INT_MAX;
for (i = 0; i < INIT_INT_MAX; ++i)
switch (err = get_int (i, &(*values)[i]))
{
case 0: /* Success. */
break;
case EINVAL: /* Unknown index. */
(*values)[i] = 0;
break;
default: /* Lossage. */
__vm_deallocate (__mach_task_self (),
(vm_address_t) *values, INIT_INT_MAX * sizeof (int));
return err;
}
return 0;
}
static kern_return_t
set_int (int which, int value)
{
switch (which)
{
case INIT_UMASK:
_hurd_umask = value;
return 0;
/* These are pretty odd things to do. But you asked for it. */
case INIT_SIGMASK:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
__spin_lock (&ss->lock);
ss->blocked = value;
__spin_unlock (&ss->lock);
return 0;
}
case INIT_SIGPENDING:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
__spin_lock (&ss->lock);
ss->pending = value;
__spin_unlock (&ss->lock);
return 0;
}
case INIT_SIGIGN:
{
struct hurd_sigstate *ss = _hurd_thread_sigstate (_hurd_sigthread);
int sig;
const sigset_t ign = value;
__spin_lock (&ss->lock);
for (sig = 1; sig < NSIG; ++sig)
{
if (__sigismember (&ign, sig))
ss->actions[sig].sa_handler = SIG_IGN;
else if (ss->actions[sig].sa_handler == SIG_IGN)
ss->actions[sig].sa_handler = SIG_DFL;
}
__spin_unlock (&ss->lock);
return 0;
1996-05-23 08:08:54 +08:00
case INIT_TRACEMASK:
_hurdsig_traced = value;
return 0;
1995-02-18 09:27:10 +08:00
}
default:
return EINVAL;
}
}
kern_return_t
_S_msg_set_init_int (mach_port_t msgport, mach_port_t auth,
int which, int value)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
return set_int (which, value);
}
kern_return_t
_S_msg_set_init_ints (mach_port_t msgport, mach_port_t auth,
int *values, mach_msg_type_number_t nvalues)
1995-02-18 09:27:10 +08:00
{
error_t err;
mach_msg_type_number_t i;
AUTHCHECK;
for (i = 0; i < INIT_INT_MAX; ++i)
switch (err = set_int (i, values[i]))
{
case 0: /* Success. */
break;
case EINVAL: /* Unknown index. */
break;
default: /* Lossage. */
return err;
}
return 0;
}
kern_return_t
_S_msg_get_fd (mach_port_t msgport, mach_port_t auth, int which,
mach_port_t *result, mach_msg_type_name_t *result_type)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
/* This creates a new user reference for the send right.
Our reply message will move that reference to the caller. */
*result = __getdport (which);
if (*result == MACH_PORT_NULL)
return errno;
*result_type = MACH_MSG_TYPE_MOVE_SEND;
return 0;
}
kern_return_t
_S_msg_set_fd (mach_port_t msgport, mach_port_t auth,
int which, mach_port_t port)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
/* We consume the reference if successful. */
return HURD_FD_USE (which, (_hurd_port2fd (descriptor, port, 0), 0));
}
/* Snarfing and frobbing environment variables. */
kern_return_t
_S_msg_get_env_variable (mach_port_t msgport,
char *variable,
char **data, mach_msg_type_number_t *datalen)
1995-02-18 09:27:10 +08:00
{
const char *value = getenv (variable);
if (value == NULL)
return ENOENT;
/* XXX this pointer might become invalid */
*data = value;
*datalen = strlen (value);
return 0;
}
kern_return_t
_S_msg_set_env_variable (mach_port_t msgport, mach_port_t auth,
char *variable,
char *value,
int replace)
1995-02-18 09:27:10 +08:00
{
AUTHCHECK;
if (setenv (variable, value, replace)) /* XXX name space */
return errno;
return 0;
}
kern_return_t
_S_msg_get_environment (mach_port_t msgport,
char **data, mach_msg_type_number_t *datalen)
1995-02-18 09:27:10 +08:00
{
/* Pack the environment into an array with nulls separating elements. */
if (__environ != NULL)
{
char *ap, **p;
size_t envlen = 0;
for (p = __environ; *p != NULL; ++p)
envlen += strlen (*p) + 1;
if (envlen > *datalen)
{
if (__vm_allocate (__mach_task_self (),
(vm_address_t *) data, envlen, 1))
return ENOMEM;
}
ap = *data;
for (p = __environ; *p != NULL; ++p)
ap = __memccpy (ap, *p, '\0', ULONG_MAX);
*datalen = envlen;
}
else
*datalen = 0;
return 0;
}
kern_return_t
_S_msg_set_environment (mach_port_t msgport, mach_port_t auth,
char *data, mach_msg_type_number_t datalen)
1995-02-18 09:27:10 +08:00
{
int _hurd_split_args (char *, mach_msg_type_number_t, char **);
int envc;
char **envp;
AUTHCHECK;
Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post rpc. * hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions instead of _hurd_split_args. (_S_msg_*_exec_flags): Functions removed. (_S_msg_startup_dosync): Stub removed. Sat May 4 02:11:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of EXEC_TRACED bit in _hurd_exec_flags. Pass sigcode arg in msg_sig_post_untraced rpc. * sysdeps/mach/hurd/access.c: Don't pass io port in auth_user_authenticate rpc. * posix/sched.h: Fix typos. * sysdeps/mach/hurd/fork.c: Use new critical section lock. Clear _hurdsig_traced instead of EXEC_TRACED. * sysdeps/stub/nanosleep.c (nanosleep): Fix typo. * wcsmbs/wcstol.c: Find strtol.c in ../stdlib. * wcsmbs/wcstof.c: Find strtod.c in ../stdlib. * wcsmbs/wcstod.c: Likewise. * wcsmbs/wcstold.c: Likewise. * wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype. * string/envz.c (envz_entry): Use const. (envz_get, envz_remove): Likewise. (envz_entry): Return char *, not const char *. * string/envz.h: Fix decl. * string/argz-create.c: Use const in prototype. * string/argz-next.c: Likewise. * sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post. * sysdeps/mach/hurd/i386/sigreturn.c: Likewise. * sysdeps/mach/hurd/sigsuspend.c: Likewise. * sysdeps/mach/hurd/kill.c: Likewise. * hurd/hurdexec.c (_hurd_exec): Use new critical section lock. * hurd/catch-exc.c (_S_catch_exception_raise): Likewise. * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise. * hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/sigaction.c: Likewise. * sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can change meaninglessly. * hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section flag with a spin lock. (_hurd_critical_section_lock): Use spin_try_lock on that to see if we get it. No need to take SS->lock at all. (_hurd_critical_section_unlock): Unlock SS->critical_section_lock instead of clearing the old flag member. * hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to test the critical section state. * hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray. * hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post. * hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). (_S_msg_sig_post): Take sigcode arg and pass it through. (_S_msg_sig_post_untraced): Likewise. (reauth_proc): Don't pass proc port in auth_user_authenticate. * hurd/setauth.c (_hurd_setauth): Don't pass object ports in auth_user_authenticate RPCs, just the one-off rendezvous port. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise. * hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec. Pass sigcode arg to msg_sig_post. * string/argz.h (argz_create): Use const in prototype. * hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). Pass sigcode arg to msg_sig_post. * hurd/hurd.h: Declare _hurdsig_traced. * string/argz.h (__argz_next): Cast ENTRY before returning it. * hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg to msg_sig_post. * hurd/path-lookup.c: New file. * hurd/Makefile (routines): Add path-lookup. * hurd/hurd/lookup.h: Declare file_name_path_scan, hurd_file_name_path_lookup. * hurd/hurd.h: Declare file_name_path_lookup. * sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID argument. Instead, use a separate reply port for each RPC and put them all in a port set to wait for slow replies.
1996-05-04 17:46:57 +08:00
envc = __argz_count (data, datalen);
1995-02-18 09:27:10 +08:00
envp = malloc ((envc + 1) * sizeof (char *));
if (envp == NULL)
return errno;
Sat May 4 05:44:25 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * hurd/hurd-raise.c (_hurd_raise_signal): Pass sigcode in msg_sig_post rpc. * hurd/hurdmsg.c (_S_msg_set_environment): Use argz.h functions instead of _hurd_split_args. (_S_msg_*_exec_flags): Functions removed. (_S_msg_startup_dosync): Stub removed. Sat May 4 02:11:55 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> * sysdeps/mach/hurd/ptrace.c: Set _hurdsig_traced instead of EXEC_TRACED bit in _hurd_exec_flags. Pass sigcode arg in msg_sig_post_untraced rpc. * sysdeps/mach/hurd/access.c: Don't pass io port in auth_user_authenticate rpc. * posix/sched.h: Fix typos. * sysdeps/mach/hurd/fork.c: Use new critical section lock. Clear _hurdsig_traced instead of EXEC_TRACED. * sysdeps/stub/nanosleep.c (nanosleep): Fix typo. * wcsmbs/wcstol.c: Find strtol.c in ../stdlib. * wcsmbs/wcstof.c: Find strtod.c in ../stdlib. * wcsmbs/wcstod.c: Likewise. * wcsmbs/wcstold.c: Likewise. * wcsmbs/wcwidth.h: Find cname-lookup.h in ../wctype. * string/envz.c (envz_entry): Use const. (envz_get, envz_remove): Likewise. (envz_entry): Return char *, not const char *. * string/envz.h: Fix decl. * string/argz-create.c: Use const in prototype. * string/argz-next.c: Likewise. * sysdeps/mach/hurd/sigprocmask.c: Pass sigcode arg to msg_sig_post. * sysdeps/mach/hurd/i386/sigreturn.c: Likewise. * sysdeps/mach/hurd/sigsuspend.c: Likewise. * sysdeps/mach/hurd/kill.c: Likewise. * hurd/hurdexec.c (_hurd_exec): Use new critical section lock. * hurd/catch-exc.c (_S_catch_exception_raise): Likewise. * hurd/sigunwind.c (_hurdsig_longjmp_from_handler): Likewise. * hurd/thread-cancel.c (hurd_thread_cancel, hurd_check_cancel): Likewise. * sysdeps/mach/hurd/jmp-unwind.c (_longjmp_unwind): Likewise. * sysdeps/mach/hurd/sigaction.c: Likewise. * sysdeps/mach/hurd/errnos.awk: Don't use ARGV in comment; it can change meaninglessly. * hurd/hurd/signal.h (struct hurd_sigstate): Replace critical section flag with a spin lock. (_hurd_critical_section_lock): Use spin_try_lock on that to see if we get it. No need to take SS->lock at all. (_hurd_critical_section_unlock): Unlock SS->critical_section_lock instead of clearing the old flag member. * hurd/hurdsig.c (_hurd_internal_post_signal): Use spin_lock_locked to test the critical section state. * hurd/hurdinit.c (_hurd_init): Set _hurdsig_traced from the intarray. * hurd/hurdkill.c (_hurd_sig_post): Pass 0 sigcode in msg_sig_post. * hurd/hurdsig.c (_hurd_internal_post_signal): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). (_S_msg_sig_post): Take sigcode arg and pass it through. (_S_msg_sig_post_untraced): Likewise. (reauth_proc): Don't pass proc port in auth_user_authenticate. * hurd/setauth.c (_hurd_setauth): Don't pass object ports in auth_user_authenticate RPCs, just the one-off rendezvous port. * hurd/dtable.c (reauth_dtable): Likewise. * hurd/hurdlookup.c (__hurd_file_name_lookup_retry): Likewise. * hurd/hurdexec.c (_hurd_exec): Pass 0 flags to file_exec. Pass sigcode arg to msg_sig_post. * string/argz.h (argz_create): Use const in prototype. * hurd/hurdinit.c (_hurd_proc_init): Test _hurdsig_traced instead of testing (_hurd_exec_flags & EXEC_TRACED). Pass sigcode arg to msg_sig_post. * hurd/hurd.h: Declare _hurdsig_traced. * string/argz.h (__argz_next): Cast ENTRY before returning it. * hurd/hurd/signal.h (_hurd_critical_section_unlock): Pass sigcode arg to msg_sig_post. * hurd/path-lookup.c: New file. * hurd/Makefile (routines): Add path-lookup. * hurd/hurd/lookup.h: Declare file_name_path_scan, hurd_file_name_path_lookup. * hurd/hurd.h: Declare file_name_path_lookup. * sysdeps/mach/hurd/select.c: The io_select rpc no longer has a TAG_ID argument. Instead, use a separate reply port for each RPC and put them all in a port set to wait for slow replies.
1996-05-04 17:46:57 +08:00
__argz_extract (data, datalen, envp);
1995-02-18 09:27:10 +08:00
__environ = envp; /* XXX cooperate with loadenv et al */
return 0;
}
/* XXX */
kern_return_t
_S_msg_get_dtable (mach_port_t process,
mach_port_t refport,
portarray_t *dtable,
mach_msg_type_name_t *dtablePoly,
mach_msg_type_number_t *dtableCnt)
1995-02-18 09:27:10 +08:00
{ return EOPNOTSUPP; }
kern_return_t
_S_msg_set_dtable (mach_port_t process,
mach_port_t refport,
portarray_t dtable,
mach_msg_type_number_t dtableCnt)
1995-02-18 09:27:10 +08:00
{ return EOPNOTSUPP; }