Chromium Code Reviews| 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 "mojo/edk/embedder/platform_channel_utils_posix.h" | 5 #include "mojo/edk/embedder/platform_channel_utils_posix.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 const int kSendFlags = MSG_NOSIGNAL; | 52 const int kSendFlags = MSG_NOSIGNAL; |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 ssize_t PlatformChannelWrite(PlatformHandle h, | 55 ssize_t PlatformChannelWrite(PlatformHandle h, |
| 56 const void* bytes, | 56 const void* bytes, |
| 57 size_t num_bytes) { | 57 size_t num_bytes) { |
| 58 DCHECK(h.is_valid()); | 58 DCHECK(h.is_valid()); |
| 59 DCHECK(bytes); | 59 DCHECK(bytes); |
| 60 DCHECK_GT(num_bytes, 0u); | 60 DCHECK_GT(num_bytes, 0u); |
| 61 | 61 |
| 62 #if defined(OS_MACOSX) | 62 #if defined(OS_MACOSX) || defined(OS_NACL_NONSFI) |
| 63 // send() doesn't appear to work under NaCl-nonsfi. | |
|
Mark Seaborn
2016/06/20 21:12:15
You can be more definite: "doesn't appear to work"
Anand Mistry (off Chromium)
2016/06/21 00:32:27
Done.
| |
| 63 return HANDLE_EINTR(write(h.handle, bytes, num_bytes)); | 64 return HANDLE_EINTR(write(h.handle, bytes, num_bytes)); |
| 64 #else | 65 #else |
| 65 return send(h.handle, bytes, num_bytes, kSendFlags); | 66 return send(h.handle, bytes, num_bytes, kSendFlags); |
| 66 #endif | 67 #endif |
| 67 } | 68 } |
| 68 | 69 |
| 69 ssize_t PlatformChannelWritev(PlatformHandle h, | 70 ssize_t PlatformChannelWritev(PlatformHandle h, |
| 70 struct iovec* iov, | 71 struct iovec* iov, |
| 71 size_t num_iov) { | 72 size_t num_iov) { |
| 72 DCHECK(h.is_valid()); | 73 DCHECK(h.is_valid()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 DCHECK(platform_handles->back().is_valid()); | 188 DCHECK(platform_handles->back().is_valid()); |
| 188 } | 189 } |
| 189 } | 190 } |
| 190 } | 191 } |
| 191 | 192 |
| 192 return result; | 193 return result; |
| 193 } | 194 } |
| 194 | 195 |
| 195 } // namespace edk | 196 } // namespace edk |
| 196 } // namespace mojo | 197 } // namespace mojo |
| OLD | NEW |