diff options
author | Roland McGrath <roland@gnu.org> | 1995-02-22 05:47:15 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-02-22 05:47:15 +0000 |
commit | 50843ff068aae5b1ff58581eddd3bd107e99114b (patch) | |
tree | 0c72d59f78d63861d4a901fafd90cf6c3c822193 /sysdeps | |
parent | 23ad311df0e01caa58b54afb8ae999a3ffc1ba7a (diff) | |
download | glibc-50843ff068aae5b1ff58581eddd3bd107e99114b.tar.gz glibc-50843ff068aae5b1ff58581eddd3bd107e99114b.tar.xz glibc-50843ff068aae5b1ff58581eddd3bd107e99114b.zip |
Wed Feb 22 00:44:41 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/mach/hurd/i386/sigreturn.c: Restore the FPU state. * stdlib/random.c (__srandom): Change algorithm used to populate the state array. (randtbl): Recomputed with new algorithm.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/signame.c | 19 | ||||
-rw-r--r-- | sysdeps/generic/signame.h | 12 | ||||
-rw-r--r-- | sysdeps/mach/hurd/i386/sigreturn.c | 7 |
3 files changed, 31 insertions, 7 deletions
diff --git a/sysdeps/generic/signame.c b/sysdeps/generic/signame.c index 5f8deab3ad..40e72e0e4c 100644 --- a/sysdeps/generic/signame.c +++ b/sysdeps/generic/signame.c @@ -1,5 +1,5 @@ /* Convert between signal names and numbers. - Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -273,3 +273,20 @@ psignal (signal, message) fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]); } #endif + +#ifndef HAVE_STRSIGNAL +/* Return the string associated with the signal number. */ + +char * +strsignal (signal) + int signal; +{ + static char buf[] = "Signal 12345678901234567890"; + + if (signal > 0 || signal < NSIG) + return sys_siglist[signal]; + + sprintf (buf, "Signal %d", signal); + return buf; +} +#endif diff --git a/sysdeps/generic/signame.h b/sysdeps/generic/signame.h index 2bd1637cfc..3ff6d9a303 100644 --- a/sysdeps/generic/signame.h +++ b/sysdeps/generic/signame.h @@ -1,5 +1,5 @@ /* Convert between signal names and numbers. - Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ char *sig_abbrev (int number); signal by that name. */ int sig_number (const char *abbrev); -/* Avoid conflicts with a system header file that might define these two. */ +/* Avoid conflicts with a system header file that might define these three. */ #ifndef HAVE_PSIGNAL /* Print to standard error the name of SIGNAL, preceded by MESSAGE and @@ -37,6 +37,11 @@ int sig_number (const char *abbrev); void psignal (int signal, const char *message); #endif +#ifndef HAVE_STRSIGNAL +/* Return the name of SIGNAL. */ +char *strsignal (int signal); +#endif + #if !defined (HAVE_SYS_SIGLIST) /* Names for signals from 0 to NSIG-1. */ extern const char *sys_siglist[]; @@ -50,6 +55,9 @@ int sig_number (); #if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL) void psignal (); #endif +#ifndef HAVE_STRSIGNAL +char *strsignal (int signal); +#endif #if !defined (HAVE_SYS_SIGLIST) extern char *sys_siglist[]; #endif diff --git a/sysdeps/mach/hurd/i386/sigreturn.c b/sysdeps/mach/hurd/i386/sigreturn.c index df8960669f..19ba1d472c 100644 --- a/sysdeps/mach/hurd/i386/sigreturn.c +++ b/sysdeps/mach/hurd/i386/sigreturn.c @@ -80,10 +80,9 @@ __sigreturn (struct sigcontext *scp) *reply_port = scp->sc_reply_port; if (scp->sc_fpused) - { - /* XXX should restore FPU state here XXX roland needs 387 manual */ - /* abort (); */ - } + /* Restore the FPU state. Mach conveniently stores the state + in the format the i387 `frstor' instruction uses to restore it. */ + asm volatile ("frstor %0" : : "m" (scp->sc_fpsave)); { /* There are convenient instructions to pop state off the stack, so we |