Quoting Veerendra ([EMAIL PROTECTED]):
> Serge E. Hallyn wrote:
>> Quoting Veerendra ([EMAIL PROTECTED]):
>>   
>>> Veerendra wrote:
>>>     
>>>> Signed-off-by: Veerendra C <[EMAIL PROTECTED]>
>>>>
>>>> This patch consists of the files..
>>>>
>>>> containers/libclone/libclone.h
>>>> containers/libclone/libnetns.c
>>>> containers/libclone/Makefile
>>>>
>>>>
>>>> Regards
>>>> Veerendra C
>>>>
>>>>               
>>> Attaching the patch..
>>>
>>>
>>>     
>>
>>   
>>> Index: containers/libclone/libclone.h
>>> ===================================================================
>>> --- containers.orig/libclone/libclone.h
>>> +++ containers/libclone/libclone.h
>>> @@ -58,6 +58,46 @@ extern int  __clone2(int (*fn) (void *ar
>>>                  pid_t *parent_tid, void *tls, pid_t *child_tid);
>>>  #endif
>>>
>>> +#ifndef HAVE_UNSHARE
>>> +
>>> +#if __i386__
>>> +#    define __NR_unshare 310
>>> +#elif __x86_64__
>>> +#    define __NR_unshare 272
>>> +#elif __ia64__
>>> +#    define __NR_unshare 1296
>>> +#elif __s390x__
>>> +#    define __NR_unshare 303
>>> +#elif __powerpc__
>>> +#    define __NR_unshare 282
>>> +#else
>>> +#    error "Architecture not supported"
>>> +#endif
>>>     
>>
>> The existing libclone.h already tries to define these for arches that
>> need them.  I certainly believe that there are distributions which
>> are still funky, but let's understand why.
>>
>> Do you have a machine of your own on which you needed this?  Can you
>> remove this bit and let me know what happens?
>>   
> If I remove the above entries, and if I have only this entry now in my  
> libclone.h
>
> #ifndef SYS_unshare
> #ifdef __NR_unshare
> #define SYS_unshare __NR_unshare
> #elif __i386__
> #define SYS_unshare 310
> #elif __ia64__
> #define SYS_unshare 1296
> #elif __x86_64__
> #define SYS_unshare 272
> #elif __s390x__ || __s390__
> #define SYS_unshare 303
> #elif __powerpc__
> #define SYS_unshare 282
> #else
> #error "unshare not supported on this architecure."
> #endif
> #endif

Ah, ok, try adding the following  right below the above block:

#ifndef __NR_unshare
#define __NR_unshare SYS_unshare
#endif

That way at least we don't have 310 listed twice in the file.

What distro are you using, btw?

thanks,
-serge

> I am getting this
> e326m:~/tmp/ltp-full-20080731/testcases/kernel/containers/libclone # make
> cc -c -o libclone.o libclone.c
> In file included from libclone.c:17:
> libclone.h: In function ‘unshare’:
> libclone.h:83: error: ‘__NR_unshare’ undeclared (first use in this function)
> libclone.h:83: error: (Each undeclared identifier is reported only once
> libclone.h:83: error: for each function it appears in.)
> make: *** [libclone.o] Error 1
>
> So the variables SYS_unshare or the __NR_unshare is not defined.
> I tried this on the tree ( 2.6.27-rc2 kernel)  
> git://git.kernel.org/pub/scm/linux/kernel/git/daveh/linux-2.6-lxc.git
> How do I proceed ?


-------------------------------------------------------------------------
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