On Sun, 10 Dec 2006, Marco Costalba wrote:Why don't you use the pipe and standard read()? Even if you use "popen()" and get a "FILE *" back, you can still do int fd = fileno(file); and use the raw IO capabilities. The thing is, temporary files can actually be faster under Linux just because the Linux page-cache simply kicks ass. But it's not going to be _that_ big of a difference, and you need all that crazy "wait for rev-list to finish" and the "clean up temp-file on errors" etc crap, so there's no way it's a better solution. If it really is stdio overhead (possibly locking), using "fileno()" and the raw unistd.h interfaces is going to avoid it. (You still need to use "fclose()" to close the struct file afterwards, otherwise you'll leak memory, so you shouldn't _forget_ the original "struct FILE *", but you don't need to use it for anything else). Using popen() and pipes also means that if the parent dies, the child will get a nice EPIPE on the writing side, which is what you want. Linus - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Andi Kleen | Re: [PATCH] x86: Construct 32 bit boot time page tables in native format. |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: Possible regression in HTB |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
git: | |
