summaryrefslogtreecommitdiff
path: root/lib/system.h
blob: 6ec4e8320435ea3e183f62f51bc6cba6f0eac2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef SYSTEM_H
#define SYSTEM_H

#include <gnutls_int.h>

#ifndef _WIN32
#include <sys/uio.h>            /* for writev */
#endif

int system_errno (gnutls_transport_ptr);
int system_recv_timeout(gnutls_transport_ptr ptr, size_t ms);

#ifdef _WIN32
ssize_t system_write (gnutls_transport_ptr ptr, const void *data,
                      size_t data_size);
#else
#define HAVE_WRITEV
ssize_t system_writev (gnutls_transport_ptr ptr, const giovec_t * iovec,
                       int iovec_cnt);
#endif
ssize_t system_read (gnutls_transport_ptr ptr, void *data, size_t data_size);
ssize_t system_read_peek (gnutls_transport_ptr ptr, void *data,
                          size_t data_size);

#ifdef _WIN32
#define HAVE_WIN32_LOCKS
#else
#ifdef HAVE_LIBPTHREAD
#define HAVE_PTHREAD_LOCKS
#else
#define HAVE_NO_LOCKS
#endif
#endif

int _gnutls_atfork (void (*prepare) (void), void (*parent) (void),
                    void (*child) (void));

#endif /* SYSTEM_H */