/linux-6.12.1/Documentation/userspace-api/ |
D | unshare.rst | 1 unshare system call 4 This document describes the new system call, unshare(). The document 42 unshare() system call adds a primitive to the Linux thread model that 43 allows threads to selectively 'unshare' any resources that were being 44 shared at the time of their creation. unshare() was conceptualized by 46 of the discussion on POSIX threads on Linux. unshare() augments the 48 shared resources without creating a new process. unshare() is a natural 55 unshare() would be useful to large application frameworks such as PAM 58 when creating a new process using fork or clone, unshare() can benefit 61 where unshare() can be used. [all …]
|
/linux-6.12.1/tools/testing/selftests/net/af_unix/ |
D | diag_uid.c | 29 int unshare; in FIXTURE_VARIANT() local 35 .unshare = 0, in FIXTURE_VARIANT_ADD() 41 .unshare = CLONE_NEWUSER, in FIXTURE_VARIANT_ADD() 51 if (variant->unshare) in FIXTURE_SETUP() 52 ASSERT_EQ(unshare(variant->unshare), 0); in FIXTURE_SETUP()
|
/linux-6.12.1/tools/testing/selftests/pidfd/ |
D | pidfd_setns_test.c | 141 if (unshare(CLONE_NEWTIME)) in switch_timens() 225 if (self->nsfds[PIDFD_NS_USER] >= 0 && unshare(CLONE_NEWUSER) < 0) in FIXTURE_SETUP() 227 if (self->nsfds[PIDFD_NS_NET] >= 0 && unshare(CLONE_NEWNET) < 0) in FIXTURE_SETUP() 256 if (self->nsfds[PIDFD_NS_MNT] >= 0 && unshare(CLONE_NEWNS) < 0) { in FIXTURE_SETUP() 260 if (self->nsfds[PIDFD_NS_CGROUP] >= 0 && unshare(CLONE_NEWCGROUP) < 0) { in FIXTURE_SETUP() 264 if (self->nsfds[PIDFD_NS_IPC] >= 0 && unshare(CLONE_NEWIPC) < 0) { in FIXTURE_SETUP() 268 if (self->nsfds[PIDFD_NS_UTS] >= 0 && unshare(CLONE_NEWUTS) < 0) { in FIXTURE_SETUP() 272 if (self->nsfds[PIDFD_NS_NET] >= 0 && unshare(CLONE_NEWNET) < 0) { in FIXTURE_SETUP() 310 if (self->nsfds[PIDFD_NS_MNT] >= 0 && unshare(CLONE_NEWNS) < 0) { in FIXTURE_SETUP() 314 if (self->nsfds[PIDFD_NS_CGROUP] >= 0 && unshare(CLONE_NEWCGROUP) < 0) { in FIXTURE_SETUP() [all …]
|
/linux-6.12.1/tools/testing/selftests/pid_namespace/ |
D | regression_enomem.c | 27 EXPECT_EQ(0, unshare(CLONE_NEWUSER)); in TEST() 29 EXPECT_EQ(0, unshare(CLONE_NEWPID)); in TEST()
|
/linux-6.12.1/tools/testing/selftests/net/packetdrill/ |
D | ksft_runner.sh | 41 unshare -n packetdrill ${ipv4_args[@]} ${optargs[@]} $(basename $script) > /dev/null \ 43 unshare -n packetdrill ${ipv6_args[@]} ${optargs[@]} $(basename $script) > /dev/null \
|
/linux-6.12.1/tools/testing/selftests/proc/ |
D | setns-dcache.c | 54 if (unshare(CLONE_NEWNET) == -1) { in main() 75 if (unshare(CLONE_NEWNET) == -1) { in main()
|
D | setns-sysvipc.c | 53 if (unshare(CLONE_NEWIPC) == -1) { in main() 74 if (unshare(CLONE_NEWIPC) == -1) { in main()
|
D | proc-loadavg-001.c | 30 if (unshare(CLONE_NEWPID) == -1) { in main()
|
D | proc-subset-pid.c | 42 if (unshare(CLONE_NEWNS) == -1) { in make_private_proc()
|
/linux-6.12.1/tools/testing/selftests/mount/ |
D | unprivileged-remount-test.c | 162 if (unshare(CLONE_NEWUSER) !=0) { in create_and_enter_userns() 211 if (unshare(CLONE_NEWNS) != 0) { in test_unpriv_remount() 225 if (unshare(CLONE_NEWNS) != 0) { in test_unpriv_remount() 291 ret = unshare(CLONE_NEWNS); in test_priv_mount_unpriv_remount()
|
D | nosymfollow-test.c | 99 if (unshare(CLONE_NEWUSER) != 0) in create_and_enter_ns() 111 if (unshare(CLONE_NEWNS) != 0) in create_and_enter_ns()
|
/linux-6.12.1/tools/testing/selftests/nsfs/ |
D | owner.c | 42 if (unshare(CLONE_NEWUTS | CLONE_NEWUSER)) in main() 81 if (unshare(CLONE_NEWUSER)) in main()
|
/linux-6.12.1/tools/testing/selftests/uevent/ |
D | uevent_filtering.c | 129 ret = unshare(CLONE_NEWUSER); in uevent_listener() 139 ret = unshare(CLONE_NEWNET); in uevent_listener() 276 ret = unshare(CLONE_NEWUSER); in do_test() 286 ret = unshare(CLONE_NEWNET); in do_test()
|
/linux-6.12.1/tools/testing/selftests/bpf/ |
D | test_flow_dissector.sh | 30 if ! unshare --net $bpftool prog attach pinned \ 39 if unshare --net $bpftool prog attach pinned \
|
/linux-6.12.1/tools/testing/selftests/tmpfs/ |
D | bug-link-o-tmpfile.c | 30 if (unshare(CLONE_NEWNS) == -1) { in main()
|
/linux-6.12.1/tools/testing/selftests/exec/ |
D | recursion-depth.c | 35 if (unshare(CLONE_NEWNS) == -1) { in main()
|
/linux-6.12.1/tools/testing/selftests/net/netfilter/ |
D | nf_conntrack_packetdrill.sh | 47 timeout "$PDRILL_TIMEOUT" unshare -n packetdrill --ip_version="$ipver" --mtu=$mtu \
|
/linux-6.12.1/Documentation/translations/zh_CN/userspace-api/ |
D | index.rst | 34 * unshare
|
D | no_new_privs.rst | 55 原则上,当 ``no_new_privs`` 被置位时, ``unshare(2)`` 和 ``clone(2)`` 的几个选
|
/linux-6.12.1/tools/testing/selftests/net/ |
D | so_netns_cookie.c | 41 if (unshare(CLONE_NEWNET)) in main()
|
/linux-6.12.1/tools/testing/selftests/move_mount_set_group/ |
D | move_mount_set_group_test.c | 85 if (unshare(CLONE_NEWUSER)) in create_and_enter_userns() 115 if (unshare(CLONE_NEWNS)) in prepare_unpriv_mountns()
|
/linux-6.12.1/tools/testing/selftests/timens/ |
D | timens.h | 56 if (unshare(CLONE_NEWTIME)) { in unshare_timens()
|
/linux-6.12.1/tools/testing/selftests/bpf/prog_tests/ |
D | deny_namespace.c | 41 if (unshare(CLONE_NEWUSER)) in create_user_ns()
|
D | bind_perm.c | 14 if (!ASSERT_OK(unshare(CLONE_NEWNET), "create netns")) in create_netns()
|
/linux-6.12.1/samples/binderfs/ |
D | binderfs_example.c | 23 ret = unshare(CLONE_NEWNS); in main()
|