From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: ralf@uni-koblenz.de
Cc: linux@cthulhu.engr.sgi.com
Subject: Re: tcsh
Date: Sat, 4 Jul 1998 00:37:29 +0200 [thread overview]
Message-ID: <19980704003729.14342@alpha.franken.de> (raw)
In-Reply-To: <19980703165855.C435@uni-koblenz.de>; from ralf@uni-koblenz.de on Fri, Jul 03, 1998 at 04:58:55PM +0200
On Fri, Jul 03, 1998 at 04:58:55PM +0200, ralf@uni-koblenz.de wrote:
> Sigpause() is a libc routine in libc/sysdeps/posix/sigpause.c; it's either
> using sigprocmask(2) or sigsuspend(2).
it's sigsuspend. And after looking at scall_o32.S and realizing that
calling do_signal() needs to have the static registers saved/restored,
the bug is obvious (I also had a look at the Alpha sys_sigsuspend). Below
is a patch, which fixes tcsh and other programs, which use sigsupend.
If everybody agrees with the patch, I'll check it in.
Thomas.
Index: scall_o32.S
===================================================================
RCS file: /var/mips/linus/cvs/linux/arch/mips/kernel/scall_o32.S,v
retrieving revision 1.3
diff -u -r1.3 scall_o32.S
--- scall_o32.S 1998/03/27 04:47:55 1.3
+++ scall_o32.S 1998/07/03 22:32:56
@@ -98,6 +98,18 @@
jal schedule
b o32_ret_from_sys_call
+EXPORT(sys_sigsuspend)
+ SAVE_STATIC
+ jal do_sigsuspend
+ RESTORE_STATIC
+ b o32_ret_from_sys_call
+
+EXPORT(sys_rt_sigsuspend)
+ SAVE_STATIC
+ jal do_rt_sigsuspend
+ RESTORE_STATIC
+ b o32_ret_from_sys_call
+
/* ------------------------------------------------------------------------ */
trace_a_syscall:
Index: signal.c
===================================================================
RCS file: /var/mips/linus/cvs/linux/arch/mips/kernel/signal.c,v
retrieving revision 1.12
diff -u -r1.12 signal.c
--- signal.c 1998/04/05 11:23:53 1.12
+++ signal.c 1998/07/03 22:31:58
@@ -38,8 +38,8 @@
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
-asmlinkage inline int
-sys_sigsuspend(struct pt_regs regs)
+int
+do_sigsuspend(struct pt_regs regs)
{
sigset_t *uset, saveset, newset;
@@ -62,8 +62,8 @@
}
}
-asmlinkage int
-sys_rt_sigsuspend(struct pt_regs regs)
+int
+do_rt_sigsuspend(struct pt_regs regs)
{
sigset_t *uset, saveset, newset;
--
See, you not only have to be a good coder to create a system like Linux,
you have to be a sneaky bastard too ;-)
[Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]
next prev parent reply other threads:[~1998-07-03 22:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-22 9:01 tcsh ralf
1998-07-02 22:59 ` tcsh Thomas Bogendoerfer
1998-07-03 14:58 ` tcsh ralf
1998-07-03 22:37 ` Thomas Bogendoerfer [this message]
1998-07-03 23:14 ` tcsh ralf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19980704003729.14342@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=linux@cthulhu.engr.sgi.com \
--cc=ralf@uni-koblenz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox