Re: [patch V3 2/8] add prctl task isolation prctl docs and samples

From: Marcelo Tosatti
Date: Wed Sep 01 2021 - 13:38:21 EST


On Wed, Sep 01, 2021 at 09:11:56AM -0400, Nitesh Lal wrote:
> On Tue, Aug 24, 2021 at 11:42 AM Marcelo Tosatti <mtosatti@xxxxxxxxxx> wrote:
> >
> > Add documentation and userspace sample code for prctl
> > task isolation interface.
> >
> > Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>
> >
> > ---
> > Documentation/userspace-api/task_isolation.rst | 211 +++++++++++++++++++++++++
> > samples/Kconfig | 7
> > samples/Makefile | 1
> > samples/task_isolation/Makefile | 9 +
> > samples/task_isolation/task_isol.c | 83 +++++++++
> > samples/task_isolation/task_isol.h | 9 +
> > samples/task_isolation/task_isol_userloop.c | 56 ++++++
> > 7 files changed, 376 insertions(+)
>
> [...]
>
> > + if (ret) {
> > + perror("mlock");
> > + return EXIT_FAILURE;
> > + }
> > +
> > + ret = task_isol_setup();
> > + if (ret)
> > + return EXIT_FAILURE;
>
> The above check condition should be 'ret == -1', isn't it?

task_isol_setup returns 0 on success, so fail to see the point
of testing for ret == -1 rather than ret != 0 ?