Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!sbsvax!weinelt From: weinelt@sbsvax.cs.uni-sb.de (Bernhard Weinelt) Newsgroups: comp.unix.questions Subject: strange behaviour of SIG_IGN Message-ID: <2983@sbsvax.cs.uni-sb.de> Date: 22 Feb 90 21:44:41 GMT Organization: Universitaet des Saarlandes, Saarbruecken, W-Germany Lines: 43 Hello folks, I have a new interesting (at least for me) question: Suppose the following little program: #include #include main() { int c; system("stty -echo cbreak"); /*signal(SIGSEGV,SIG_IGN);*/ while ((c=getchar())!=4) printf("%c",c); system("stty echo -cbreak"); } With the signal in comments, the program works as expected: it echo's all characters and exits on ^D. But with the signal statement in the program, after pressing ^D there is no more reaction at the terminal and in fact the program has spawn a new sh-process, which is indefinitly running. A very costly behaviour on our ULTRIX and BSD4.3 VAX's. [With SunOS the above program works fine with the signal statement.] Exchanging SIG_IGN by an empty function also fixes the problem. But can anybody explain this strange behaviour? Thanks in advance. Bernhard -- ------------------------------------ __________________ | Bernhard Weinelt | (__) / \ | Universitaet des Saarlandes | (oo) ( Many Greetings ) | FB 10 - Informatik (Dept. of CS) | /-------\/ --'\__________________/ | Bau 36, Im Stadtwald 15 | / | || | D-6600 Saarbruecken 11, W-Germany| * ||----|| | weinelt@cs.uni-sb.de | ~~ ~~ ------------------------------------