On Wednesday 02 February 2011 23:59, Rob Landley wrote: > On 02/02/2011 09:17 AM, Denys Vlasenko wrote: > > NOFORK now is an optimization, > > and it is used by xargs, find, and a few more applets via > > spawn_and_wait() function, > > Um, isn't xargs pretty much always on the right side of a pipeline? How > would nofork work in that case? (If it's not a process, how do you > redirect its stdin..?)
Normally xargs forks+execs a child, then waits for its death, then repeats this until all input words are passed as params. This (fork+exec)+wait is the perfect match for what nofork trick is about: running <applet>_main(). IOW: think about, say, a lot of deletions: .... | xargs -n4 rm nofork will save us from one fork syscall per four unlink syscalls. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
