OLD | NEW |
1 #include <string.h> | 1 #include <string.h> |
2 #include <sys/stat.h> | 2 #include <sys/stat.h> |
3 #include <time.h> | 3 #include <time.h> |
4 #include <nacl_stat.h> | 4 #include <nacl_stat.h> |
5 #include <nacl_syscalls.h> | 5 #include <nacl_syscalls.h> |
6 #define stat nacl_abi_stat | 6 #define stat nacl_abi_stat |
7 #include <irt.h> | 7 #include <irt.h> |
8 #include <irt_dev.h> | 8 #include <irt_dev.h> |
9 #undef stat | 9 #undef stat |
10 #include <irt_syscalls.h> | 10 #include <irt_syscalls.h> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 static int nacl_irt_fstat (int fd, struct nacl_abi_stat *st) { | 97 static int nacl_irt_fstat (int fd, struct nacl_abi_stat *st) { |
98 return -NACL_SYSCALL (fstat) (fd, st); | 98 return -NACL_SYSCALL (fstat) (fd, st); |
99 } | 99 } |
100 | 100 |
101 static int nacl_irt_stat (const char *pathname, struct nacl_abi_stat *st) { | 101 static int nacl_irt_stat (const char *pathname, struct nacl_abi_stat *st) { |
102 return -NACL_SYSCALL (stat) (pathname, st); | 102 return -NACL_SYSCALL (stat) (pathname, st); |
103 } | 103 } |
104 | 104 |
105 static int nacl_irt_getdents (int fd, struct dirent *buf, size_t count, | 105 static int nacl_irt_getdents (int fd, struct nacl_irt_dirent *buf, size_t count, |
106 size_t *nread) { | 106 size_t *nread) { |
107 int rv = NACL_SYSCALL (getdents) (fd, buf, count); | 107 int rv = NACL_SYSCALL (getdents) (fd, buf, count); |
108 if (rv < 0) | 108 if (rv < 0) |
109 return -rv; | 109 return -rv; |
110 *nread = rv; | 110 *nread = rv; |
111 return 0; | 111 return 0; |
112 } | 112 } |
113 | 113 |
114 static int nacl_irt_sysbrk (void **newbrk) { | 114 static int nacl_irt_sysbrk (void **newbrk) { |
115 /* | 115 /* |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 int *newfd); | 303 int *newfd); |
304 int (*__nacl_irt_close) (int fd); | 304 int (*__nacl_irt_close) (int fd); |
305 int (*__nacl_irt_read) (int fd, void *buf, size_t count, size_t *nread); | 305 int (*__nacl_irt_read) (int fd, void *buf, size_t count, size_t *nread); |
306 int (*__nacl_irt_write) (int fd, const void *buf, size_t count, | 306 int (*__nacl_irt_write) (int fd, const void *buf, size_t count, |
307 size_t *nwrote); | 307 size_t *nwrote); |
308 int (*__nacl_irt_seek) (int fd, off_t offset, int whence, off_t *new_offset); | 308 int (*__nacl_irt_seek) (int fd, off_t offset, int whence, off_t *new_offset); |
309 int (*__nacl_irt_dup) (int fd, int *newfd); | 309 int (*__nacl_irt_dup) (int fd, int *newfd); |
310 int (*__nacl_irt_dup2) (int fd, int newfd); | 310 int (*__nacl_irt_dup2) (int fd, int newfd); |
311 int (*__nacl_irt_fstat) (int fd, struct nacl_abi_stat *); | 311 int (*__nacl_irt_fstat) (int fd, struct nacl_abi_stat *); |
312 int (*__nacl_irt_stat) (const char *pathname, struct nacl_abi_stat *); | 312 int (*__nacl_irt_stat) (const char *pathname, struct nacl_abi_stat *); |
313 int (*__nacl_irt_getdents) (int fd, struct dirent *, size_t count, | 313 int (*__nacl_irt_getdents) (int fd, struct nacl_abi_dirent *, size_t count, |
314 size_t *nread); | 314 size_t *nread); |
315 int (*__nacl_irt_socket) (int domain, int type, int protocol, int *sd); | 315 int (*__nacl_irt_socket) (int domain, int type, int protocol, int *sd); |
316 int (*__nacl_irt_accept) (int sockfd, struct sockaddr *addr, | 316 int (*__nacl_irt_accept) (int sockfd, struct sockaddr *addr, |
317 socklen_t *addrlen, int *sd); | 317 socklen_t *addrlen, int *sd); |
318 int (*__nacl_irt_bind) (int sockfd, const struct sockaddr *addr, | 318 int (*__nacl_irt_bind) (int sockfd, const struct sockaddr *addr, |
319 socklen_t addrlen); | 319 socklen_t addrlen); |
320 int (*__nacl_irt_listen) (int sockfd, int backlog); | 320 int (*__nacl_irt_listen) (int sockfd, int backlog); |
321 int (*__nacl_irt_connect) (int sockfd, const struct sockaddr *addr, | 321 int (*__nacl_irt_connect) (int sockfd, const struct sockaddr *addr, |
322 socklen_t addrlen); | 322 socklen_t addrlen); |
323 int (*__nacl_irt_send) (int sockfd, const void *buf, size_t len, int flags, | 323 int (*__nacl_irt_send) (int sockfd, const void *buf, size_t len, int flags, |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 __nacl_irt_getsockopt = not_implemented; | 781 __nacl_irt_getsockopt = not_implemented; |
782 __nacl_irt_setsockopt = not_implemented; | 782 __nacl_irt_setsockopt = not_implemented; |
783 __nacl_irt_socketpair = not_implemented; | 783 __nacl_irt_socketpair = not_implemented; |
784 __nacl_irt_shutdown = not_implemented; | 784 __nacl_irt_shutdown = not_implemented; |
785 } | 785 } |
786 | 786 |
787 size_t nacl_interface_query(const char *interface_ident, | 787 size_t nacl_interface_query(const char *interface_ident, |
788 void *table, size_t tablesize) { | 788 void *table, size_t tablesize) { |
789 return (*__nacl_irt_query)(interface_ident, table, tablesize); | 789 return (*__nacl_irt_query)(interface_ident, table, tablesize); |
790 } | 790 } |
OLD | NEW |