[LTP] [PATCH v5] kill01: New case cgroup kill
    Li Wang 
    liwan@redhat.com
       
    Wed Mar 15 06:47:17 CET 2023
    
    
  
Richard Palethorpe <rpalethorpe@suse.de> wrote:
> > +static void run(void)
> > +{
> > +     pid_t pids[MAX_PID_NUM];
> > +     int i;
> > +
> > +     cg_child_test_simple = tst_cg_group_mk(tst_cg,
> > "cg_test_simple");
> > +
> > +     memset(buf, 0, buf_len);
>
> IIRC guarded buffers are zeroed already.
>
The memset() is necessary since there is probably run test with '-i N'
which lead to buf[] being impacted by last time.
> > +static void setup(void)
> > +{
> > +     buf = tst_alloc(buf_len);
>
> Simple allocations like this can be done in the test struct.
>
I pointed out this before but he seems don't want to use constant
for the buf_len definition (to bypass compile error in tst_test).
-- 
Regards,
Li Wang
    
    
More information about the ltp
mailing list