Re: Reading from a pty after slave exited
Re: Reading from a pty after slave exited
- Subject: Re: Reading from a pty after slave exited
- From: Terry Lambert <email@hidden>
- Date: Sat, 24 Apr 2010 02:43:22 -0700
On Apr 24, 2010, at 2:04 AM, Julian Scheid <email@hidden>
wrote:
On Sat, Apr 24, 2010 at 6:41 PM, Terry Lambert <email@hidden>
wrote:
I think I can safely say the operations will fail in the future if
you lose
the race, so code not written to do ioctl the right end of the pty
will get
race failures, but it will only harm the code doing the ioctl on
the wrong
fd, and then not always.
Sorry, I don't follow. Lose which race, could you elaborate? When
you're talking about the wrong fd, do you mean using the slave fd on
the master end and vice versa?
Your specific problems came from racing the child opening the slave
side following a fork vs. performing an ioctl which should only be
performed on the slave side of a pty on the master side instead.
Historically BSD ptys haven't really enforced the distinction, and
telnetd got it wrong; a lot of people coming after telnetd cribbed
code from it, and got it wrong too. Doing these ioctls on the master
side of the device may fail with an ENOTTY error in a future release.
As a transiton stage, we'll probably still allow them for a while as
long as both ends are open, but I'd like to discourage people from
relying on that in new code.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden