Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_handle.cc

Issue 349703003: [NaCl SDK] Add some more logging to nacl_io. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix linux host build Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "nacl_io/kernel_handle.h" 5 #include "nacl_io/kernel_handle.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <pthread.h> 8 #include <pthread.h>
9 9
10 #include "nacl_io/filesystem.h" 10 #include "nacl_io/filesystem.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // Attempt to clear O_APPEND. 144 // Attempt to clear O_APPEND.
145 return EPERM; 145 return EPERM;
146 } 146 }
147 // Only certain flags are mutable 147 // Only certain flags are mutable
148 const int mutable_flags = O_ASYNC | O_NONBLOCK; 148 const int mutable_flags = O_ASYNC | O_NONBLOCK;
149 flags &= mutable_flags; 149 flags &= mutable_flags;
150 handle_attr_.flags &= ~mutable_flags; 150 handle_attr_.flags &= ~mutable_flags;
151 handle_attr_.flags |= flags; 151 handle_attr_.flags |= flags;
152 return 0; 152 return 0;
153 } 153 }
154 default:
155 LOG_ERROR("Unsupported fcntl: %#x", request);
156 break;
154 } 157 }
155 return ENOSYS; 158 return ENOSYS;
156 } 159 }
157 160
158 Error KernelHandle::Accept(PP_Resource* new_sock, 161 Error KernelHandle::Accept(PP_Resource* new_sock,
159 struct sockaddr* addr, 162 struct sockaddr* addr,
160 socklen_t* len) { 163 socklen_t* len) {
161 SocketNode* sock = socket_node(); 164 SocketNode* sock = socket_node();
162 if (!sock) 165 if (!sock)
163 return ENOTSOCK; 166 return ENOTSOCK;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 return ENOTSOCK; 228 return ENOTSOCK;
226 if (OpenMode() == O_RDONLY) 229 if (OpenMode() == O_RDONLY)
227 return EACCES; 230 return EACCES;
228 231
229 AUTO_LOCK(handle_lock_); 232 AUTO_LOCK(handle_lock_);
230 return sock->SendTo(handle_attr_, buf, len, flags, dest_addr, addrlen, 233 return sock->SendTo(handle_attr_, buf, len, flags, dest_addr, addrlen,
231 out_len); 234 out_len);
232 } 235 }
233 236
234 } // namespace nacl_io 237 } // namespace nacl_io
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/jsfs/js_fs_node.cc ('k') | native_client_sdk/src/libraries/nacl_io/kernel_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698