28 return poll(fds, nfds, timeout);
36 return write(fildes, buf, nbyte);
40 return read(fildes, buf, nbyte);
45 return SSL_write(ssl, buf, num);
49 return SSL_read(ssl, buf, num);
53 return SSL_get_error(ssl, ret);
64 if (0 != clock_gettime(CLOCK_MONOTONIC, &ts)) {
67 tv->tv_sec = ts.tv_sec;
68 tv->tv_usec = ts.tv_nsec / 1000L;
74 return gettimeofday(tv, NULL);
79 return pthread_join(thread, value_ptr);
int syscall_SSL_get_error(const SSL *ssl, int ret)
struct pollfd fds[1000+1]
Tracked file descriptors, for polling.
int syscall_close(int fd)
int syscall_timestamp(struct timeval *restrict tv, bool relative)
Wrapper for gettimeofday and (where available) clock_gettime(CLOCK_MONOTONIC), which is used when REL...
ssize_t syscall_read(int fildes, void *buf, size_t nbyte)
int syscall_pthread_join(pthread_t thread, void **value_ptr)
Wrapper for pthread calls.
int syscall_SSL_read(SSL *ssl, void *buf, int num)
int syscall_SSL_write(SSL *ssl, const void *buf, int num)
Wrappers for OpenSSL calls.
ssize_t syscall_write(int fildes, const void *buf, size_t nbyte)
int syscall_poll(struct pollfd fds[], nfds_t nfds, int timeout)
Wrappers for syscalls, to allow mocking for testing.