site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Wr8HPUjWANzY2NMEcF7hKuhlZ2eRgDedHunmkmP6eC4=; b=J3/1y9TSBMjJk7sbYYXL54EpCqZzriHmA96xCZcb35GnsdVqGJ4lxyew51+kJGSWPr SXNtbOBmqsJ/rY3/Zj5dJcweFvyg9M9l0/f4bOx/LHqLo1Sz1W5EbUCMwGZU6MFVJsn5 TURAlxGBGoulMaJBj4cwj2TL0AyzB5RLmbVzQ= Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=IEBZ57L6ylhS61qA3Akqri3XMfRYlmUXcTmzQVLVgL+eENcDLseHYJSInc+HeQOBZs Q7tJY0AqDcksoSEnJqc3hgcWENWQ9OqsjbnvibCTm9d/zUXXKs2EKPk2lUY4XDj40Fpo RCJIfFkgjoyByswLNQS1SeNGRDWv15zLKwtVk= On Sat, Apr 24, 2010 at 9:43 PM, Terry Lambert <tlambert@apple.com> wrote:
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.
Thanks for the clarification, this makes more sense now. However, I'm still slightly confused: the example code I posted in this thread neither explicitly opens the slave side nor performs any ioctl, except maybe implicitly by calling forkpty. As such I'm not aware of any wrongdoing on my part. Maybe you are referring to the VMIN/VTIME experiments that I mentioned a few posts ago? For what it's worth, the reason I applied these to the master end was because the only useful explanation of VMIN/VTIME I could find so far -- http://www.unixwiz.net/techtips/termios-vmin-vtime.html -- makes it sound like it is a setting applicable to reading, not writing, and since in my example the master is what does the reading, that's where I applied it. If that was the wrong thing to do, in my defense it is quite hard to find good documentation on this -- I wouldn't know where to start looking really. Any pointers are appreciated. _______________________________________________ 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... This email sent to site_archiver@lists.apple.com