Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755803AbbEEW7V (ORCPT ); Tue, 5 May 2015 18:59:21 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60252 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbEEW7T (ORCPT ); Tue, 5 May 2015 18:59:19 -0400 Date: Wed, 6 May 2015 08:59:07 +1000 From: NeilBrown To: Nic Percival , Michael Kerrisk Cc: Michael Matz , Peter Hurley , Greg Kroah-Hartman , Jiri Slaby , "linux-kernel@vger.kernel.org" Subject: [PATCH man-pages] pty.7: clarify asynchronous nature of PTY IO. Message-ID: <20150506085907.62df914f@notabene.brown> In-Reply-To: References: <20150501162040.05c0cb42@notabene.brown> <5543964C.9030606@hurleysoftware.com> X-Mailer: Claws Mail 3.10.1-162-g4d0ed6 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/.62w_TV2BfW4lUL7YrrYJyp"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2672 Lines: 74 --Sig_/.62w_TV2BfW4lUL7YrrYJyp Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable A PTY is not like a pipe - there may be delayed between data being written at one end and it being available at the other. This became particularly apparent after commit f95499c3030f ("n_tty: Don't wait for buffer work in read() loop") in Linux 3.12 Signed-off-by: NeilBrown --- Peter: does this seem reasonable and accurate to you? MichaelK: Would you prefer the commit ID in the man page. It isn't so much a deliberate change as a code improvement which caused problems for cert= ain use cases which depended on undefined behaviour. Thread at https://lkml.org/lkml/2015/5/1/35 NeilBrown diff --git a/man7/pty.7 b/man7/pty.7 index 1332d11d9ca2..6c9ae182925c 100644 --- a/man7/pty.7 +++ b/man7/pty.7 @@ -56,6 +56,12 @@ terminal emulators, and .BR expect (1). =20 +Data flow between master and slave is handle asynchronously, much like +data flow with a physical TTY. Data written to the slave will be +available at the master promptly, but may not be available +immediately. Similarly there may be a small processing delay between +a write to the master, and the effect being visible at the slave. + Historically, two pseudoterminal APIs have evolved: BSD and System V. SUSv1 standardized a pseudoterminal API based on the System V API, and this API should be employed in all new programs that use --Sig_/.62w_TV2BfW4lUL7YrrYJyp Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIVAwUBVUlLOznsnt1WYoG5AQL/mxAApLSk2HDMGkXDDAs3qHJXg6zkRaKAwKLG AR3sNEQDIyFql1Xqi0WoOHvydGgZ38m40raU40067nk4duDeHCRO7Vu85UuvDAMy qxiUzo3OtqDDduGeRKIelfu4Z595TcMtafKXoYivc1O9y+6nBSCJcGOt35EsbQGP EZoQ+jL3h9deeEuRgmyS7SS+7+BqhLznxu6JfEywXzb/n+fjor/womCaReKQpQWP qA7mOZef6n/JLMBznrsFpONIgmJUqAGSUn+9m+Gg2AQpGRSSmAsWsYqWzUVnrG9W /Eg9GzqHvlA+wE2PFoZwwAqlKqhcEfab6YxYIY3NKk3g/cXHBYGi7Q/pl3K5Djc0 jRQTpiQJot9CVhNjmcLH7LOqTtibpmnLyvDy0RhUwyzJH4zYh4ToTrEs1E898/AO Xyct1vlzQBG9fkkf/Kg9wsWZ8WHRZIB7I95t9LN3lDT5JETBxnzrE9J4Qx5fz/8j /09ePk4s81MZ6pWKP9TYeL1Fk8LAdHjokBJM2PSMJPAZnDs5SqfAAVu2m3iqP4j/ eX5h8bVvkOBCcdU4sXSStlPnrN4GYFAwcNHAsSpJsChKLbvIbcXbdKWo7K5hrBFV nYDp+yOdt+Vq1RL6eyaO3YUD6SWkbuU4PZGbGNNkCAgJojeJ7nQa3UKzjw8EG1gl C5Dv94F7NyY= =Aooi -----END PGP SIGNATURE----- --Sig_/.62w_TV2BfW4lUL7YrrYJyp-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/