Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxf.cso.uiuc.edu!thompson From: thompson@uxf.cso.uiuc.edu Newsgroups: comp.unix.wizards Subject: Ignore interrupt in system() calls? Message-ID: <46800009@uxf.cso.uiuc.edu> Date: 7 Sep 89 07:38:00 GMT Lines: 37 Nf-ID: #N:uxf.cso.uiuc.edu:46800009:000:1509 Nf-From: uxf.cso.uiuc.edu!thompson Sep 7 02:38:00 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@uxf.cso.uiuc.edu USMAILNET: 202 E Springfield #3B, Champaign IL 61820