[Bug localedata/624] New: vfprintf(): Improper handling of EAGAIN

whitis at freelabs dot com sourceware-bugzilla@sources.redhat.com
Tue Dec 28 21:15:00 GMT 2004


The vfprintf equivalent of fprintf(4, "load\r") returns 5 instead of -1 on EAGAIN
and doesn't retry the operation.   The output file was a serial port opened with 
  serial_fd = open("/dev/ttyUSB0", 0_RDWR|O_NOCTTY|O_NONBLOCK); 
  serial_out = fdopen(serial_fd, "w");
  serial_in = fdopen(serial_fd, "r");

There is some question as to whether it should retry the operation or return -1
but simply returning no error without retrying is clearly broken behavior.
O_NONBLOCK is necessary because the program must be able to read "silence"
on the serial port as part of detecting a remote prompt.   I.E. to read a prompt
of "S>", the program will read "S", ">", EAGAIN, (delay), EAGAIN.  It would be
better in this case if NONBLOCK didn't affect output at all, of course.

The problem came to light when using a program that worked on a 16550 based
serial port on a byterunner USB to serial pod which has a driver problem that
apparently causes it to stop accepting data as soon as an XOFF is received
instead of later when the buffer fills up (which would never happen because the
program is designed to never overflow the buffers).

-- 
           Summary: vfprintf(): Improper handling of EAGAIN
           Product: glibc
           Version: 2.3.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: localedata
        AssignedTo: pere at hungry dot com
        ReportedBy: whitis at freelabs dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=624

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



More information about the Glibc-bugs mailing list