This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 2/27/2015 11:20 AM, A L wrote:
I think that would create an unacceptable performance penalty for the child process.The child process would not be affected at all! FILE* will be unbuffered only in your application, yet "cat" will read from a file descriptor "1" (and may or may not apply any buffering on top of it, such as FILE*, on its own). Since you are going to read only a few bytes out of "f" and leave the rest to "cat" (per your example), there is no performance penalty; in fact there will be some gain not to pre-fill a buffer for "f" (which you don't need anyways). Also, you can just use basic unix IO (read() vs. fread()), and call lseek(1,0,SEEK_SET) prior to popen(). This way, there's no user-level buffering and file position is consistent with your actions and expectations.
Thanks (and thanks to Corinna and Eric) for correcting my misconceptions. We have several viable solutions now, and I'm working with the upstream maintainers to decide which one to use.
Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |