You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Student Name of member 1: Seyyedeh Fatemeh Mousavi
Student No. of member 1: 400105252
Student Name of member 2: [FILL HERE]
Student No. of member 2: [FILL HERE]
Student Name of member 3: [FILL HERE]
Student No. of member 3: [FILL HERE]
Read Session Contents.
Section 5.3.1
Write the Hello World! program
FILL HERE with your source code
Write the ls to wc program
FILL HERE with your source code
Investigate how to have a bi-direction pipe
FILL HERE with your descriptions
Section 5.3.2
Describe the usecase of different signals:
SIGINT:SIGINT is the signal sent when we press Ctrl+C. The default action is to terminate the process. However, some programs override this action and handle it differently. One common example is the bash interpreter. When we press Ctrl+C it doesn't quit, instead, it prints a new and empty prompt line.
SIGHUP:SIGHUP ("signal hang up") is a signal sent to a process when its controlling terminal is closed. It was originally designed to notify the process of a serial line drop. The SIGHUP (“hang-up”) signal is used to report that the user's terminal is disconnected, perhaps because a network or telephone connection was broken.
SIGSTOP:When you use SIGSTOP to a process, it will pause the process. It will not resume automatically unless you send a SIGCONT signal to it. This is great because it allows you to pause a process without terminating it.
SIGCONT:The SIGCONT signal instructs the operating system to continue (restart) a process previously paused by the SIGSTOP or SIGTSTP signal.
SIGKILL:Using kill command with SIGKILL signal sends a kill signal to end any process immediately when sent with a PID or a processname. It is a forceful way to terminate a or set of processes. This signal cannot be handled (caught), ignored or blocked.
picture of man 7 signal:
Describe SIGALRM
SIGALRM is generated when the timer set by the alarm function goes off. SIGALRM is an asynchronous signal. The SIGALRM signal is raised when a time interval specified in a call to the alarm or alarmd function expires. Because SIGALRM is an asynchronous signal, the SAS/C library discovers the signal only when you call a function, when a function returns, or when you issue a call to sigchk . Generally SIGALRM is used to notify a process that the specified real-time interval has elapsed.
Investigate the given code
First, it sets an alarm for 5 seconds, then it prints the message "Looping forever . . .", and then it enters an infinite loop. The line after the while(1) will never be printed because the program is stuck in the infinite loop. After 5 seconds, the program will receive the SIGALRM signal and its execution will be terminated, since no signal handler has been set for it.
Modify the given program by handling SIGALRM
[FILL HERE with your source code.]
Write a program that handles Ctrl + C
[FILL HERE with your source code.]
The text was updated successfully, but these errors were encountered:
Team Name:
[FILL HERE]
Student Name of member 1:
Seyyedeh Fatemeh Mousavi
Student No. of member 1:
400105252
Student Name of member 2:
[FILL HERE]
Student No. of member 2:
[FILL HERE]
Student Name of member 3:
[FILL HERE]
Student No. of member 3:
[FILL HERE]
Section 5.3.1
Write the
Hello World!
programFILL HERE with your source code
Write the
ls
towc
programFILL HERE with your source code
Investigate how to have a bi-direction pipe
FILL HERE with your descriptions
Section 5.3.2
Describe the usecase of different signals:
SIGINT is the signal sent when we press Ctrl+C. The default action is to terminate the process. However, some programs override this action and handle it differently. One common example is the bash interpreter. When we press Ctrl+C it doesn't quit, instead, it prints a new and empty prompt line.
SIGHUP ("signal hang up") is a signal sent to a process when its controlling terminal is closed. It was originally designed to notify the process of a serial line drop. The SIGHUP (“hang-up”) signal is used to report that the user's terminal is disconnected, perhaps because a network or telephone connection was broken.
When you use SIGSTOP to a process, it will pause the process. It will not resume automatically unless you send a SIGCONT signal to it. This is great because it allows you to pause a process without terminating it.
The SIGCONT signal instructs the operating system to continue (restart) a process previously paused by the SIGSTOP or SIGTSTP signal.
Using kill command with SIGKILL signal sends a kill signal to end any process immediately when sent with a PID or a processname. It is a forceful way to terminate a or set of processes. This signal cannot be handled (caught), ignored or blocked.
picture of
man 7 signal
:Describe SIGALRM
SIGALRM is generated when the timer set by the alarm function goes off. SIGALRM is an asynchronous signal. The SIGALRM signal is raised when a time interval specified in a call to the alarm or alarmd function expires. Because SIGALRM is an asynchronous signal, the SAS/C library discovers the signal only when you call a function, when a function returns, or when you issue a call to sigchk . Generally SIGALRM is used to notify a process that the specified real-time interval has elapsed.
Investigate the given code
First, it sets an alarm for 5 seconds, then it prints the message "Looping forever . . .", and then it enters an infinite loop. The line after the while(1) will never be printed because the program is stuck in the infinite loop. After 5 seconds, the program will receive the SIGALRM signal and its execution will be terminated, since no signal handler has been set for it.
Modify the given program by handling SIGALRM
[FILL HERE with your source code.]
Write a program that handles Ctrl + C
[FILL HERE with your source code.]
The text was updated successfully, but these errors were encountered: