Index: libraries/nacl-mounts/base/KernelProxy.h |
=================================================================== |
--- libraries/nacl-mounts/base/KernelProxy.h (revision 583) |
+++ libraries/nacl-mounts/base/KernelProxy.h (working copy) |
@@ -12,12 +12,15 @@ |
#endif |
#include <pthread.h> |
#ifdef __GLIBC__ |
+#include <netdb.h> |
#include <sys/epoll.h> |
#endif |
#include <sys/stat.h> |
#include <string> |
+#include "../base/FileHandle.h" |
#include "../base/Mount.h" |
#include "../base/MountManager.h" |
+#include "../net/BaseSocketSubSystem.h" |
#include "../util/Path.h" |
#include "../util/SimpleAutoLock.h" |
#include "../util/SlotAllocator.h" |
@@ -33,6 +36,7 @@ |
// Obtain the singleton instance of the kernel proxy. If no instance |
// has been instantiated, one will be instantiated and returned. |
static KernelProxy *KPInstance(); |
+ void SetSS(BaseSocketSubSystem* bss); |
// System calls handled by KernelProxy (not mount-specific) |
int chdir(const std::string& path); |
@@ -109,6 +113,7 @@ |
const struct timeval *timeout, void* sigmask); |
int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); |
int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); |
+ struct hostent* gethostbyname(const char* name); |
int getsockopt(int sockfd, int level, int optname, void *optval, |
socklen_t* optlen); |
int setsockopt(int sockfd, int level, int optname, const void *optval, |
@@ -128,21 +133,17 @@ |
#endif |
MountManager *mm() { return &mm_; } |
+ ino_t CreateSocket(); |
+ int AddFileStream(FileStream* stream); |
+ FileHandle *GetFileHandle(int fd); |
+ void RemoveFileStream(int fd); |
private: |
struct FileDescriptor { |
// An index in open_files_ table |
int handle; |
}; |
- struct FileHandle { |
- Mount *mount; |
- ino_t node; |
- off_t offset; |
- int flags; |
- int use_count; |
- pthread_mutex_t lock; |
- }; |
- |
+ BaseSocketSubSystem *ss; |
Path cwd_; |
int max_path_len_; |
MountManager mm_; |
@@ -152,7 +153,6 @@ |
SlotAllocator<FileDescriptor> fds_; |
SlotAllocator<FileHandle> open_files_; |
- FileHandle *GetFileHandle(int fd); |
int OpenHandle(Mount *mount, const std::string& path, int oflag, mode_t mode); |
KernelProxy(); |