This is sources Bugzilla
Bugzilla Version 2.17.5
Bugzilla Bug 624
  vfprintf(): Improper handling of EAGAIN Last modified: 2006-04-25 18:16
     Query page      Enter new bug
Bug#: 624   Hardware:   Reporter: Mark Whitis <whitis@freelabs.com>
Host: Target: Build:
Product:     Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: RESOLVED   Priority:  
Resolution: INVALID   Severity:  
Assigned To: GOTO Masanori <gotom@debian.or.jp>   Target Milestone:  
Flags: Requestee:
  backport ()
  examined ()
  testsuite ()
Summary:
Keywords:

Attachment Description Type Created Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 624 depends on: Show dependency tree
Show dependency graph
Bug 624 blocks:

Additional Comments:


Leave as RESOLVED INVALID
Reopen bug
Mark bug as VERIFIED

View Bug Activity   |   Format For Printing


Description:   Last confirmed: 0000-00-00 00:00 Opened: 2004-12-28 21:15
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).

------- Additional Comment #1 From Ulrich Drepper 2005-09-26 16:29 -------
You have to provide a test case.

------- Additional Comment #2 From Ulrich Drepper 2006-04-25 18:16 -------
No reply in 6+ months.  Closing.

     Query page      Enter new bug
Actions: New | Query | bug # | Reports | Requests   New Account | Log In