Eric Pouech eric.pouech@wanadoo.fr writes:
just a dumb question: shouldn't we better (for synchronous unix reads) convert the fd into a FILE* (cache those FILEs for a few streams, or all of them ?) and let libc do the buffering on file reading/writing ?
This won't work because a FILE* is process-local, while a handle can be shared across processes. Of course there is the same problem with doing the buffering ourselves in the client, so Hannu's solution won't work reliably either. To be reliable the buffering would have to be done in the server, but there's obviously no point in doing that.