[CRIU] [PATCH 3/4] test: poll -- Use gettimeofday syscall directly

Cyrill Gorcunov gorcunov at gmail.com
Thu Mar 26 06:12:39 PDT 2015


On Thu, Mar 26, 2015 at 09:07:38AM -0400, Christopher Covington wrote:
> Hi Cyrill,
> 
> On 03/26/2015 04:23 AM, Cyrill Gorcunov wrote:
> > The gettimeofday uses /etc/localtime (thanks avagin@
> > for the hint) which is not present in namespace tests.
> > So lets use syscall directly and make test pass in
> > namespace environment as well.
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> >  test/zdtm/live/static/poll.c | 24 +++++++++++++++++++++---
> >  1 file changed, 21 insertions(+), 3 deletions(-)
> > 
> > diff --git a/test/zdtm/live/static/poll.c b/test/zdtm/live/static/poll.c
> > index 85f545593b6e..db4b427ce3e2 100644
> > --- a/test/zdtm/live/static/poll.c
> > +++ b/test/zdtm/live/static/poll.c
> > @@ -19,6 +19,24 @@
> >  const char *test_doc	= "Check poll() timeouts";
> >  const char *test_author	= "Cyrill Gorcunov <gorcunov at parallels.com>";
> >  
> > +#ifdef __x86_64__
> > +#define __NR_gettimeofday 96
> > +#else
> > +#define __NR_gettimeofday 78
> > +#endif
> 
> Does SYS_gettimeofday from <sys/syscall.h> not work?
> 
> http://man7.org/linux/man-pages/man2/syscall.2.html

Hi Christopher, I must admit, I didn't try it. Will try
and if work -- update, thanks!


More information about the CRIU mailing list