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 "nacl_io/jsfs/js_fs.h" | 5 #include "nacl_io/jsfs/js_fs.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <limits.h> | 10 #include <limits.h> |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if (iter != responses_.end()) { | 384 if (iter != responses_.end()) { |
385 PP_Var response = iter->second; | 385 PP_Var response = iter->second; |
386 responses_.erase(iter); | 386 responses_.erase(iter); |
387 return response; | 387 return response; |
388 } | 388 } |
389 | 389 |
390 pthread_cond_wait(&response_cond_, lock_.mutex()); | 390 pthread_cond_wait(&response_cond_, lock_.mutex()); |
391 } | 391 } |
392 } | 392 } |
393 | 393 |
394 Error JsFs::Open(const Path& path, int open_flags, ScopedNode* out_node) { | 394 Error JsFs::OpenWithMode(const Path& path, int open_flags, mode_t t, |
| 395 ScopedNode* out_node) { |
395 out_node->reset(NULL); | 396 out_node->reset(NULL); |
396 ScopedVar response(ppapi_); | 397 ScopedVar response(ppapi_); |
397 if (!SendRequestAndWait(&response, "%s%s%d", | 398 if (!SendRequestAndWait(&response, "%s%s%d", |
398 "cmd", "open", | 399 "cmd", "open", |
399 "path", path.Join().c_str(), | 400 "path", path.Join().c_str(), |
400 "oflag", open_flags)) { | 401 "oflag", open_flags)) { |
401 LOG_ERROR("Failed to send request."); | 402 LOG_ERROR("Failed to send request."); |
402 return EINVAL; | 403 return EINVAL; |
403 } | 404 } |
404 | 405 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 LOG_TRACE("ioctl with no \"id\", ignoring.\n"); | 492 LOG_TRACE("ioctl with no \"id\", ignoring.\n"); |
492 return EINVAL; | 493 return EINVAL; |
493 } | 494 } |
494 | 495 |
495 responses_.insert(ResponseMap_t::value_type(response_id, response)); | 496 responses_.insert(ResponseMap_t::value_type(response_id, response)); |
496 pthread_cond_broadcast(&response_cond_); | 497 pthread_cond_broadcast(&response_cond_); |
497 return 0; | 498 return 0; |
498 } | 499 } |
499 | 500 |
500 } // namespace nacl_io | 501 } // namespace nacl_io |
OLD | NEW |