OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/process/process_handle.h" | 6 #include "base/process/process_handle.h" |
7 | 7 |
| 8 #include <limits.h> |
8 #include <stddef.h> | 9 #include <stddef.h> |
9 #include <sys/sysctl.h> | 10 #include <sys/sysctl.h> |
10 #include <sys/types.h> | 11 #include <sys/types.h> |
11 #include <sys/user.h> | 12 #include <sys/user.h> |
12 #include <unistd.h> | 13 #include <unistd.h> |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 | 16 |
16 ProcessId GetParentProcessId(ProcessHandle process) { | 17 ProcessId GetParentProcessId(ProcessHandle process) { |
17 struct kinfo_proc info; | 18 struct kinfo_proc info; |
(...skipping 15 matching lines...) Expand all Loading... |
33 | 34 |
34 if (sysctl(mib, arraysize(mib), pathname, &length, NULL, 0) < 0 || | 35 if (sysctl(mib, arraysize(mib), pathname, &length, NULL, 0) < 0 || |
35 length == 0) { | 36 length == 0) { |
36 return FilePath(); | 37 return FilePath(); |
37 } | 38 } |
38 | 39 |
39 return FilePath(std::string(pathname)); | 40 return FilePath(std::string(pathname)); |
40 } | 41 } |
41 | 42 |
42 } // namespace base | 43 } // namespace base |
OLD | NEW |