Tue May 7 10:51:52 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>

* wcsmbs/wcwidth.c, wcsmbs/wcswidth.c: Fixed typos.

	* sysdeps/unix/sysv/linux/sys/mman.h: Fixed typo.

	* sysdeps/stub/sched_getp.c: Add missing #include <sys/types.h>.
	* sysdeps/stub/sched_sets.c: Likewise.
	* sysdeps/stub/sched_setp.c: Likewise.
	* sysdeps/stub/sched_rr_gi.c: Likewise.
	* sysdeps/stub/sched_gets.c: Likewise.

	* hurd/hurdsig.c: Use struct hurd_signal_detail.
	* hurd/hurd/fd.h (_hurd_fd_error): Likewise.
	* sysdeps/mach/hurd/sysd-stdio.c (fd_fail): Likewise.
This commit is contained in:
Roland McGrath 1996-05-07 14:57:38 +00:00
parent 4ddc1f9dd6
commit 93a470c71a
14 changed files with 81 additions and 37 deletions

View File

@ -1,3 +1,19 @@
Tue May 7 10:51:52 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* wcsmbs/wcwidth.c, wcsmbs/wcswidth.c: Fixed typos.
* sysdeps/unix/sysv/linux/sys/mman.h: Fixed typo.
* sysdeps/stub/sched_getp.c: Add missing #include <sys/types.h>.
* sysdeps/stub/sched_sets.c: Likewise.
* sysdeps/stub/sched_setp.c: Likewise.
* sysdeps/stub/sched_rr_gi.c: Likewise.
* sysdeps/stub/sched_gets.c: Likewise.
* hurd/hurdsig.c: Use struct hurd_signal_detail.
* hurd/hurd/fd.h (_hurd_fd_error): Likewise.
* sysdeps/mach/hurd/sysd-stdio.c (fd_fail): Likewise.
Mon May 6 09:51:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> Mon May 6 09:51:05 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdio/linewrap.c: New file. * stdio/linewrap.c: New file.

View File

@ -1,5 +1,5 @@
/* File descriptors. /* File descriptors.
Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -160,7 +160,11 @@ _hurd_fd_error (int fd, error_t err)
{ {
int signo = _hurd_fd_error_signal (err); int signo = _hurd_fd_error_signal (err);
if (signo) if (signo)
_hurd_raise_signal (NULL, signo, fd, err); {
const struct hurd_signal_detail detail
= { code: fd, error: err, exc: 0 };
_hurd_raise_signal (NULL, signo, &detail);
}
return err; return err;
} }

View File

@ -43,6 +43,18 @@ Cambridge, MA 02139, USA. */
struct hurd_signal_preempter; /* <hurd/sigpreempt.h> */ struct hurd_signal_preempter; /* <hurd/sigpreempt.h> */
/* Full details of a signal. */
struct hurd_signal_detail
{
/* Codes from origination Mach exception_raise message. */
integer_t exc, exc_code, exc_subcode;
/* Sigcode as passed or computed from exception codes. */
integer_t code;
/* Error code as passed or extracted from exception codes. */
error_t error;
};
/* Per-thread signal state. */ /* Per-thread signal state. */
struct hurd_sigstate struct hurd_sigstate
@ -65,13 +77,8 @@ struct hurd_sigstate
stack frame, and each next element in an outermore frame. */ stack frame, and each next element in an outermore frame. */
struct hurd_signal_preempter *preempters; struct hurd_signal_preempter *preempters;
struct /* For each signal that may be pending, the details to deliver it with. */
{ struct hurd_signal_detail pending_data[NSIG];
/* For each signal that may be pending, the
sigcode and error code to deliver it with. */
long int code;
error_t error;
} pending_data[NSIG];
/* If `suspended' is set when this thread gets a signal, /* If `suspended' is set when this thread gets a signal,
the signal thread sends an empty message to it. */ the signal thread sends an empty message to it. */
@ -217,27 +224,27 @@ extern void _hurdsig_init (void);
extern void _hurdsig_fault_init (void); extern void _hurdsig_fault_init (void);
/* Raise a signal as described by SIGNO, SIGCODE and SIGERROR, on the /* Raise a signal as described by SIGNO an DETAIL, on the thread whose
thread whose sigstate SS points to. If SS is a null pointer, this sigstate SS points to. If SS is a null pointer, this instead affects
instead affects the calling thread. */ the calling thread. */
extern void _hurd_raise_signal (struct hurd_sigstate *ss, extern void _hurd_raise_signal (struct hurd_sigstate *ss, int signo,
int signo, long int sigcode, int sigerror); const struct hurd_signal_detail *detail);
/* Translate a Mach exception into a signal (machine-dependent). */ /* Translate a Mach exception into a signal (machine-dependent). */
extern void _hurd_exception2signal (int exception, int code, int subcode, extern void _hurd_exception2signal (struct hurd_signal_detail *);
int *signo, long int *sigcode, int *error);
/* Make the thread described by SS take the signal described by SIGNO and /* Make the thread described by SS take the signal described by SIGNO and
SIGCODE. If the process is traced, this will in fact stop with a SIGNO DETAIL. If the process is traced, this will in fact stop with a SIGNO
as the stop signal unless UNTRACED is nonzero. When the signal can be as the stop signal unless UNTRACED is nonzero. When the signal can be
considered delivered, sends a sig_post reply message on REPLY_PORT considered delivered, sends a sig_post reply message on REPLY_PORT
indicating success. SS is not locked. */ indicating success. SS is not locked. */
extern void _hurd_internal_post_signal (struct hurd_sigstate *ss, extern void _hurd_internal_post_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int error, int signo,
struct hurd_signal_detail *detail,
mach_port_t reply_port, mach_port_t reply_port,
mach_msg_type_name_t reply_port_type, mach_msg_type_name_t reply_port_type,
int untraced); int untraced);
@ -252,7 +259,7 @@ extern void _hurd_internal_post_signal (struct hurd_sigstate *ss,
struct machine_thread_all_state; struct machine_thread_all_state;
extern struct sigcontext * extern struct sigcontext *
_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler,
int signo, long int sigcode, int signo, const struct hurd_signal_detail *detail,
int rpc_wait, struct machine_thread_all_state *state); int rpc_wait, struct machine_thread_all_state *state);
/* Function run by the signal thread to receive from the signal port. */ /* Function run by the signal thread to receive from the signal port. */

View File

@ -23,6 +23,7 @@ Cambridge, MA 02139, USA. */
#include <errno.h> #include <errno.h>
#include <signal.h> /* For sigset_t, sighandler_t, SIG_ERR. */ #include <signal.h> /* For sigset_t, sighandler_t, SIG_ERR. */
struct hurd_sigstate; /* <hurd/signal.h> */ struct hurd_sigstate; /* <hurd/signal.h> */
struct hurd_signal_detail; /* <hurd/signal.h> */
struct hurd_signal_preempter struct hurd_signal_preempter
{ {
@ -39,7 +40,7 @@ struct hurd_signal_preempter
is processed as if the return value were its handler setting. */ is processed as if the return value were its handler setting. */
sighandler_t (*preempter) (struct hurd_signal_preempter *preempter, sighandler_t (*preempter) (struct hurd_signal_preempter *preempter,
struct hurd_sigstate *ss, struct hurd_sigstate *ss,
int *signo, long int *sigcode, int *sigerror); int *signo, struct hurd_signal_detail *detail);
/* If PREEMPTER is null, act as if it returned HANDLER. */ /* If PREEMPTER is null, act as if it returned HANDLER. */
sighandler_t handler; sighandler_t handler;

View File

@ -428,7 +428,7 @@ sigset_t _hurdsig_preempted_set;
/* Deliver a signal. SS is not locked. */ /* Deliver a signal. SS is not locked. */
void void
_hurd_internal_post_signal (struct hurd_sigstate *ss, _hurd_internal_post_signal (struct hurd_sigstate *ss,
int signo, long int sigcode, int sigerror, int signo, struct hurd_signal_detail *detail,
mach_port_t reply_port, mach_port_t reply_port,
mach_msg_type_name_t reply_port_type, mach_msg_type_name_t reply_port_type,
int untraced) int untraced)
@ -459,10 +459,9 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
void mark_pending (void) void mark_pending (void)
{ {
__sigaddset (&ss->pending, signo); __sigaddset (&ss->pending, signo);
/* Save the code to be given to the handler when SIGNO is /* Save the details to be given to the handler when SIGNO is
unblocked. */ unblocked. */
ss->pending_data[signo].code = sigcode; ss->pending_data[signo] = *detail;
ss->pending_data[signo].error = sigerror;
} }
/* Suspend the process with SIGNO. */ /* Suspend the process with SIGNO. */
@ -540,8 +539,8 @@ _hurd_internal_post_signal (struct hurd_sigstate *ss,
handler = SIG_ERR; handler = SIG_ERR;
for (pe = ss->preempters; pe && handler == SIG_ERR; pe = pe->next) for (pe = ss->preempters; pe && handler == SIG_ERR; pe = pe->next)
if (HURD_PREEMPT_SIGNAL_P (pe, signo, sigcode)) if (HURD_PREEMPT_SIGNAL_P (pe, signo, detail->code))
handler = (*pe->preempter) (pe, ss, &signo, &sigcode, &sigerror); handler = (*pe->preempter) (pe, ss, &signo, detail);
if (handler == SIG_ERR && (__sigmask (signo) & _hurdsig_preempted_set)) if (handler == SIG_ERR && (__sigmask (signo) & _hurdsig_preempted_set))
{ {
@ -1061,14 +1060,18 @@ _S_msg_sig_post (mach_port_t me,
mach_port_t refport) mach_port_t refport)
{ {
error_t err; error_t err;
struct hurd_signal_detail d;
if (err = signal_allowed (signo, refport)) if (err = signal_allowed (signo, refport))
return err; return err;
d.code = sigcode;
d.exc = 0;
/* Post the signal to the designated signal-receiving thread. This will /* Post the signal to the designated signal-receiving thread. This will
reply when the signal can be considered delivered. */ reply when the signal can be considered delivered. */
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread), _hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
signo, sigcode, 0, reply_port, reply_port_type, signo, &d, reply_port, reply_port_type,
0); /* Stop if traced. */ 0); /* Stop if traced. */
return MIG_NO_REPLY; /* Already replied. */ return MIG_NO_REPLY; /* Already replied. */
@ -1085,14 +1088,18 @@ _S_msg_sig_post_untraced (mach_port_t me,
mach_port_t refport) mach_port_t refport)
{ {
error_t err; error_t err;
struct hurd_signal_detail d;
if (err = signal_allowed (signo, refport)) if (err = signal_allowed (signo, refport))
return err; return err;
d.code = sigcode;
d.exc = 0;
/* Post the signal to the designated signal-receiving thread. This will /* Post the signal to the designated signal-receiving thread. This will
reply when the signal can be considered delivered. */ reply when the signal can be considered delivered. */
_hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread), _hurd_internal_post_signal (_hurd_thread_sigstate (_hurd_sigthread),
signo, sigcode, 0, reply_port, reply_port_type, signo, &d, reply_port, reply_port_type,
1); /* Untraced flag. */ 1); /* Untraced flag. */
return MIG_NO_REPLY; /* Already replied. */ return MIG_NO_REPLY; /* Already replied. */

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc. /* Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
@ -34,7 +34,11 @@ fd_fail (struct hurd_fd *fd, error_t err)
{ {
int signo = _hurd_fd_error_signal (err); int signo = _hurd_fd_error_signal (err);
if (signo) if (signo)
_hurd_raise_signal (NULL, signo, __stdio_fileno (fd), err); {
const struct hurd_signal_detail detail
= { code: __stdio_fileno (fd), error: err, exc: 0 };
_hurd_raise_signal (NULL, signo, &detail);
}
errno = err; errno = err;
return -1; return -1;
} }

View File

@ -17,12 +17,13 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <errno.h> #include <errno.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
/* Retrieve scheduling parameters for a particular process. */ /* Retrieve scheduling parameters for a particular process. */
int int
__sched_getparam (pid_t pid, struct sched_param *param) __sched_getparam (pid_t pid, struct sched_params *param)
{ {
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;

View File

@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */
#include <errno.h> #include <errno.h>
#include <sched.h> #include <sched.h>
#include <sys/types.h>
/* Retrieve scheduling algorithm for a particular purpose. */ /* Retrieve scheduling algorithm for a particular purpose. */

View File

@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */
#include <errno.h> #include <errno.h>
#include <sched.h> #include <sched.h>
#include <sys/types.h>
/* Get the SCHED_RR interval for the named process. */ /* Get the SCHED_RR interval for the named process. */

View File

@ -17,12 +17,13 @@ not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <errno.h> #include <errno.h>
#include <sys/types.h>
#include <sched.h> #include <sched.h>
/* Set scheduling parameters for a process. */ /* Set scheduling parameters for a process. */
int int
__sched_setparam (pid_t pid, const struct sched_param *param) __sched_setparam (pid_t pid, const struct sched_params *param)
{ {
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;

View File

@ -18,11 +18,12 @@ Boston, MA 02111-1307, USA. */
#include <errno.h> #include <errno.h>
#include <sched.h> #include <sched.h>
#include <sys/types.h>
/* Set scheduling algorithm and/or parameters for a process. */ /* Set scheduling algorithm and/or parameters for a process. */
int int
__sched_setscheduler (pid_t pid, int policy, const struct sched_param *param) __sched_setscheduler (pid_t pid, int policy, const struct sched_params *param)
{ {
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;

View File

@ -89,7 +89,7 @@ int mlock __P ((__caddr_t __addr, size_t __len));
int munlock __P ((__caddr_t __addr, size_t __len)); int munlock __P ((__caddr_t __addr, size_t __len));
/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length /* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
NEW_LEN. If MAY_MOVE is MREMAP_MAXMOVE the returned address may NEW_LEN. If MAY_MOVE is MREMAP_MAYMOVE the returned address may
differ from ADDR. */ differ from ADDR. */
__caddr_t __mremap __P ((__caddr_t __addr, size_t __old_len, size_t __new_len, __caddr_t __mremap __P ((__caddr_t __addr, size_t __old_len, size_t __new_len,
int __may_move)); int __may_move));

View File

@ -1,6 +1,6 @@
/* Copyright (C) 1996 Free Software Foundation, Inc. /* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edi>, 1996. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
The GNU C Library is free software; you can redistribute it and/or 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 modify it under the terms of the GNU Library General Public License as

View File

@ -1,6 +1,6 @@
/* Copyright (C) 1996 Free Software Foundation, Inc. /* Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edi>, 1996. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
The GNU C Library is free software; you can redistribute it and/or 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 modify it under the terms of the GNU Library General Public License as