OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sandbox/linux/services/proc_util.h" | 5 #include "sandbox/linux/services/proc_util.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // No open unmanaged directories found. | 104 // No open unmanaged directories found. |
105 return false; | 105 return false; |
106 } | 106 } |
107 | 107 |
108 bool ProcUtil::HasOpenDirectory() { | 108 bool ProcUtil::HasOpenDirectory() { |
109 base::ScopedFD proc_fd( | 109 base::ScopedFD proc_fd( |
110 HANDLE_EINTR(open("/proc/", O_DIRECTORY | O_RDONLY | O_CLOEXEC))); | 110 HANDLE_EINTR(open("/proc/", O_DIRECTORY | O_RDONLY | O_CLOEXEC))); |
111 return HasOpenDirectory(proc_fd.get()); | 111 return HasOpenDirectory(proc_fd.get()); |
112 } | 112 } |
113 | 113 |
114 //static | 114 // static |
115 base::ScopedFD ProcUtil::OpenProc() { | 115 base::ScopedFD ProcUtil::OpenProc() { |
116 return OpenDirectory("/proc/"); | 116 return OpenDirectory("/proc/"); |
117 } | 117 } |
118 | 118 |
119 } // namespace sandbox | 119 } // namespace sandbox |
OLD | NEW |