Re: Reading from a pty after slave exited
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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? -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Apr 24, 2010, at 2:04 AM, Julian Scheid <julians37@googlemail.com> wrote: On Sat, Apr 24, 2010 at 6:41 PM, Terry Lambert <tlambert@apple.com> 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. 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert