Index: native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h |
diff --git a/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h b/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2bc3ac184c4cefb58987ab32ed9d682c0182fc02 |
--- /dev/null |
+++ b/native_client_sdk/src/libraries/nacl_io/passthroughfs/real_node.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+// |
+#ifndef LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_ |
+#define LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_ |
+ |
+#include "nacl_io/node.h" |
+ |
+namespace nacl_io { |
+ |
+class RealNode : public Node { |
+ public: |
+ RealNode(Filesystem* filesystem, int real_fd, bool close_on_destroy = false); |
+ |
+ protected: |
+ virtual Error Init(int flags) { return 0; } |
+ |
+ virtual void Destroy(); |
+ |
+ public: |
+ // Normal read/write operations on a file |
+ virtual Error Read(const HandleAttr& attr, |
+ void* buf, |
+ size_t count, |
+ int* out_bytes); |
+ virtual Error Write(const HandleAttr& attr, |
+ const void* buf, |
+ size_t count, |
+ int* out_bytes); |
+ virtual Error FTruncate(off_t size); |
+ virtual Error GetDents(size_t offs, |
+ struct dirent* pdir, |
+ size_t count, |
+ int* out_bytes); |
+ virtual Error GetStat(struct stat* stat); |
+ virtual Error Isatty(); |
+ virtual Error MMap(void* addr, |
+ size_t length, |
+ int prot, |
+ int flags, |
+ size_t offset, |
+ void** out_addr); |
+ |
+ private: |
+ int real_fd_; |
+ bool close_on_destroy_; |
+}; |
+ |
+} // namespace nacl_io |
+ |
+#endif // LIBRARIES_NACL_IO_PASSTHROUGHFS_REAL_NODE_H_ |