We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4721ee7 commit 19c1d03Copy full SHA for 19c1d03
compiler-rt/test/tsan/Linux/clone_setns.cpp
@@ -11,7 +11,10 @@
11
#include <sys/wait.h>
12
13
static int cloned(void *arg) {
14
- if (unshare(CLONE_NEWUSER)) {
+ // Unshare can fail for other reasons, e.g. no permissions,
15
+ // so check only the error we are interested in:
16
+ // if the process is multi-threaded unshare must return EINVAL.
17
+ if (unshare(CLONE_NEWUSER) && errno == EINVAL) {
18
fprintf(stderr, "unshare failed: %d\n", errno);
19
exit(1);
20
}
0 commit comments