RFC V3 [1/2] test-in-container

Florian Weimer fweimer@redhat.com
Tue Jun 26 13:00:00 GMT 2018


On 03/02/2018 12:05 AM, DJ Delorie wrote:
> +  // The unshare here gives us our own spaces and capabilities.
> +  if (unshare (CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS) < 0)
> +    error (EXIT_UNSUPPORTED, errno, "unable to unshare user/fs, ");
> +
> +  /* Some systems, by default, all mounts leak out of the namespace.  */
> +  if (mount ("none", "/", NULL, MS_REC | MS_PRIVATE, NULL) != 0)
> +    error (EXIT_UNSUPPORTED, errno, "could not create a private mount namespace\n");

error writes error messages to standard error, where they aren't 
captured in the .out file.  You need to use something like 
FAIL_UNSUPPORTED or printf.

Thanks,
Florian



More information about the Libc-alpha mailing list