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 <errno.h> | 5 #include "platform/globals.h" |
6 #include <fcntl.h> | 6 #if defined(TARGET_OS_ANDROID) |
7 #include <unistd.h> | 7 |
8 #include <sys/ioctl.h> | 8 #include <errno.h> // NOLINT |
| 9 #include <fcntl.h> // NOLINT |
| 10 #include <unistd.h> // NOLINT |
| 11 #include <sys/ioctl.h> // NOLINT |
9 | 12 |
10 #include "bin/fdutils.h" | 13 #include "bin/fdutils.h" |
11 | 14 |
12 | 15 |
13 bool FDUtils::SetCloseOnExec(intptr_t fd) { | 16 bool FDUtils::SetCloseOnExec(intptr_t fd) { |
14 intptr_t status; | 17 intptr_t status; |
15 status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD)); | 18 status = TEMP_FAILURE_RETRY(fcntl(fd, F_GETFD)); |
16 if (status < 0) { | 19 if (status < 0) { |
17 perror("fcntl F_GETFD failed"); | 20 perror("fcntl F_GETFD failed"); |
18 return false; | 21 return false; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ASSERT(errno != EWOULDBLOCK); | 128 ASSERT(errno != EWOULDBLOCK); |
126 return -1; | 129 return -1; |
127 } else { | 130 } else { |
128 ASSERT(bytes_written > 0); | 131 ASSERT(bytes_written > 0); |
129 remaining -= bytes_written; | 132 remaining -= bytes_written; |
130 buffer_pos += bytes_written; | 133 buffer_pos += bytes_written; |
131 } | 134 } |
132 } | 135 } |
133 return count; | 136 return count; |
134 } | 137 } |
| 138 |
| 139 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |