Tag Info

New answers tagged

0

I am not a linux programmer, but facing the same question today, I've made a following test: #include<unistd.h> #include<signal.h> #include<errno.h> #include<fcntl.h> #include<cassert> #include<cstring> #include<string> #include<algorithm> #include<vector> #include<map> #include<set> ...


0

While I don't understand all of the semantics (I'm either looking in the wrong place, or the documentation is lacking), I believe that for a certain amount of time after closing a connection (perhaps set by SO_LINGER), no process can open a new socket with the same details unless they have SO_REUSEADDR set. This is to prevent someone reconnecting a second ...


-1

I am missing one bit in the answers that is slightly related to dying parents: when a process writes on a pipe for which there is no reading process anymore, it gets a SIGPIPE. The standard action for SIGPIPE is termination. This can indeed cause processes to die. In fact, it is the standard way in which the program yes dies. If I execute (yes;echo $? ...


-1

So what above posters are saying is, the children don't die, the parent kills them (or sends them a signal on which they terminate). So you can have what you ask, if you program the Parent to (1) keep a record of all its children, and (2) send a signal to all its children. This is what the Shell does, and it should be what your parent process does. It may ...


8

When a process exits, all its children also die (unless you use NOHUP in which case they get back to init). This is correct if the process is a session leader. When a session leader dies, a SIGHUP is sent to all members of that session. In practice that means its children and their descendants. A process makes itself session leader by calling setsid. ...


59

When a process exits, all its children also die (unless you use NOHUP in which case they get back to init). This is wrong. Dead wrong. That person has been lying to you, either when they said that or when they said they knew something about Unix and processes. There are two ways in which the death of a process can indirectly cause the death of its ...



Top 50 recent answers are included