[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [git commit] taskset: implement -a
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2021-06-20 9:49:15
Message-ID: CAK1hOcPKEJZN8xKz09D51naJEze_M1YvzK7FAF+0YRNXEejxMw () mail ! gmail ! com
[Download RAW message or body]

On Sun, Jun 20, 2021 at 10:18 AM Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On 19 June 2021 17:42:35 CEST, Denys Vlasenko <vda.linux@googlemail.com> wrote:
> >+      if (opts & OPT_a) {
> >+              char dn[sizeof("/proc/%s/task") + 3 * sizeof(int)];
> >+              DIR *dir;
> >+              struct dirent *ent;
> >+
> >+              sprintf(dn, "/proc/%s/task", pid_str);
> >+              dir = opendir(dn);
> >+              if (!dir) {
> >+                      goto no_threads;
> >+              }
> >+              while ((ent = readdir(dir)) != NULL) {
> >+                      if (isdigit(ent->d_name[0]))
> >+                              process_pid_str(ent->d_name, opts, aff);
> >+              }
> >+              IF_FEATURE_CLEAN_UP(closedir(dir);)
>
> Is this opencoded hunk smaller than a variant with recursive_action?

I didn't try.

I don't expect it to be significantly smaller. 50/50 it would be larger.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic