additional applets available as ash builtins?

Denys Vlasenko vda.linux at googlemail.com
Sat Apr 12 20:08:58 UTC 2008


On Saturday 12 April 2008 19:15, Denys Vlasenko wrote:
> # touch TEST
> # strace -ff ./busybox ash -c 'rm TEST'
> execve("./busybox", ["./busybox", "ash", "-c", "rm TEST"], [/* 32 vars */]) = 0
> ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
> ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
> getuid32()                              = 0
> brk(0)                                  = 0x810f000
> brk(0x8110000)                          = 0x8110000
> getpid()                                = 24501
> time(NULL)                              = 1208019995
> rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
> getppid()                               = 24500
> stat64("/.1/usr/srcdevel/bbox/fix/busybox.t1t", {st_mode=S_IFDIR|0755, st_size=1632, ...}) = 0
> stat64(".", {st_mode=S_IFDIR|0755, st_size=1632, ...}) = 0
> rt_sigaction(SIGINT, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGINT, {0x807cd7b, ~[], SA_RESTORER, 0x80486eb}, NULL, 8) = 0
> rt_sigaction(SIGQUIT, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGQUIT, {SIG_DFL}, NULL, 8) = 0
> rt_sigaction(SIGTERM, NULL, {SIG_DFL}, 8) = 0
> rt_sigaction(SIGTERM, {SIG_DFL}, NULL, 8) = 0
> fork(Process 24502 attached (waiting for parent)
> Process 24502 resumed (parent 24501 ready)
> )                                  = 24502
> [pid 24501] wait4(-1, Process 24501 suspended
>  <unfinished ...>
> [pid 24502] lstat64("TEST", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> [pid 24502] access("TEST", W_OK)        = 0
> [pid 24502] unlink("TEST")              = 0
> [pid 24502] _exit(0)                    = ?
> Process 24501 resumed
> Process 24502 detached
> <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 24502
> --- SIGCHLD (Child exited) @ 0 (0) ---
> _exit(0)                                = ?
> 
> 
> BTW, I actually expected that it will not even fork()... need to take a look.

This patch should make it even faster by not forking
for all NOFORK applets.

Can you give it a try?
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: text/x-diff
Size: 4567 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080412/937a42b1/attachment.bin 


More information about the busybox mailing list