On Thu, 2008-09-04 at 15:44 -0500, Serge E. Hallyn wrote:
> Quoting Matt Helsley ([EMAIL PROTECTED]):
> > When it comes to this program, why should we care what the arch is?
> > Shouldn't the SYS_ and __NR numbers alone tell us if unshare() is relevant 
> > here?
> > Also, suppose both SYS_unshare and __NR_unshare aren't defined and we're 
> > running
> > on an i386 box. This means we'll trigger the block:
> > 
> >         #elif __i386__
> >                 int do_check(void) { return kernel_is_too_old(); }
> > 
> > Which is totally wrong. Fix these up by ignoring the arch and boiling it all
> > down to a corrected check for the proper define(s). See sys/syscall.h for
> > details on SYS_ vs. __NR_.
> > 
> > Signed-off-by: Matt Helsley <[EMAIL PROTECTED]>
> 
> Absolutely.
> 
> Acked-by: Serge Hallyn <[EMAIL PROTECTED]>

Merged-By: Subrata Modak <[EMAIL PROTECTED]>

> 
> > Cc: Veerendra Chandrappa <[EMAIL PROTECTED]>
> > Cc: Sudhir Kumar15 <[EMAIL PROTECTED]>
> > Cc: Subrata Modak <[EMAIL PROTECTED]>
> > Cc: Serge E. Hallyn <[EMAIL PROTECTED]>
> > ---
> >  testcases/kernel/containers/check_for_unshare.c |   23 
> > +++++++----------------
> >  1 file changed, 7 insertions(+), 16 deletions(-)
> > 
> > Index: 
> > ltp-intermediate-20080820/testcases/kernel/containers/check_for_unshare.c
> > ===================================================================
> > --- 
> > ltp-intermediate-20080820.orig/testcases/kernel/containers/check_for_unshare.c
> > +++ 
> > ltp-intermediate-20080820/testcases/kernel/containers/check_for_unshare.c
> > @@ -15,7 +15,6 @@
> >  *
> >  
> > ***************************************************************************/
> >  #include <stdio.h>
> > -#include <test.h>
> > 
> >  int kernel_is_too_old(void) {
> >     if (tst_kvercmp(2,6,16) < 0)
> > @@ -27,24 +26,16 @@ int kernel_is_too_old(void) {
> >   * yeah, to make the makefile coding easier, do_check returns 
> >   * 1 if unshare is not supported, 0 if it is
> >   */
> > -#ifndef SYS_unshare
> > -#ifdef __NR_unshare
> > -int do_check(void) { return kernel_is_too_old(); }
> > -#elif __i386__
> > -int do_check(void) { return kernel_is_too_old(); }
> > -#elif __ia64__
> > -int do_check(void) { return kernel_is_too_old(); }
> > -#elif __x86_64__
> > -int do_check(void) { return kernel_is_too_old(); }
> > -#elif __s390x__ || __s390__
> > -int do_check(void) { return kernel_is_too_old(); }
> > -#elif __powerpc__
> > -int do_check(void) { return kernel_is_too_old(); }
> > +#if defined(SYS_unshare) || defined(__NR_unshare)
> > +int do_check(void)
> > +{
> > +   return kernel_is_too_old();
> > +}
> >  #else
> >  int do_check(void) { return 1; }
> >  #endif
> > -#endif
> > 
> > -int main() {
> > +int main()
> > +{
> >     return do_check();
> >  }
> > 
> > -- 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to