Mail Archives: cygwin/2015/04/16/05:05:57
--ZoaI/ZTpAVc4A5k6
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi Takashi,
On Apr 16 09:26, Takashi Yano wrote:
> Hi Corinna,
>=20
> On Tue, 14 Apr 2015 09:34:56 +0200
> Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote:
>=20
> > And the native client, not knowing what he's talking to, recognizes the
> > output stream as a normal named pipe, if it's looking for that info at
> > all. Being native, it will use native Windows MSVCRT stdio calls.
> > Worse, as you can see in the behaviour of some native applications, the
> > MSVCRT isatty() call returns 0 for named pipes.
> >=20
> > If we have a Cygwin client, we can do all kinds of stuff on the slave
> > side, but as soon as we have a native client, only the master side of
> > the pty has any chance to do the right thing. That's why I wrote that
> > we don't have the slave side under control.
> >=20
> > Therefore we should really move the OPOST code back to the master side.
> > I'm reluctant to just revert your patch, though, because I think you
> > know better how to fix the OPOST code to make it work correctly on the
> > master side.
>=20
> So OPOST processing should be in master side for native windows program.
> However, to solve the second problem I had pointed out in
> http://cygwin.com/ml/cygwin/2015-02/msg00929.html ,
> OPOST processing should be done on a timing when slave calls write().
>=20
> To solve this antinomy, I have made a patch attached.
>=20
> With this patch, new pipe is introduced to handle OPSOT-process separately
> between native windows program and cygwin program.
>=20
> Data from cygwin program is passed through the pipe newly introduced.
> In this case, process_opost_output() is called in fhandler_pty_slave::wri=
te().
> Master reads data, which is already applied OPOST process, from the
> new pipe.
>=20
> On the other hands, for native windows program, data is written into
> conventional pipe. Master forwarding thread, which is also newly
> introduced, reads conventional pipe and forward the data to the pipe
> newly introduced by calling process_opost_output(). This makes OPOST
> processing be done in master side.
>=20
> I have confirmed that the both problem is fixed with this patch.
Ok, but... this is a really big patch and it complicates the pty code
even more. Is there really no other option as far as the TCSADRAIN
problem is concerned?
What strikes me as weird is that neither fhandler_pty_slave::tcsetattr
nor fhandler_pty_master::tcsetattr give a damn for the optional_actions
parameter. They simply overwrite the tc settings. So I'm wondering,
wouldn't it be possible to add code to the tcsetattr implementation
instead, so that TCSADRAIN/TCSAFLUSH are honored and than only have one
place for OPOST handling?
> By the way,
> I know that the names for the new pipe such as io_handle2, to_master2
> and output_handle2 are ugly enough. Are there more appropriate names?
What about renaming io_handle to io_handle_nat and io_handle2 to io_handle
or io_handle_cyg?
Thanks,
Corinna
--=20
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--ZoaI/ZTpAVc4A5k6
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBAgAGBQJVL3tdAAoJEPU2Bp2uRE+gpaYP/1+ZDR2FejyJr9Td/l00Ssyb
UkqbcsjTiaTzT6ixxE1QC9yv70sk2NwczUFA9kSfaHPBR1W6ELi7igBJ4KhRspci
YPqt32huNpbaNDmKXfjJ1KW0Md8ncU57By143Q7kV9x+AXOS6OBribPMbpv8dRVR
hF2lVVlVwVsVR4W4I1jQTj+muT4hOooVUTE1LWwDQRn4VPQlPpoAA70rbYdm2a0V
TLS6VcYyNA7p7QRw3d1Yt6gTxSqdrTmSbsVV1RaZ5wSZZsuN4MgcoZ2ruVXWD7se
eEb7ek841IgbVYow7wepdzMYxAwmX2uoS7hvzr5ogstFjbyadUVcKFlUS5eFNbmZ
UI82QpdD1wzDo8Ib8keXMA2J85jfN2LiD9o7x82G1SXhl/TREmrgZQme81aew2sk
/n2xqlUMs/lmhb6Bu26CqmPBsVSc06z6Om5Cnwgdnb07FfzOHyGGGUrmejPH6/wW
P+b7S1oWiXRF98w0xIAzxc2/xB5B4h9UFOrIOKRgyLnHqQMyIH0hhRKNPMcAr3wp
YFYt55ay6BIsbVi/jgnPhSgoOX439knERbdkq5dHqpu5oLCIMhvh5Sx8pY3fxEZ/
IatOB/3C78XJYULvj7qZole+t268kdJQjsQ1NYtbSQxHqVLLx4CNb25I8sjc+smD
6CwnbnuShKySB0lf6hgB
=C+Mm
-----END PGP SIGNATURE-----
--ZoaI/ZTpAVc4A5k6--
- Raw text -