kinetic-c  v0.12.0
Seagate Kinetic Protocol Client Library for C
syscall.h
Go to the documentation of this file.
1 /*
2 * kinetic-c
3 * Copyright (C) 2015 Seagate Technology.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20 #ifndef SYSCALL_H
21 #define SYSCALL_H
22 
23 #include "bus_internal_types.h"
24 #include <poll.h>
25 #include <time.h>
26 
28 int syscall_poll(struct pollfd fds[], nfds_t nfds, int timeout);
29 int syscall_close(int fd);
30 ssize_t syscall_write(int fildes, const void *buf, size_t nbyte);
31 ssize_t syscall_read(int fildes, void *buf, size_t nbyte);
32 
34 int syscall_SSL_write(SSL *ssl, const void *buf, int num);
35 int syscall_SSL_read(SSL *ssl, void *buf, int num);
36 int syscall_SSL_get_error(const SSL *ssl, int ret);
37 
41 int syscall_timestamp(struct timeval *restrict tp, bool relative);
42 
44 int syscall_pthread_join(pthread_t thread, void **value_ptr);
45 
46 #endif
int syscall_close(int fd)
Definition: syscall.c:31
ssize_t syscall_read(int fildes, void *buf, size_t nbyte)
Definition: syscall.c:39
int syscall_poll(struct pollfd fds[], nfds_t nfds, int timeout)
Wrappers for syscalls, to allow mocking for testing.
Definition: syscall.c:27
int syscall_SSL_write(SSL *ssl, const void *buf, int num)
Wrappers for OpenSSL calls.
Definition: syscall.c:44
ssize_t syscall_write(int fildes, const void *buf, size_t nbyte)
Definition: syscall.c:35
int syscall_pthread_join(pthread_t thread, void **value_ptr)
Wrapper for pthread calls.
Definition: syscall.c:77
int syscall_SSL_get_error(const SSL *ssl, int ret)
Definition: syscall.c:52
int syscall_SSL_read(SSL *ssl, void *buf, int num)
Definition: syscall.c:48
int syscall_timestamp(struct timeval *restrict tp, bool relative)
Wrapper for gettimeofday and (where available) clock_gettime(CLOCK_MONOTONIC), which is used when REL...
Definition: syscall.c:60