OLD | NEW |
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2013 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 #if defined(WIN32) | 5 #if defined(WIN32) |
6 #define _CRT_RAND_S | 6 #define _CRT_RAND_S |
7 #endif | 7 #endif |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "nacl_io/osunistd.h" | 21 #include "nacl_io/osunistd.h" |
22 #include "nacl_io/pepper_interface.h" | 22 #include "nacl_io/pepper_interface.h" |
23 #include "sdk_util/auto_lock.h" | 23 #include "sdk_util/auto_lock.h" |
24 | 24 |
25 #if defined(__native_client__) | 25 #if defined(__native_client__) |
26 #include <irt.h> | 26 #include <irt.h> |
27 #elif defined(WIN32) | 27 #elif defined(WIN32) |
28 #include <stdlib.h> | 28 #include <stdlib.h> |
29 #endif | 29 #endif |
30 | 30 |
| 31 namespace nacl_io { |
| 32 |
31 namespace { | 33 namespace { |
32 | 34 |
33 class RealNode : public MountNode { | 35 class RealNode : public MountNode { |
34 public: | 36 public: |
35 RealNode(Mount* mount, int fd); | 37 RealNode(Mount* mount, int fd); |
36 | 38 |
37 virtual Error Read(size_t offs, void* buf, size_t count, int* out_bytes); | 39 virtual Error Read(size_t offs, void* buf, size_t count, int* out_bytes); |
38 virtual Error Write(size_t offs, | 40 virtual Error Write(size_t offs, |
39 const void* buf, | 41 const void* buf, |
40 size_t count, | 42 size_t count, |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 INITIALIZE_DEV_NODE_1("/console2", ConsoleNode, PP_LOGLEVEL_WARNING); | 408 INITIALIZE_DEV_NODE_1("/console2", ConsoleNode, PP_LOGLEVEL_WARNING); |
407 INITIALIZE_DEV_NODE_1("/console3", ConsoleNode, PP_LOGLEVEL_ERROR); | 409 INITIALIZE_DEV_NODE_1("/console3", ConsoleNode, PP_LOGLEVEL_ERROR); |
408 INITIALIZE_DEV_NODE("/tty", TtyNode); | 410 INITIALIZE_DEV_NODE("/tty", TtyNode); |
409 INITIALIZE_DEV_NODE_1("/stdin", RealNode, 0); | 411 INITIALIZE_DEV_NODE_1("/stdin", RealNode, 0); |
410 INITIALIZE_DEV_NODE_1("/stdout", RealNode, 1); | 412 INITIALIZE_DEV_NODE_1("/stdout", RealNode, 1); |
411 INITIALIZE_DEV_NODE_1("/stderr", RealNode, 2); | 413 INITIALIZE_DEV_NODE_1("/stderr", RealNode, 2); |
412 | 414 |
413 return 0; | 415 return 0; |
414 } | 416 } |
415 | 417 |
| 418 } // namespace nacl_io |
| 419 |
OLD | NEW |