On Tue, 2014-01-07 at 15:09 +0100, chru...@suse.cz wrote:
> Hi!
> > add args with ptid and ctid in ltp_clone().
> > 
> > Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com>
> > ---
> >  include/test.h |  2 +-
> >  lib/cloner.c   | 20 ++++++++++++++++----
> >  2 files changed, 17 insertions(+), 5 deletions(-)
> > 
> > diff --git a/include/test.h b/include/test.h
> > index 94fc721..ffc1c8c 100644
> > --- a/include/test.h
> > +++ b/include/test.h
> > @@ -200,7 +200,7 @@ int self_exec(char *argv0, char *fmt, ...);
> >  
> >  /* Functions from lib/cloner.c */
> >  int ltp_clone(unsigned long clone_flags, int (*fn)(void *arg), void *arg,
> > -           size_t stack_size, void *stack);
> > +           size_t stack_size, void *stack, ...);
> >  int ltp_clone_malloc(unsigned long clone_flags, int (*fn)(void *arg),
> >             void *arg, size_t stacksize);
> >  int ltp_clone_quick(unsigned long clone_flags, int (*fn)(void *arg),
> > diff --git a/lib/cloner.c b/lib/cloner.c
> > index a68ff1e..93e3f8c 100644
> > --- a/lib/cloner.c
> > +++ b/lib/cloner.c
> > @@ -27,6 +27,7 @@
> >  #include <string.h>
> >  #include <stdlib.h>
> >  #include <sched.h>
> > +#include <stdarg.h>
> >  #include "test.h"
> >  
> >  #undef clone                       /* we want to use clone() */
> > @@ -50,20 +51,31 @@ extern int __clone2(int (*fn) (void *arg), void 
> > *child_stack_base,
> >   */
> >  int
> >  ltp_clone(unsigned long clone_flags, int (*fn) (void *arg), void *arg,
> > -     size_t stack_size, void *stack)
> > +     size_t stack_size, void *stack, ...)
> >  {
> >     int ret;
> > +   pid_t *parent_tid, *child_tid;
> > +   void *tls;
> > +   va_list arg_clone;
> > +
> > +   va_start(arg_clone, stack);
> > +   parent_tid = va_arg(arg_clone, pid_t *);
> > +   tls = va_arg(arg_clone, void *);
> > +   child_tid = va_arg(arg_clone, pid_t *);
> > +   va_end(arg_clone);
> >  
> >  #if defined(__hppa__) || defined(__metag__)
> > -   ret = clone(fn, stack, clone_flags, arg);
> > +   ret = clone(fn, stack, clone_flags, arg, parent_tid, tls, child_tid);
> >  #elif defined(__ia64__)
> > -   ret = clone2(fn, stack, stack_size, clone_flags, arg, NULL, NULL, NULL);
> > +   ret = clone2(fn, stack, stack_size, clone_flags, arg,
> > +                parent_tid, tls, child_tid);
> >  #else
> >     /*
> >      * For archs where stack grows downwards, stack points to the topmost
> >      * address of the memory space set up for the child stack.
> >      */
> > -   ret = clone(fn, (stack ? stack + stack_size : NULL), clone_flags, arg);
> > +   ret = clone(fn, (stack ? stack + stack_size : NULL), clone_flags, arg,
> > +               parent_tid, tls, child_tid);
> >  #endif
> >  
> >     return ret;
> 
> Looks like this patch breaks compilation on older distributions, I've
> got: "Too many arguments to function 'clone'". Has anybody seen this
> too?
> 

I run it in RHEL5.0GA, RHEL6.0GA, 7.0Beta
and do not find these messages.
Could you tell me which distributions it is.

> So this needs an autoconf check and few ifdefs.
> 
> And as we are about to create release this needs to be either fixed
> ASAP or we will have to revert it for the release.
> 

I will send a patch as soon as possible.

Thanks and best regards,
Zeng



------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to