Why unshare(CLONE_NEWUSER) return error? (linux)
<p>This is my fairly simple code:</p>

<pre><code> #define _GNU_SOURCE
 #include &lt;sched.h&gt;
 #include &lt;errno.h&gt;
 #include &lt;stdio.h&gt;

 int main(){
   int res= unshare(CLONE_NEWUSER);
   printf("res:%d\n",res);
   perror("error");
   return 0;
}
</code></pre>

<p>Why does the code always fail (return -1)? </p>

<p>I'm on <code>Ubunto 13.04</code> this is my kernel version and other details:</p>

<pre><code>Linux ubuntu 3.10.37-031037-generic #201404141035 SMP Mon Apr 14 14:55:40 UTC 2014 i686 i686 i686 GNU/Linux
</code></pre>

<ul>
<li>errno returns <code>Invalid argument</code></li>
</ul>

<p>this is the output of the program :</p>

<pre><code>res:-1
error: Invalid argument
</code></pre>