https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239604

            Bug ID: 239604
           Summary: FIONREAD ioctl returns the wrong result on a master
                    pty after the slave has been closed
           Product: Base System
           Version: 11.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]
 Attachment #206224 text/plain
         mime type:

Created attachment 206224
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=206224&action=edit
Example to reproduce the bug

Compile the attached example with:

cc -lutil pty-fionread.c

When it is run, I would expect it to print:

bytes1 = 0
bytes2 = 0

but in FreeBSD it prints:

bytes1 = 0
bytes2 = 1

It looks like the FIOREAD ioctl always returns 1 after the slave side of the
pty has been closed, regardless of whether any data is available.  This
contradicts the man page and also differs from Linux (and Solaris and AIX,
which have very different code to open the pty).

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to