[git commit] taskset: implement -a (original) (raw)
Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sun Jun 20 08🔞15 UTC 2021
- Previous message (by thread): [PATCH 0/3] vi: some more fixes
- Next message (by thread): [git commit] taskset: implement -a
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 19 June 2021 17:42:35 CEST, Denys Vlasenko <vda.linux at googlemail.com> wrote:
commit: https://git.busybox.net/busybox/commit/?id=25128176c46b169cdec2c18b5730c36a940f6eb0 branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
function old new delta processpidstr - 854 +854 .rodata 103363 103378 +15 packedusage 33654 33658 +4 tasksetmain 936 190 -746 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 873/-746) Total: 127 bytes
+ if (opts & OPTa) { + char dn[sizeof("/proc/%s/task") + 3 * sizeof(int)]; + DIR *dir; + struct dirent *ent; + + sprintf(dn, "/proc/%s/task", pidstr); + dir = opendir(dn); + if (!dir) { + goto nothreads; + } + while ((ent = readdir(dir)) != NULL) { + if (isdigit(ent->dname[0])) + processpidstr(ent->dname, opts, aff); + } + IFFEATURECLEANUP(closedir(dir);)
Is this opencoded hunk smaller than a variant with recursive_action? thanks,
+ } else { + nothreads: + processpidstr(pidstr, opts, aff); + } + return EXITSUCCESS; }
- Previous message (by thread): [PATCH 0/3] vi: some more fixes
- Next message (by thread): [git commit] taskset: implement -a
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]