Home
last modified time | relevance | path

Searched refs:proc_fd (Results 1 – 12 of 12) sorted by relevance

/external/libchrome/sandbox/linux/services/
Dthread_helpers.cc37 bool IsSingleThreadedImpl(int proc_fd) { in IsSingleThreadedImpl() argument
38 CHECK_LE(0, proc_fd); in IsSingleThreadedImpl()
40 int fstat_ret = fstatat(proc_fd, "self/task/", &task_stat, 0); in IsSingleThreadedImpl()
51 bool IsThreadPresentInProcFS(int proc_fd, in IsThreadPresentInProcFS() argument
55 fstatat(proc_fd, thread_id_dir_str.c_str(), &task_stat, 0); in IsThreadPresentInProcFS()
63 bool IsNotThreadPresentInProcFS(int proc_fd, in IsNotThreadPresentInProcFS() argument
65 return !IsThreadPresentInProcFS(proc_fd, thread_id_dir_str); in IsNotThreadPresentInProcFS()
108 bool IsMultiThreaded(int proc_fd) { in IsMultiThreaded() argument
109 return !ThreadHelpers::IsSingleThreaded(proc_fd); in IsMultiThreaded()
115 int proc_fd, base::Thread* thread, ThreadAction action) { in ChangeThreadStateAndWatchProcFS() argument
[all …]
Dthread_helpers_unittests.cc57 ScopedProc proc_fd; in TEST() local
58 ASSERT_TRUE(ThreadHelpers::IsSingleThreaded(proc_fd.fd())); in TEST()
62 ASSERT_TRUE(ThreadHelpers::StartThreadAndWatchProcFS(proc_fd.fd(), &thread)); in TEST()
63 ASSERT_FALSE(ThreadHelpers::IsSingleThreaded(proc_fd.fd())); in TEST()
66 ASSERT_TRUE(ThreadHelpers::StopThreadAndWatchProcFS(proc_fd.fd(), &thread)); in TEST()
70 ScopedProc proc_fd; in SANDBOX_TEST() local
71 SANDBOX_ASSERT(ThreadHelpers::IsSingleThreaded(proc_fd.fd())); in SANDBOX_TEST()
74 ThreadHelpers::AssertSingleThreaded(proc_fd.fd()); in SANDBOX_TEST()
79 ScopedProc proc_fd; in TEST() local
80 ASSERT_TRUE(ThreadHelpers::IsSingleThreaded(proc_fd.fd())); in TEST()
[all …]
Dproc_util_unittest.cc17 base::ScopedFD proc_fd(open("/proc/", O_RDONLY | O_DIRECTORY)); in TEST() local
18 ASSERT_TRUE(proc_fd.is_valid()); in TEST()
19 int fd_count = ProcUtil::CountOpenFds(proc_fd.get()); in TEST()
22 EXPECT_EQ(fd_count + 1, ProcUtil::CountOpenFds(proc_fd.get())); in TEST()
24 EXPECT_EQ(fd_count, ProcUtil::CountOpenFds(proc_fd.get())); in TEST()
32 int proc_fd = open("/proc/", O_RDONLY | O_DIRECTORY); in TEST() local
33 base::ScopedFD proc_fd_closer(proc_fd); in TEST()
40 int proc_fd = open("/proc/", O_RDONLY | O_DIRECTORY); in TEST() local
41 base::ScopedFD proc_fd_closer(proc_fd); in TEST()
42 ASSERT_LE(0, proc_fd); in TEST()
[all …]
Dproc_util.cc42 int ProcUtil::CountOpenFds(int proc_fd) { in CountOpenFds() argument
43 DCHECK_LE(0, proc_fd); in CountOpenFds()
45 openat(proc_fd, "self/fd/", O_DIRECTORY | O_RDONLY | O_CLOEXEC)); in CountOpenFds()
63 if (fd_num == proc_fd || fd_num == proc_self_fd) { in CountOpenFds()
72 bool ProcUtil::HasOpenDirectory(int proc_fd) { in HasOpenDirectory() argument
73 DCHECK_LE(0, proc_fd); in HasOpenDirectory()
75 openat(proc_fd, "self/fd/", O_DIRECTORY | O_RDONLY | O_CLOEXEC); in HasOpenDirectory()
93 if (fd_num == proc_fd || fd_num == proc_self_fd) { in HasOpenDirectory()
110 base::ScopedFD proc_fd( in HasOpenDirectory() local
112 return HasOpenDirectory(proc_fd.get()); in HasOpenDirectory()
Dcredentials.cc156 bool Credentials::DropAllCapabilities(int proc_fd) { in DropAllCapabilities() argument
157 if (!SetCapabilities(proc_fd, std::vector<Capability>())) { in DropAllCapabilities()
167 base::ScopedFD proc_fd(ProcUtil::OpenProc()); in DropAllCapabilities() local
168 return Credentials::DropAllCapabilities(proc_fd.get()); in DropAllCapabilities()
197 bool Credentials::SetCapabilities(int proc_fd, in SetCapabilities() argument
199 DCHECK_LE(0, proc_fd); in SetCapabilities()
204 CHECK(ThreadHelpers::IsSingleThreaded(proc_fd)); in SetCapabilities()
314 bool Credentials::DropFileSystemAccess(int proc_fd) { in DropFileSystemAccess() argument
315 CHECK_LE(0, proc_fd); in DropFileSystemAccess()
319 CHECK(!ProcUtil::HasOpenDirectory(proc_fd)); in DropFileSystemAccess()
Dcredentials_unittest.cc163 base::ScopedFD proc_fd(ProcUtil::OpenProc()); in SANDBOX_TEST() local
164 CHECK(Credentials::DropAllCapabilities(proc_fd.get())); in SANDBOX_TEST()
167 CHECK(Credentials::DropFileSystemAccess(proc_fd.get())); in SANDBOX_TEST()
168 CHECK(Credentials::DropAllCapabilities(proc_fd.get())); in SANDBOX_TEST()
181 base::ScopedFD proc_fd(ProcUtil::OpenProc()); in SANDBOX_TEST() local
188 CHECK(Credentials::SetCapabilities(proc_fd.get(), caps)); in SANDBOX_TEST()
194 CHECK(Credentials::SetCapabilities(proc_fd.get(), no_caps)); in SANDBOX_TEST()
203 base::ScopedFD proc_fd(ProcUtil::OpenProc()); in SANDBOX_TEST() local
210 CHECK(Credentials::SetCapabilities(proc_fd.get(), caps)); in SANDBOX_TEST()
222 base::ScopedFD proc_fd(ProcUtil::OpenProc()); in SANDBOX_TEST() local
[all …]
Dthread_helpers.h20 static bool IsSingleThreaded(int proc_fd);
27 static void AssertSingleThreaded(int proc_fd);
32 static bool StartThreadAndWatchProcFS(int proc_fd, base::Thread* thread);
37 static bool StopThreadAndWatchProcFS(int proc_fd, base::Thread* thread);
Dcredentials.h42 static bool DropAllCapabilities(int proc_fd) WARN_UNUSED_RESULT;
47 static bool SetCapabilities(int proc_fd,
95 static bool DropFileSystemAccess(int proc_fd) WARN_UNUSED_RESULT;
Dproc_util.h19 static int CountOpenFds(int proc_fd);
30 static bool HasOpenDirectory(int proc_fd) WARN_UNUSED_RESULT;
/external/v8/src/base/platform/
Dplatform-qnx.cc124 int proc_fd, num, i; in GetSharedLibraryAddresses() local
134 if ((proc_fd = open(buf, O_RDONLY)) == -1) { in GetSharedLibraryAddresses()
135 close(proc_fd); in GetSharedLibraryAddresses()
140 if (devctl(proc_fd, DCMD_PROC_MAPINFO, NULL, 0, &num) != EOK) { in GetSharedLibraryAddresses()
141 close(proc_fd); in GetSharedLibraryAddresses()
148 close(proc_fd); in GetSharedLibraryAddresses()
153 if (devctl(proc_fd, DCMD_PROC_PAGEDATA, in GetSharedLibraryAddresses()
156 close(proc_fd); in GetSharedLibraryAddresses()
164 if (devctl(proc_fd, DCMD_PROC_MAPDEBUG, &map, sizeof(map), 0) != EOK) { in GetSharedLibraryAddresses()
172 close(proc_fd); in GetSharedLibraryAddresses()
/external/libchrome/sandbox/linux/seccomp-bpf/
Dsandbox_bpf.cc41 bool IsSingleThreaded(int proc_fd) { in IsSingleThreaded() argument
42 return ThreadHelpers::IsSingleThreaded(proc_fd); in IsSingleThreaded()
197 void SandboxBPF::SetProcFd(base::ScopedFD proc_fd) { in SetProcFd() argument
198 proc_fd_.swap(proc_fd); in SetProcFd()
Dsandbox_bpf.h75 void SetProcFd(base::ScopedFD proc_fd);