OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/linux_util.h" | 5 #include "base/linux_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 <limits.h> |
10 #include <stdlib.h> | 11 #include <stdlib.h> |
11 #include <sys/stat.h> | 12 #include <sys/stat.h> |
12 #include <sys/types.h> | 13 #include <sys/types.h> |
13 #include <unistd.h> | 14 #include <unistd.h> |
14 | 15 |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "base/command_line.h" | 18 #include "base/command_line.h" |
18 #include "base/files/file_util.h" | 19 #include "base/files/file_util.h" |
19 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/singleton.h" | 21 #include "base/memory/singleton.h" |
21 #include "base/process/launch.h" | 22 #include "base/process/launch.h" |
22 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
23 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "build/build_config.h" |
24 | 26 |
25 namespace { | 27 namespace { |
26 | 28 |
27 // Not needed for OS_CHROMEOS. | 29 // Not needed for OS_CHROMEOS. |
28 #if defined(OS_LINUX) | 30 #if defined(OS_LINUX) |
29 enum LinuxDistroState { | 31 enum LinuxDistroState { |
30 STATE_DID_NOT_CHECK = 0, | 32 STATE_DID_NOT_CHECK = 0, |
31 STATE_CHECK_STARTED = 1, | 33 STATE_CHECK_STARTED = 1, |
32 STATE_CHECK_FINISHED = 2, | 34 STATE_CHECK_FINISHED = 2, |
33 }; | 35 }; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 172 |
171 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), | 173 if (0 == strncmp(expected_data.c_str(), syscall_data.get(), |
172 expected_data.length())) { | 174 expected_data.length())) { |
173 return current_tid; | 175 return current_tid; |
174 } | 176 } |
175 } | 177 } |
176 return -1; | 178 return -1; |
177 } | 179 } |
178 | 180 |
179 } // namespace base | 181 } // namespace base |
OLD | NEW |