diff options
Diffstat (limited to 'native_client_sdk/src/libraries/nacl_io/kernel_object.h')
-rw-r--r-- | native_client_sdk/src/libraries/nacl_io/kernel_object.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_object.h b/native_client_sdk/src/libraries/nacl_io/kernel_object.h index 70ffb2f..ca6be9d 100644 --- a/native_client_sdk/src/libraries/nacl_io/kernel_object.h +++ b/native_client_sdk/src/libraries/nacl_io/kernel_object.h @@ -31,10 +31,13 @@ class KernelObject { public: struct Descriptor_t { Descriptor_t() : flags(0) {} - explicit Descriptor_t(const ScopedKernelHandle& h) : handle(h), flags(0) {} + explicit Descriptor_t(const ScopedKernelHandle& h, + const std::string& open_path) + : handle(h), flags(0), path(open_path) {} ScopedKernelHandle handle; int flags; + std::string path; }; typedef std::vector<Descriptor_t> HandleMap_t; typedef std::map<std::string, ScopedFilesystem> FsMap_t; @@ -71,14 +74,18 @@ class KernelObject { // Convert from FD to KernelHandle, and acquire the handle. // Assumes |out_handle| is non-NULL. Error AcquireHandle(int fd, ScopedKernelHandle* out_handle); + Error AcquireHandleAndPath(int fd, ScopedKernelHandle *out_handle, + std::string* out_path); // Allocate a new fd and assign the handle to it, while // ref counting the handle and associated filesystem. // Assumes |handle| is non-NULL; - int AllocateFD(const ScopedKernelHandle& handle); + int AllocateFD(const ScopedKernelHandle& handle, + const std::string& path=std::string()); // Assumes |handle| is non-NULL; - void FreeAndReassignFD(int fd, const ScopedKernelHandle& handle); + void FreeAndReassignFD(int fd, const ScopedKernelHandle& handle, + const std::string& path); void FreeFD(int fd); // Returns or sets CWD |