Re: file descritor 255 is always associated with /dev/tty[?] ?

Matti Aarnio (matti.aarnio@sonera.fi)
Tue, 26 Oct 1999 17:33:30 +0300


On Tue, Oct 26, 1999 at 05:17:13PM +0300, Matti Aarnio wrote:
> On Tue, Oct 26, 1999 at 07:18:51PM +0530, SK wrote:
> > Hi,
> > I am running linux kernel 2.2.9.
> > I have noticed that the file descriptor 255 (apart from fd 0, 1 and 2)
> > of a process is always associated with the controlling terminal device of
> > the process i.e /dev/tty[?] (current->files->fd[255] is not NULL). This is
> > the case with the shell (bash) process and since other processes are
...
> This is a bash bug. (It exists at version 2.03, propably earlier.)

Ah, I did begin to wonder, why it hasn't appeared before.
(I am at slow mode..)

Turns out you see those *only* at BASH shells themselves, *not*
at their subprocesses. A FD_CLOEXEC flag is set for all fd's
of the bash, thus when it executes a new subprocess, those
weird fd:s won't follow to subprocesses.

> /Matti Aarnio <matti.aarnio@sonera.fi>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/