[ 
https://issues.apache.org/jira/browse/MESOS-5121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255549#comment-15255549
 ] 

haosdent commented on MESOS-5121:
---------------------------------

I take a look at [~RobinDong]'s [patch | 
https://reviews.apache.org/r/34882/diff/1#index_header] for arm64 today. I 
think the better way to make pivot_root works in different platforms are add 
this line from his patch

{code}
#include <linux/unistd.h>
{code}

This header file contains the define for {{__NR_pivot_root}}

cc [~janisz]

> pivot_root is not available on PowerPC
> --------------------------------------
>
>                 Key: MESOS-5121
>                 URL: https://issues.apache.org/jira/browse/MESOS-5121
>             Project: Mesos
>          Issue Type: Bug
>            Reporter: Chen Zhiwei
>            Assignee: Chen Zhiwei
>             Fix For: 0.29.0
>
>
> When compile on ppc64le, it will through error message: 
> src/linux/fs.cpp:443:2: error: #error "pivot_root is not available"
> The current code logic in src/linux/fs.cpp is:
> {code}
> #ifdef __NR_pivot_root
>   int ret = ::syscall(__NR_pivot_root, newRoot.c_str(), putOld.c_str());
> #elif __x86_64__
>   // A workaround for systems that have an old glib but have a new
>   // kernel. The magic number '155' is the syscall number for
>   // 'pivot_root' on the x86_64 architecture, see
>   // arch/x86/syscalls/syscall_64.tbl
>   int ret = ::syscall(155, newRoot.c_str(), putOld.c_str());
> #else
> #error "pivot_root is not available"
> #endif
> {code}
> There is no old glib version and the new kernel version, it will never run 
> code in *#ifdef __NR_pivot_root* condition, and when I build on Ubuntu 
> 16.04(It has the latest linux kernel and glibc), it still can't step into the 
> *#ifdef __NR_pivot_root* condition.
> For powerpc case, I added another condition:
> {code}
> #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
>   // A workaround for powerpc. The magic number '203' is the syscall
>   // number for 'pivot_root' on the powerpc architecture, see
>   // https://w3challs.com/syscalls/?arch=powerpc_64
>   int ret = ::syscall(203, newRoot.c_str(), putOld.c_str());
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to