This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug localedata/624] New: vfprintf(): Improper handling of EAGAIN
- From: "whitis at freelabs dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 28 Dec 2004 21:15:09 -0000
- Subject: [Bug localedata/624] New: vfprintf(): Improper handling of EAGAIN
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
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.