[lkml]   [1998]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Out of ptys
Date writes:
> > > open("/dev/ptyp2", O_RDWR) = 3
> > > ioctl(1, TCGETS, 0xbffff1dc) = -1 EINVAL (Invalid argument)
> > > ioctl(2, TCGETS, 0xbffff1d0) = -1 EINVAL (Invalid argument)
> > >
> > No, they are invalid because you don't have a stdout and stderr.
> > open() doesn't work the way you seem to think here.
> Well there was never a dup() of any kind, so there could not be a fd
> for stdout or stderr. I can see from the source that the idea was
> to open these devices until one could be found that did not fail.
Wrong. open() _always_ returns the first free fd. If it returns 3, then
0..2 are open, possibly to /dev/null or whatever. Most likely, your program
inherited them that way from the parent process.

Matthias Urlichs
noris network GmbH

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:44    [W:0.066 / U:2.956 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site