Skip to content
Advertisement

Tag: signals

does linux kill() return after the process excute signal handler?

I want use kill() to kill a program. does linux kernel ensure that the program is killed before kill() returned? If not, I have to check whether the program is killed already. Answer does linux kernel ensure that the program is killed before kill() returned? No, kill merely sends a signal to a process or group of processes. Its successful

Wait for signal from parent and does job and blocks again

Write a program that can display a text string (consisting only of the 26 alphabets and spaces). The program should fork 27 worker processes. Each worker process runs an infinite loop in which it waits for a signal from the controller (i.e., parent), sleeps for 1 sec, prints its pre-defined character, signals the controller, then blocks again. The controller reads

Setting signal for SIGWINCH causes output on terminal?

When I set up a signal handler for SIGWINCH that does nothing, resizing the terminal window causes a reverse ? character to show up, get several of them as I resize the window around. If I don’t setup a signal handler, that doesn’t happen. Why is it doing that and How do I stop that? More information: I dump what

Kill all processes from C in Linux

I am writing a Linux C program that will be executed as init. It will eventually need to shut down the system. I have code for unmounting all the filesystems and actually turning off the system; now I just need a way for it to send SIGTERM to all processes, sleep(5), then send SIGKILL to any remaining processes. Answer If

Signal all processes in process group except self

I am writing a program which multiple processes will run concurrently. In this program, there is a need for one process to suspend all other participants temporarily. In order to spare myself the overhead of tabulating all participant process ID’s in a shared page and signaling them individually, I have created a process group that all participants join. To suspend

Signal Handler Behavior

I have just some questions about the system calls signal, kill and the signal handler. I have this code: 1) I don’t understand why the first printf in the first child, return -1 without a sleep(1) before…seems that the handler is executed after the beginning of the child. 2) When there is a kill to a child, after this, the

Advertisement