Merge branch 'vendor/LIBRESSL'
[dragonfly.git] / crypto / libressl / include / compat / unistd.h
1 /*
2  * Public domain
3  * unistd.h compatibility shim
4  */
5
6 #ifndef LIBCRYPTOCOMPAT_UNISTD_H
7 #define LIBCRYPTOCOMPAT_UNISTD_H
8
9 #ifndef _MSC_VER
10 #include_next <unistd.h>
11 #else
12
13 #include <stdlib.h>
14 #include <io.h>
15 #include <process.h>
16
17 #define R_OK    4
18 #define W_OK    2
19 #define X_OK    0
20 #define F_OK    0
21
22 #define access _access
23
24 unsigned int sleep(unsigned int seconds);
25
26 #endif
27
28 #ifndef HAVE_GETENTROPY
29 int getentropy(void *buf, size_t buflen);
30 #else
31 /*
32  * Solaris 11.3 adds getentropy(2), but defines the function in sys/random.h
33  */
34 #if defined(__sun)
35 #include <sys/random.h>
36 #endif
37 #endif
38
39 #define pledge(request, paths) 0
40
41 #endif