mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: William Lee Irwin III <wli@holomorphy.com>,
	Ingo Molnar <mingo@elte.hu>, <linux-kernel@vger.kernel.org>
Subject: Re: [patch] generic-pidhash-2.5.36-D4, BK-curr
Date: Thu, 19 Sep 2002 18:35:42 +0200	[thread overview]
Message-ID: <20020919163542.GA14951@win.tue.nl> (raw)
In-Reply-To: <Pine.LNX.4.44.0209190809020.3759-100000@home.transmeta.com>

On Thu, Sep 19, 2002 at 08:12:31AM -0700, Linus Torvalds wrote:

> However, what I worry about is that there may not (will not) be a 1:1
> session<->tty thing. In particular, when somebody creates a new session 
> with "setsid()", that does not remove the tty from processes that used to 
> hold it, I think (this is all from memory, so I might be wrong).
> 
> Which means that if the tty is going away, it has to be removed from _all_ 
> tasks, not just from the one session that happened to be the most recent 
> one.

[POSIX 1003.1-2001]

Controlling Terminal

A terminal that is associated with a session. Each session may have
at most one controlling terminal associated with it, and a controlling
terminal is associated with exactly one session.
Certain input sequences from the controlling terminal cause signals
to be sent to all processes in the process group associated with
the controlling terminal. 

The Controlling Terminal

A terminal may belong to a process as its controlling terminal.
Each process of a session that has a controlling terminal has the same
controlling terminal. A terminal may be the controlling terminal
for at most one session. If a session leader has no controlling terminal,
and opens a terminal device file that is not already associated with a
session without using the O_NOCTTY option, it is implementation-defined
whether the terminal becomes the controlling terminal of the session leader.
If a process which is not a session leader opens a terminal file, or
the O_NOCTTY option is used on open(), then that terminal shall not become
the controlling terminal of the calling process. When a controlling terminal
becomes associated with a session, its foreground process group shall be set
to the process group of the session leader.

The controlling terminal is inherited by a child process during a fork()
function call. A process relinquishes its controlling terminal when it creates
a new session with the setsid() function; other processes remaining in the
old session that had this terminal as their controlling terminal continue
to have it. Upon the close of the last file descriptor in the system
(whether or not it is in the current session) associated with the controlling
terminal, it is unspecified whether all processes that had that terminal
as their controlling terminal cease to have any controlling terminal.
A process does not relinquish its controlling terminal simply by closing all
of its file descriptors associated with the controlling terminal if other
processes continue to have it open.

When a controlling process terminates, the controlling terminal is dissociated
from the current session, allowing it to be acquired by a new session leader.
Subsequent access to the terminal by other processes in the earlier session
may be denied, with attempts to access the terminal treated as if a modem
disconnect had been sensed.


  parent reply	other threads:[~2002-09-19 16:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.44.0209182101150.27697-100000@localhost.localdomain>
2002-09-19  2:54 ` Ingo Molnar
2002-09-19  6:10   ` Linus Torvalds
2002-09-19  9:25     ` Ingo Molnar
2002-09-19 10:59       ` William Lee Irwin III
2002-09-19 15:12         ` Linus Torvalds
2002-09-19 15:21           ` Ingo Molnar
2002-09-19 16:35           ` Andries Brouwer [this message]
2002-09-19 16:43             ` Linus Torvalds
2002-09-19 18:54               ` Miquel van Smoorenburg
2002-09-19 19:10               ` Kai Henningsen
2002-09-19 20:32                 ` Linus Torvalds
2002-09-19 22:29                   ` Miquel van Smoorenburg
2002-09-19 19:38               ` [patch] generic-pidhash-2.5.36-J2, BK-curr Ingo Molnar
2002-09-19 20:21                 ` Christoph Hellwig
2002-09-19 23:32                   ` Dave Jones
2002-09-19 23:46                     ` Ingo Molnar
2002-09-19 21:31                 ` Linus Torvalds
2002-09-19 21:39                   ` Ingo Molnar
2002-09-20  8:27   ` [patch] generic-pidhash-2.5.36-D4, BK-curr Oleg Drokin
2002-09-20  9:40     ` Ingo Molnar
2002-09-20 11:43       ` Oleg Drokin
2002-09-20 12:15         ` Russell King
2002-09-20 16:34         ` Ingo Molnar
2002-09-20 17:11       ` Andrew Morton
2002-09-20 13:03 Hanumanthu. H
2002-09-20 13:12 Hanumanthu. H
2002-09-20 13:09 ` Oleg Drokin
2002-09-20 16:47 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020919163542.GA14951@win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.com \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®