Which of the following signals is sent to a process when the key combination Ctrl+Z is pressed on the keyboard?
Which of the following signals is sent to a process when the key combination Ctrl+Z is pressed on the keyboard?
When pressing the key combination Ctrl+Z on the keyboard, the signal sent to the process is SIGTSTP. However, SIGTSTP is not in the list of provided options. The closest signal that resembles the action being described (suspending a process) is SIGSTOP. SIGSTOP is a signal that also stops a process but unlike SIGTSTP, it cannot be ignored or handled by the process. Therefore, the correct option among the provided choices is SIGSTOP.
Anyone of these options are correct, when you press CTRL+Z the signal SIGTSTP is sent.
You can probe this by typing in the cmd: #sleep 60 CTRL+Z #echo $? and you rest 128 to this number, and you obtain the number of the signal, and then #kill -l and you will see all signals
Ctrl-Z sends SIGTSTP, a signal this causes the process to suspend execution. In this case, it is resumable - try executing a command that will take a while and press Ctrl-Z; you'll see something in the lines of [1]+ Stopped [your command]. Type fg in your Terminal and you'll see the process resuming, if it didn't end before resuming it.
SIGTSTP is correct (which is not an answer here). https://stackoverflow.com/questions/11886812/what-is-the-difference-between-sigstop-and-sigtstp
An easy way to test this is to nano to a file and press ctrl+z, then you will see [stopped], hence it's SIGSTOP
E: SIGINT is correct Some mistakes on this Site.
SIGINT means termination by interrupt Ctrl + z means stop. So C is right.
ctrl+c is SIGINT ctrl+z is SIGSTP
student shall learn for both signals
Ctrl + Z is useful when you want to temporarily stop what you are doing in the text editor (like Vim) to go check on a file somewhere in your hard drive on the same terminal.
ctrl+z is SIGSTOP