| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "bin/eventhandler.h" | 8 #include "bin/eventhandler.h" |
| 9 | 9 |
| 10 #include <errno.h> // NOLINT | 10 #include <errno.h> // NOLINT |
| 11 #include <pthread.h> // NOLINT | 11 #include <pthread.h> // NOLINT |
| 12 #include <stdio.h> // NOLINT | 12 #include <stdio.h> // NOLINT |
| 13 #include <string.h> // NOLINT | 13 #include <string.h> // NOLINT |
| 14 #include <sys/epoll.h> // NOLINT | 14 #include <sys/epoll.h> // NOLINT |
| 15 #include <sys/stat.h> // NOLINT | 15 #include <sys/stat.h> // NOLINT |
| 16 #include <unistd.h> // NOLINT | 16 #include <unistd.h> // NOLINT |
| 17 #include <fcntl.h> // NOLINT | 17 #include <fcntl.h> // NOLINT |
| 18 | 18 |
| 19 #include "bin/dartutils.h" | 19 #include "bin/dartutils.h" |
| 20 #include "bin/fdutils.h" | 20 #include "bin/fdutils.h" |
| 21 #include "bin/log.h" | 21 #include "bin/log.h" |
| 22 #include "bin/utils.h" | 22 #include "bin/utils.h" |
| 23 #include "platform/hashmap.h" | 23 #include "platform/hashmap.h" |
| 24 #include "platform/thread.h" | 24 #include "platform/thread.h" |
| 25 #include "platform/utils.h" | 25 #include "platform/utils.h" |
| 26 | 26 |
| 27 | 27 |
| 28 // Android doesn't define EPOLLRDHUP. |
| 29 #if !defined(EPOLLRDHUP) |
| 30 #define EPOLLRDHUP 0x2000 |
| 31 #endif // !defined(EPOLLRDHUP) |
| 32 |
| 33 |
| 28 namespace dart { | 34 namespace dart { |
| 29 namespace bin { | 35 namespace bin { |
| 30 | 36 |
| 31 static const int kInterruptMessageSize = sizeof(InterruptMessage); | 37 static const int kInterruptMessageSize = sizeof(InterruptMessage); |
| 32 static const int kInfinityTimeout = -1; | 38 static const int kInfinityTimeout = -1; |
| 33 static const int kTimerId = -1; | 39 static const int kTimerId = -1; |
| 34 static const int kShutdownId = -2; | 40 static const int kShutdownId = -2; |
| 35 | 41 |
| 36 | 42 |
| 37 // Unregister the file descriptor for a SocketData structure with epoll. | 43 // Unregister the file descriptor for a SocketData structure with epoll. |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 369 |
| 364 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { | 370 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { |
| 365 // The hashmap does not support keys with value 0. | 371 // The hashmap does not support keys with value 0. |
| 366 return dart::Utils::WordHash(fd + 1); | 372 return dart::Utils::WordHash(fd + 1); |
| 367 } | 373 } |
| 368 | 374 |
| 369 } // namespace bin | 375 } // namespace bin |
| 370 } // namespace dart | 376 } // namespace dart |
| 371 | 377 |
| 372 #endif // defined(TARGET_OS_ANDROID) | 378 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |