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

SK (sushil@cse.iitk.ac.in)
Tue, 26 Oct 1999 22:14:23 +0530 (IST)


Hi Matti Aarnio,
Thanks for your reply. I did see that after exec the fd 255 is indeed
closed. I was looking at the fds inside the sys_execve function just after
the process was forked and has called exec system call. That is why i got
this 255 fd open.

Bye,
Sushil.

On Tue, 26 Oct 1999, Matti Aarnio wrote:

> 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/