CSC209H5 Lecture 9: Signals

41 views2 pages

Document Summary

Csc209h5s - software programming and tools (winter 2018) The first tasks is to write a program called greeting that does nothing except run a infinite loop. #include int main () { while ( 1 ); return 0 ; Run your code in one window in the foreground. Kill it by typing control-c in the same window. Use ps to see that indeed it is still running. Use fg to move it to the foreground. Control-c is a signal to escape the program (break signal). ps -ax | grep a. out ps - process. Ax - all processes grep - grab all processes with a. out. S - used to send the signal used when killing. Task: open another window (on the same machine) and run ps again. Now that you know the pid use the kill command to kill it. There are a number of possibilities that will work and the command will depend on the pid of your running process.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents