From: chrubis@suse.cz
To: Mike Frysinger <vapier@gentoo.org>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH???v3] lib/cloner.c: add function ltp_clone7 when clone supports???7 arguments
Date: Thu, 9 Jan 2014 16:04:20 +0100 [thread overview]
Message-ID: <20140109150420.GI5125@rei.Home> (raw)
In-Reply-To: <201401090947.12749.vapier@gentoo.org>
Hi!
> > So create m4/ltp-clone7args.m4 to check whether clone support 7 arguments.
> > If HAVE_CLONE7ARGS is defined, ltp_clone7 will be defined in lib/cloner.c.
> >
> > When tests need pass 7 arguments to clone, ltp_clone7 should be used. When
> > HAVE_CLONE7ARGS is not defined, make these tests return TCONF, like
> > clone08.
>
> the current clone function is broken. you cannot call va_args on an arg that
> doesn't exist. but if the suggestions below are implemented, this shouldn't
> be a problem anymore.
>
> > --- a/include/test.h
> > +++ b/include/test.h
> >
> > /* Functions from lib/cloner.c */
> > int ltp_clone(unsigned long clone_flags, int (*fn)(void *arg), void *arg,
> > + size_t stack_size, void *stack);
> > +#ifdef HAVE_CLONE7ARGS
> > +int ltp_clone7(unsigned long clone_flags, int (*fn)(void *arg), void *arg,
> > size_t stack_size, void *stack, ...);
> > +#endif
>
> always define this prototype
>
> > --- a/lib/cloner.c
> > +++ b/lib/cloner.c
>
> add a helper here like:
>
> #ifndef CLONE_SUPPORTS_7_ARGS
> # define clone(fn, stack, flags, arg, ptid, tls, ctid) clone(fn, stack, flags, arg)
> #endif
>
> rename the existing ltp_clone to a static _ltp_clone
>
> create a new ltp_clone that just calls _ltp_clone and passes in NULL for the
> additional 3 args
>
> in the new ltp_clone7, have it do:
> #ifdef CLONE_SUPPORTS_7_ARGS
> ... call _ltp_clone ...
> #else
> ... call TCONF or TBROK or something ...
> #endif
>
> that should keep all the test logic simple as Cyril suggested. no need for
> them to check ifdefs, just call ltp_clone7 instead.
I will finish this one, the solution is nearly ready and I have the
means to quickly test it on most of the distros/archs.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-01-09 15:04 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 9:29 [LTP] [PATCH v5 1/2] lib/cloner.c: add more args zenglg.jy
2013-12-23 1:11 ` Wanlong Gao
2014-01-07 14:09 ` chrubis
[not found] ` <1389181297.2879.11.camel@G08JYZSD130126>
2014-01-08 13:20 ` chrubis
[not found] ` <1389191490.2879.27.camel@G08JYZSD130126>
2014-01-08 15:15 ` [LTP] [PATCH] clone/clone08.c: check whether clone supports 7 arguments chrubis
[not found] ` <1389254938.2025.3.camel@G08JYZSD130126>
2014-01-09 11:36 ` chrubis
[not found] ` <1389269411.2149.8.camel@G08JYZSD130126>
2014-01-09 13:27 ` [LTP] [PATCH???v3] lib/cloner.c: add function ltp_clone7 when clone supports???7 arguments chrubis
[not found] ` <201401090947.12749.vapier@gentoo.org>
2014-01-09 15:04 ` chrubis [this message]
2014-01-09 16:37 ` chrubis
[not found] ` <629935924.13499645.1389289589284.JavaMail.root@redhat.com>
2014-01-09 18:08 ` chrubis
[not found] ` <201401091417.16506.vapier@gentoo.org>
2014-01-13 16:02 ` chrubis
[not found] ` <201401081447.46449.vapier@gentoo.org>
2014-01-09 11:24 ` [LTP] [PATCH] clone/clone08.c: check whether clone supports 7 arguments chrubis
[not found] ` <201401090803.39606.vapier@gentoo.org>
2014-01-09 13:09 ` chrubis
[not found] ` <201401090900.59568.vapier@gentoo.org>
2014-01-09 14:34 ` chrubis
2014-01-09 13:23 ` Jan Stancek
2014-01-09 13:51 ` Mike Frysinger
2014-01-09 14:10 ` Jan Stancek
2014-01-09 14:30 ` Mike Frysinger
2014-01-09 14:39 ` chrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140109150420.GI5125@rei.Home \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=vapier@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox