public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: LTP List <ltp-list@lists.sourceforge.net>
Subject: Re: [LTP] [PATCH] containers: Use raw setns syscall for versions of glibc that don't include it
Date: Tue, 14 Jul 2015 11:31:01 +0200	[thread overview]
Message-ID: <20150714093101.GA3729@rei.suse.de> (raw)
In-Reply-To: <1435721609-7938-1-git-send-email-liuhangbin@gmail.com>

Hi!
> diff --git a/testcases/kernel/containers/userns/userns_helper.h b/testcases/kernel/containers/userns/userns_helper.h
> index da03bae..21e5cb8 100644
> --- a/testcases/kernel/containers/userns/userns_helper.h
> +++ b/testcases/kernel/containers/userns/userns_helper.h
> @@ -15,6 +15,16 @@
>  #include "test.h"
>  #include "safe_macros.h"
>  
> +/*
> + * Use raw setns syscall for versions of glibc that don't include it
> + */
> +#if __GLIBC__ <= 2 && __GLIBC_MINOR__ < 14
> +int setns(int fd, int nstype)
> +{
> +	return ltp_syscall(__NR_setns, fd, nstype);
> +}
> +#endif

I would rather see this as configure check. Simple
AC_CHECK_FUNCS([setns]) would do, then we can use #ifndef HAVE_SETNS in
the source after we include config.h.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2015-07-14  9:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01  3:33 [LTP] [PATCH] containers: Use raw setns syscall for versions of glibc that don't include it Hangbin Liu
2015-07-14  9:31 ` Cyril Hrubis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-30  6:18 Hangbin Liu
2015-06-30  6:55 ` Jan Stancek

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=20150714093101.GA3729@rei.suse.de \
    --to=chrubis@suse.cz \
    --cc=liuhangbin@gmail.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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