OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ | 6 #ifndef PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ |
7 #define PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ | 7 #define PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ |
8 | 8 |
9 #include <errno.h> | 9 #include <errno.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 struct FileHandle { | 151 struct FileHandle { |
152 Mount *mount; | 152 Mount *mount; |
153 Socket* stream; | 153 Socket* stream; |
154 ino_t node; | 154 ino_t node; |
155 off_t offset; | 155 off_t offset; |
156 int flags; | 156 int flags; |
157 int use_count; | 157 int use_count; |
158 pthread_mutex_t lock; | 158 pthread_mutex_t lock; |
159 }; | 159 }; |
160 FileHandle* GetFileHandle(int fd); | 160 FileHandle* GetFileHandle(int fd); |
| 161 int Close(int fd); |
161 | 162 |
162 BaseSocketSubSystem* socket_subsystem_; | 163 BaseSocketSubSystem* socket_subsystem_; |
163 Path cwd_; | 164 Path cwd_; |
164 int max_path_len_; | 165 int max_path_len_; |
165 MountManager mm_; | 166 MountManager mm_; |
166 pthread_mutex_t kp_lock_; | 167 pthread_mutex_t kp_lock_; |
167 static KernelProxy *kp_instance_; | 168 static KernelProxy *kp_instance_; |
168 | 169 |
169 SlotAllocator<FileDescriptor> fds_; | 170 SlotAllocator<FileDescriptor> fds_; |
170 SlotAllocator<FileHandle> open_files_; | 171 SlotAllocator<FileHandle> open_files_; |
171 | 172 |
172 int OpenHandle(Mount *mount, const std::string& path, int oflag, mode_t mode); | 173 int OpenHandle(Mount *mount, const std::string& path, int oflag, mode_t mode); |
173 | 174 |
174 KernelProxy(); | 175 KernelProxy(); |
175 static void Instantiate(); | 176 static void Instantiate(); |
176 }; | 177 }; |
177 | 178 |
178 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ | 179 #endif // PACKAGES_LIBRARIES_NACL_MOUNTS_BASE_KERNELPROXY_H_ |
OLD | NEW |