|
From: | Bob Friesenhahn |
Subject: | Re: rewrite try_dlopen (2) |
Date: | Tue, 5 Oct 2004 09:17:37 -0500 (CDT) |
On Tue, 5 Oct 2004, Ralf Wildenhues wrote:
The getline clone get_line that fell out of this change could in principle be replaced by the glibc one (and LIBOBJed on non-glibc systems), and its current implementation is still ugly, but I did not want to work on this now. I'd rather do that together with switching ltdl from stdio to fd IO sometime soon (as requested).
I am not aware of any advantage to using Unix I/O rather than ANSI C standard stdio for reading/writing small files. C's stdio is buffered while read/write are not buffered. Efficiently using read/write requires that the application/library provide its own buffering mechanism and parsing functions, which will surely increase code size and maintenance.
There are cases where Unix I/O is to be preferred over stdio but parsing tiny text files is not one of those cases. In order to effectively use Unix I/O one would want to first slurp the entire file into memory since .la files are smaller than a typical disk block. If Unix I/O is even to be considered, then why not consider using memory-mapped files (e.g mmap())?
Bob ====================================== Bob Friesenhahn address@hidden http://www.simplesystems.org/users/bfriesen
[Prev in Thread] | Current Thread | [Next in Thread] |