Ignore interrupt in system() calls?
thompson at uxf.cso.uiuc.edu
thompson at uxf.cso.uiuc.edu
Thu Sep 7 17:38:00 AEST 1989
4.3 BSD on a Sequent, if that makes much of a difference.
I am writing a C-shell-script/C-program pair to securely allow handing in
of programs by students. One of the things I'd like to do is turn off
the two keyboard-initiated interrupts over the critical handing-in portion
of the code. Last year, I got quite enough of the "but it was taking so long,
I just stopped it, but I thought it was handed in...".
Luckily, the critical portion is in the C program. So, I stuck:
signal (SIGINT,SIG_IGN);
signal (SIGQUIT,SIG_IGN);
at the top of the C program and figured I was fine. But after tracking some
strange occurrences, I noticed that when I do the "system()" calls I need to
do later in the program, the signals are reset to be trapped normally in
the shell that's forked by system(). So if a student hits CTRL-C while it's
executing the system(), it's trapped, and I'm out of luck.
So, I need one of three things:
1. A way for my interrupt ignoring to be passed to my system() shells.
2. A way for me to set the interrupts to be ignored in the midst of my
system() calls.
or
3. A way to "chmod" files from within a C program without using "system()".
Thanks in advance,
- Mark Thompson "The University Neither Knows Nor
"The less I seek my source for some Cares What I Am Saying -- Lucky
definitive, closer I am to fine." Them."
University of Illinois at U-C
INTERNET: thompson at uxf.cso.uiuc.edu
USMAILNET: 202 E Springfield #3B, Champaign IL 61820
More information about the Comp.unix.wizards
mailing list