[PATCH 1/7] PID namespace translation support

Ákos Uzonyi uzonyi.akos at gmail.com
Sat Jul 18 09:43:23 UTC 2020


On Thu, 16 Jul 2020 at 20:24, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Sun, Jul 12, 2020 at 09:46:30PM +0200, Ákos Uzonyi wrote:
> > (init): Add -Y and --pidns-translation option.
>
> I'm not sure -Y is versatile enough.  Do we really need a short option
> for this feature when --pidns-translation abbreviates so well?

Agreed, the long option seems to be enough.

> > +static int
> > +get_pid_max(void)
> > +{
> > +     static int pid_max = -1;
> > +
> > +     if (pid_max < 0) {
> > +             pid_max = INT_MAX;
> > +
> > +             FILE *f = fopen("/proc/sys/kernel/pid_max", "r");
> > +             if (!f)
> > +                     perror_msg("opening /proc/sys/kernel/pid_max");
> > +             else
> > +                     fscanf(f, "%d", &pid_max);
> > +     }
> > +
> > +     return pid_max;
> > +}
>
> Consider using read_int_from_file function.

Ok.
read_int_from_file has a tcp parameter, which is not used. Can I remove it?


More information about the Strace-devel mailing list