From: Chris Ross Date: 2002-06-22T03:06:20+09:00 Subject: Re: Why is I/O slow? On Sat, Jun 22, 2002 at 02:26:15AM +0900, Ian Macdonald muttered... : On Fri 21 Jun 2002 at 17:13:40 +0900, Yukihiro Matsumoto wrote: : : > "stdio" just doesn't provide the way to distinguish buffered and : > unbuffered input. And glibc does not exist everywhere. So I have to : > do the job by myself, if I want to tweak the buffer. And I want to. : : But if you're agreeing that you don't need to tweak the buffer with : glibc, then why don't you just place an #ifdef macro for Linux around : that piece of code? : : If using glibc makes sense in the cases that it's available, why would : you not want to do so in such cases? Because it makes debugging easier? Trust me, going just down one route to solve a problem in a cross platform way can provide enough issues, let alone having multiple paths depending on a strange array compile options. If you need something specialist either a) dont use the tool you have chosen, or b) write a native module, it's not hard [as you found out with the password code you wrote]. The most stright forward way is to provide a general solution to the general problem and then start worrying about the corner cases that only a fraction of the users have issues with. And if you want tight control over buffering [as matz stated he does] the easiest way to do it is to implement it himself touching the real world as little as possible until necessary [eg. flushing that buffer]. Just my 2pence Regards, Chris -- Chris Ross (boris) chris@darkrock.co.uk | ctr@ferite.org http://www.darkrock.co.uk | http://www.ferite.org "I dont suffer from insanity - I enjoy every minute of it..."