* how to (really) trap ^Z?
@ 1995-03-11 19:26 Michael Levin
0 siblings, 0 replies; only message in thread
From: Michael Levin @ 1995-03-11 19:26 UTC (permalink / raw)
I am writing a program in C, on an Alpha running OSF/1. I want to
trap ^Z (as hit from the keyboard, in the shell in which the program
was run) - to have it go to a routine when it is hit, and then return.
I did the usual:
signal(SIGTSTP,f);
where f() is my function. When I run the program, and hit ^Z, what
happens is that my routine f() does get called properly, but also I
see the "suspended" message from the shell, even though my program is
not suspended (because I can see it run f() and then continue with its
output). I then get the shell's prompt, intermixed with my program's
output, until I do "fg", and all returns to normal. This is no good
because I need f() to be able to accept keyboard commands (from
stdin); why is the shell getting this ^Z when I explicitly trap it in
my code? If anyone knows what the right solution is, please email to
mlevin@husc.harvard.edu.
Mike Levin
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-03-11 19:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-03-11 19:26 how to (really) trap ^Z? Michael Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox