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 #undef stat | 8 #undef stat |
9 #include <irt_syscalls.h> | 9 #include <irt_syscalls.h> |
10 #ifdef IS_IN_rtld | 10 #ifdef IS_IN_rtld |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 int (*__nacl_irt_read) (int fd, void *buf, size_t count, size_t *nread); | 299 int (*__nacl_irt_read) (int fd, void *buf, size_t count, size_t *nread); |
300 int (*__nacl_irt_write) (int fd, const void *buf, size_t count, size_t *nwrote); | 300 int (*__nacl_irt_write) (int fd, const void *buf, size_t count, size_t *nwrote); |
301 int (*__nacl_irt_seek) (int fd, off_t offset, int whence, off_t *new_offset); | 301 int (*__nacl_irt_seek) (int fd, off_t offset, int whence, off_t *new_offset); |
302 int (*__nacl_irt_dup) (int fd, int *newfd); | 302 int (*__nacl_irt_dup) (int fd, int *newfd); |
303 int (*__nacl_irt_dup2) (int fd, int newfd); | 303 int (*__nacl_irt_dup2) (int fd, int newfd); |
304 int (*__nacl_irt_fstat) (int fd, struct nacl_abi_stat *); | 304 int (*__nacl_irt_fstat) (int fd, struct nacl_abi_stat *); |
305 int (*__nacl_irt_stat) (const char *pathname, struct nacl_abi_stat *); | 305 int (*__nacl_irt_stat) (const char *pathname, struct nacl_abi_stat *); |
306 int (*__nacl_irt_getdents) (int fd, struct dirent *, size_t count, | 306 int (*__nacl_irt_getdents) (int fd, struct dirent *, size_t count, |
307 size_t *nread); | 307 size_t *nread); |
308 | 308 |
| 309 int (*__nacl_irt_epoll_create) (int flags); // size |
| 310 int (*__nacl_irt_epoll_create1 )(int flags); |
| 311 int (*__nacl_irt_epoll_ctl) (int epfd, int op, int fd, struct epoll_event *event
); |
| 312 int (*__nacl_irt_epoll_pwait) (int epfd, struct epoll_event *events, |
| 313 int maxevents, int timeout, |
| 314 const sigset_t *sigmask, size_t sigsetsize); |
| 315 int (*__nacl_irt_epoll_wait) (int epfd, struct epoll_event *events, |
| 316 int maxevents, int timeout); |
| 317 int (*__nacl_irt_poll) (struct pollfd *fds, nfds_t nfds, |
| 318 int timeout); |
| 319 int (*__nacl_irt_ppoll) (struct pollfd *fds, nfds_t nfds, |
| 320 const struct timespec *timeout, |
| 321 const sigset_t *sigmask, size_t sigsetsize); |
| 322 int (*__nacl_irt_socket) (int domain, int type, int protocol); |
| 323 int (*__nacl_irt_accept) (int sockfd, struct sockaddr *addr, socklen_t *addrlen)
; |
| 324 int (*__nacl_irt_bind) (int sockfd, struct sockaddr *addr, socklen_t addrlen); |
| 325 int (*__nacl_irt_listen) (int sockfd, int backlog); |
| 326 int (*__nacl_irt_connect) (int sockfd, struct sockaddr *addr, socklen_t *addrlen
); |
| 327 int (*__nacl_irt_send) (int sockfd, const void *buf, size_t len, int flags); |
| 328 int (*__nacl_irt_sendto) (int sockfd, const void *buf, size_t len, int flags, |
| 329 const struct sockaddr *dest_addr, socklen_t addrlen); |
| 330 int (*__nacl_irt_recv) (int sockfd, void *buf, size_t len, int flags); |
| 331 int (*__nacl_irt_recvfrom) (int sockfd, void *buf, size_t len, int flags, |
| 332 struct sockaddr *dest_addr, socklen_t addrlen); |
| 333 |
| 334 int (*__nacl_irt_select) (int nfds, fd_set *readfds, |
| 335 fd_set *writefds, fd_set *exceptfds, |
| 336 const struct timeval *timeout); |
| 337 int (*__nacl_irt_pselect) (int nfds, fd_set *readfds, |
| 338 fd_set *writefds, fd_set *exceptfds, |
| 339 const struct timeval *timeout, void* sigmask); |
| 340 |
309 int (*__nacl_irt_sysbrk) (void **newbrk); | 341 int (*__nacl_irt_sysbrk) (void **newbrk); |
310 int (*__nacl_irt_mmap) (void **addr, size_t len, int prot, int flags, | 342 int (*__nacl_irt_mmap) (void **addr, size_t len, int prot, int flags, |
311 int fd, off_t off); | 343 int fd, off_t off); |
312 int (*__nacl_irt_munmap) (void *addr, size_t len); | 344 int (*__nacl_irt_munmap) (void *addr, size_t len); |
313 | 345 |
314 int (*__nacl_irt_dyncode_create) (void *dest, const void *src, size_t size); | 346 int (*__nacl_irt_dyncode_create) (void *dest, const void *src, size_t size); |
315 int (*__nacl_irt_dyncode_modify) (void *dest, const void *src, size_t size); | 347 int (*__nacl_irt_dyncode_modify) (void *dest, const void *src, size_t size); |
316 int (*__nacl_irt_dyncode_delete) (void *dest, size_t size); | 348 int (*__nacl_irt_dyncode_delete) (void *dest, size_t size); |
317 | 349 |
318 int (*__nacl_irt_thread_create) (void *start_user_address, void *stack, | 350 int (*__nacl_irt_thread_create) (void *start_user_address, void *stack, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 __nacl_irt_clock_gettime = nacl_irt_clock_gettime; | 584 __nacl_irt_clock_gettime = nacl_irt_clock_gettime; |
553 } | 585 } |
554 | 586 |
555 if (!__nacl_irt_query) | 587 if (!__nacl_irt_query) |
556 __nacl_irt_query = no_interface; | 588 __nacl_irt_query = no_interface; |
557 | 589 |
558 __nacl_irt_mkdir = not_implemented; | 590 __nacl_irt_mkdir = not_implemented; |
559 __nacl_irt_chdir = not_implemented; | 591 __nacl_irt_chdir = not_implemented; |
560 __nacl_irt_rmdir = not_implemented; | 592 __nacl_irt_rmdir = not_implemented; |
561 __nacl_irt_getcwd = not_implemented; | 593 __nacl_irt_getcwd = not_implemented; |
| 594 |
| 595 __nacl_irt_epoll_create = not_implemented; |
| 596 __nacl_irt_epoll_create1 = not_implemented; |
| 597 __nacl_irt_epoll_ctl = not_implemented; |
| 598 __nacl_irt_epoll_pwait = not_implemented; |
| 599 __nacl_irt_epoll_wait = not_implemented; |
| 600 __nacl_irt_poll = not_implemented; |
| 601 __nacl_irt_ppoll = not_implemented; |
| 602 __nacl_irt_socket = not_implemented; |
| 603 __nacl_irt_accept = not_implemented; |
| 604 __nacl_irt_bind = not_implemented; |
| 605 __nacl_irt_listen = not_implemented; |
| 606 __nacl_irt_connect = not_implemented; |
| 607 __nacl_irt_send = not_implemented; |
| 608 __nacl_irt_sendto = not_implemented; |
| 609 __nacl_irt_recv = not_implemented; |
| 610 __nacl_irt_recvfrom = not_implemented; |
| 611 __nacl_irt_select = not_implemented; |
| 612 __nacl_irt_pselect = not_implemented; |
562 } | 613 } |
563 | 614 |
564 size_t nacl_interface_query(const char *interface_ident, | 615 size_t nacl_interface_query(const char *interface_ident, |
565 void *table, size_t tablesize) { | 616 void *table, size_t tablesize) { |
566 return (*__nacl_irt_query)(interface_ident, table, tablesize); | 617 return (*__nacl_irt_query)(interface_ident, table, tablesize); |
567 } | 618 } |
OLD | NEW |