public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Åke Rehnman" <ake.rehnman@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Incorrect behavior in TIOCINQ ioctl
Date: Sat, 29 Feb 2020 10:37:00 -0000	[thread overview]
Message-ID: <09e4b16c-a4fb-4062-1d29-a92a916f186b@gmail.com> (raw)
In-Reply-To: <20200228192330.GN4045@calimero.vinschen.de>


On 2020-02-28 20:23, Corinna Vinschen wrote:

> - Is it a safe bet that ClearCommError returns valid values in
>    st.cbInQue even if one of the error conditions occur?  Maybe the
>    right thing to do is to return 0 in certain error cases...?

The win32 api  documentation does not mention anything about not 
returning proper device status as long as the function succeeds...

Anyhow in my pursuit for the truth I whipped up a small test program and 
strace:d it (with some extra debug printout in fhandler_serial::ioctl)

  127 2403456 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=7
   216 3406481 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=E
    90 4409676 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=15
   141 5413027 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=1C
   129 6416204 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=23
   121 7419254 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=2A
   203 8423829 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=31
    89 9427183 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=38
   131 10431271 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=3F
   118 11435254 [main] python2.7 1662 fhandler_serial::ioctl: 0 = 
ioctl(541B, 0xFFFFBCB0) ev=C st.cbInQue=46

>
> - Did you actually try if this fixes your problem?  It's pretty
>    simple to build the Cygwin DLL
>    https://cygwin.com/faq.html#faq.programming.building-cygwin

I patched it yesterday and it solved the problem...

/Ake


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  reply	other threads:[~2020-02-29 10:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 21:39 Åke Rehnman
2020-02-28 19:23 ` Corinna Vinschen
2020-02-29 10:37   ` Åke Rehnman [this message]
2020-03-02 16:07     ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09e4b16c-a4fb-4062-1d29-a92a916f186b@gmail.com \
    --to=ake.rehnman@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).