Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: tests/glibc_socket_wrappers/irt_syscalls.h

Issue 10096008: added a test to check glibc socket functions wrappers (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #ifndef _IRT_SYSCALLS_H
2 #define _IRT_SYSCALLS_H
3
4 #include <sys/types.h>
5 #include <sys/epoll.h>
6 #include <poll.h>
7 #include <stddef.h>
8 #include <fcntl.h>
9 #include <time.h>
10
11 #include "nacl_stat.h"
12
13 struct dirent;
14 struct nacl_abi_stat;
15 struct timeval;
16 struct timespec;
17 struct sockaddr;
18 struct msghdr;
19
20 #define socklen_t unsigned int
21
22 extern size_t (*__nacl_irt_query)(const char *interface_ident,
23 void *table, size_t tablesize);
24
25 extern void (*__nacl_irt_exit) (int status);
26 extern int (*__nacl_irt_gettod) (struct timeval *tv);
27 extern int (*__nacl_irt_clock) (clock_t *ticks);
28 extern int (*__nacl_irt_nanosleep) (const struct timespec *req,
29 struct timespec *rem);
30 extern int (*__nacl_irt_sched_yield) (void);
31 extern int (*__nacl_irt_sysconf) (int name, int *value);
32
33 extern int (*__nacl_irt_mkdir) (const char* pathname, mode_t mode);
34 extern int (*__nacl_irt_rmdir) (const char* pathname);
35 extern int (*__nacl_irt_chdir) (const char* pathname);
36 extern int (*__nacl_irt_getcwd) (char* buf, size_t size, int* ret);
37
38 extern int (*__nacl_irt_epoll_create) (int flags); // size
39 extern int (*__nacl_irt_epoll_ctl) (int epfd, int op, int fd,
40 struct epoll_event *event);
41 extern int (*__nacl_irt_epoll_pwait) (int epfd, struct epoll_event *events,
42 int maxevents, int timeout,
43 const sigset_t *sigmask, size_t sigset_size);
44 extern int (*__nacl_irt_epoll_wait) (int epfd, struct epoll_event *events,
45 int maxevents, int timeout);
46 extern int (*__nacl_irt_poll) (struct pollfd *fds, nfds_t nfds,
47 int timeout);
48 extern int (*__nacl_irt_ppoll) (struct pollfd *fds, nfds_t nfds,
49 const struct timespec *timeout,
50 const sigset_t *sigmask, size_t sigset_size);
51 extern int (*__nacl_irt_socket) (int domain, int type, int protocol);
52 extern int (*__nacl_irt_accept) (int sockfd, struct sockaddr *addr,
53 socklen_t *addrlen);
54 extern int (*__nacl_irt_bind) (int sockfd, const struct sockaddr *addr,
55 socklen_t addrlen);
56 extern int (*__nacl_irt_listen) (int sockfd, int backlog);
57 extern int (*__nacl_irt_connect) (int sockfd, const struct sockaddr *addr,
58 socklen_t addrlen);
59 extern int (*__nacl_irt_send) (int sockfd, const void *buf, size_t len,
60 int flags, int* ret);
61 extern int (*__nacl_irt_sendmsg) (int sockfd, const struct msghdr *msg,
62 int flags, int* ret);
63 extern int (*__nacl_irt_sendto) (int sockfd, const void *buf, size_t len,
64 int flags, const struct sockaddr *dest_addr,
65 socklen_t addrlen, int* ret);
66 extern int (*__nacl_irt_recv) (int sockfd, void *buf, size_t len, int flags,
67 int* ret);
68 extern int (*__nacl_irt_recvmsg) (int sockfd, struct msghdr *msg,
69 int flags, int* ret);
70 extern int (*__nacl_irt_recvfrom) (int sockfd, void *buf, size_t len, int flags,
71 struct sockaddr *dest_addr, socklen_t* addrlen,
72 int* ret);
73 extern int (*__nacl_irt_select) (int nfds, fd_set *readfds,
74 fd_set *writefds, fd_set *exceptfds,
75 const struct timeval *timeout);
76 extern int (*__nacl_irt_pselect) (int nfds, fd_set *readfds,
77 fd_set *writefds, fd_set *exceptfds,
78 const struct timeval *timeout, void* sigmask);
79 extern int (*__nacl_irt_getpeername) (int sockfd, struct sockaddr *addr,
80 socklen_t *addrlen);
81 extern int (*__nacl_irt_getsockname) (int sockfd, struct sockaddr *addr,
82 socklen_t *addrlen);
83 extern int (*__nacl_irt_getsockopt) (int sockfd, int level, int optname,
84 void *optval, socklen_t *optlen);
85 extern int (*__nacl_irt_setsockopt) (int sockfd, int level, int optname,
86 const void *optval, socklen_t optlen);
87 extern int (*__nacl_irt_socketpair) (int domain, int type, int protocol,
88 int sv[2]);
89 extern int (*__nacl_irt_shutdown) (int sockfd, int how);
90
91
92 extern int (*__nacl_irt_open) (const char *pathname, int oflag, mode_t cmode,
93 int *newfd);
94 extern int (*__nacl_irt_close) (int fd);
95 extern int (*__nacl_irt_read) (int fd, void *buf, size_t count, size_t *nread);
96 extern int (*__nacl_irt_write) (int fd, const void *buf, size_t count,
97 size_t *nwrote);
98 extern int (*__nacl_irt_seek) (int fd, nacl_abi_off_t offset, int whence,
99 nacl_abi_off_t *new_offset);
100 extern int (*__nacl_irt_dup) (int fd, int *newfd);
101 extern int (*__nacl_irt_dup2) (int fd, int newfd);
102 extern int (*__nacl_irt_fstat) (int fd, struct nacl_abi_stat *);
103 extern int (*__nacl_irt_stat) (const char *pathname, struct nacl_abi_stat *);
104 extern int (*__nacl_irt_getdents) (int fd, struct dirent *, size_t count,
105 size_t *nread);
106
107 extern int (*__nacl_irt_sysbrk)(void **newbrk);
108 extern int (*__nacl_irt_mmap)(void **addr, size_t len, int prot, int flags,
109 int fd, nacl_abi_off_t off);
110 extern int (*__nacl_irt_munmap)(void *addr, size_t len);
111
112 extern int (*__nacl_irt_dyncode_create) (void *dest, const void *src,
113 size_t size);
114 extern int (*__nacl_irt_dyncode_modify) (void *dest, const void *src,
115 size_t size);
116 extern int (*__nacl_irt_dyncode_delete) (void *dest, size_t size);
117
118 extern int (*__nacl_irt_thread_create) (void *start_user_address, void *stack,
119 void *thread_ptr);
120 extern void (*__nacl_irt_thread_exit) (int32_t *stack_flag);
121 extern int (*__nacl_irt_thread_nice) (const int nice);
122
123 extern int (*__nacl_irt_mutex_create) (int *mutex_handle);
124 extern int (*__nacl_irt_mutex_destroy) (int mutex_handle);
125 extern int (*__nacl_irt_mutex_lock) (int mutex_handle);
126 extern int (*__nacl_irt_mutex_unlock) (int mutex_handle);
127 extern int (*__nacl_irt_mutex_trylock) (int mutex_handle);
128
129 extern int (*__nacl_irt_cond_create) (int *cond_handle);
130 extern int (*__nacl_irt_cond_destroy) (int cond_handle);
131 extern int (*__nacl_irt_cond_signal) (int cond_handle);
132 extern int (*__nacl_irt_cond_broadcast) (int cond_handle);
133 extern int (*__nacl_irt_cond_wait) (int cond_handle, int mutex_handle);
134 extern int (*__nacl_irt_cond_timed_wait_abs) (int cond_handle, int mutex_handle,
135 const struct timespec *abstime);
136
137 extern int (*__nacl_irt_tls_init) (void *tdb);
138 extern void *(*__nacl_irt_tls_get) (void);
139
140 extern int (*__nacl_irt_open_resource) (const char* file, int *fd);
141
142 extern int (*__nacl_irt_clock_getres) (clockid_t clk_id, struct timespec *res);
143 extern int (*__nacl_irt_clock_gettime) (clockid_t clk_id, struct timespec *tp);
144 #undef socklen_t
145
146 #ifdef _LIBC
147 void init_irt_table (void) attribute_hidden;
148 #endif
149 #endif
150
151 #if defined(_LIBC) || defined (__need_emulated_syscalls)
152 #ifndef _IRT_EMULATED_SYSCALLS_H
153 #define _IRT_EMULATED_SYSCALLS_H 1
154
155 #ifndef _LINUX_TYPES_H
156 #define ustat __kernel_ustat
157 #include <linux/sysctl.h>
158 #undef ustat
159 #ifdef _LIBC
160 #include <misc/sys/ustat.h>
161 #else
162 #include <sys/ustat.h>
163 #endif
164 #endif
165
166 #include <linux/getcpu.h>
167 #include <linux/posix_types.h>
168 #if !defined (_LIBC) || defined(IS_IN_librt)
169 #include <mqueue.h>
170 #endif
171 #include <pthread.h>
172 #include <sched.h>
173 #include <signal.h>
174 #include <streams/stropts.h>
175 #include <sys/epoll.h>
176 #include <sys/poll.h>
177 #include <sys/ptrace.h>
178 #include <sys/times.h>
179 #include <sys/wait.h>
180 #include <time.h>
181 #include <utime.h>
182 #include <sys/msg.h>
183 #include <sys/sem.h>
184 #include <sys/shm.h>
185 #include <sys/sysinfo.h>
186 #include <sys/time.h>
187 #include <sys/timex.h>
188 #include <sys/types.h>
189 #include <sys/utsname.h>
190 #ifdef __i386__
191 #include <sys/vm86.h>
192 #endif
193 #include <unistd.h>
194
195 #ifdef _LIBC
196 struct robust_list_head;
197 #else
198 struct robust_list_head
199 {
200 void *list;
201 long int futex_offset;
202 void *list_op_pending;
203 };
204 #endif
205
206 #endif
207 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698