|
From: Jason F. <jas...@ya...> - 2002-05-03 08:16:50
|
--- "KJK::Hyperion" <no...@li...> wrote: >not sure. Stdio FILE objects are supposed, AFAIK, to maintain their >internal buffer, exactly to avoid the overhead of a system call to >read a single character I think you're right (btw wine's msvcrt functions call readconsole 1 char at a time, so porting may be a bad idea after all). It's filbuf's job to send characters from stdin's buffer or perform a read if there's nothing in the buffer (which eventually calls readconsolea). BUT _read (in msvcrt\io\read.c) doesn't want to return until it's read the size requested (filebuf asks for 4096), even if enter is pressed. So it seems that's the problem. If we wanted buffered reading to limit system call overhead, then _read must return if enter is pressed and the file in use is stdin. What do you think about this? - Jason __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com |