posix

How to detach from the parent process?

Ever wondered how does screen realize it's persistence, i.e. even when killing it's parent process (e.g. you detach screen and logout afterwards), you can restore the state in the moment of detachment by reattaching the screen session.

The magic is done by setsid(2) by creating a new session with the current process as the only member.

Syndicate content