Unix Programming - Re: is it necessary to be a session leader to attach psuedo terminal as a controlling

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > July 2006 > Re: is it necessary to be a session leader to attach psuedo terminal as a controlling





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: is it necessary to be a session leader to attach psuedo terminal as a controlling
Maxim Yegorushkin

2006-07-21, 7:28 am

pankajtakawale wrote:
> To attach controlling terminal (CT) to a process:
> I have following code similar in OpenSSH
>
> 1. disconnect from old CT
> 2. become a session leader setsid()
> 3. attach psuedo tty to process calling ioctl(fd, TIOCSCTTY, NULL)
>
> I dont want my process being a session leader to avoid SIGHUP for child
> process.


Is there a reason why you can't block SIGHUP before spawning a child?
This way children would not receive SIGHUP since the signal mask is
inherited by child processed.

http://www.opengroup.org/onlinepubs...igprocmask.html

P.S. If you are using Solaris 8, it's broken in this regard. The signal
mask on this operating system is only inherited by threads, not child
processes.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com