Add compat bits for libtls on Windows

This commit is contained in:
kinichiro
2018-02-25 01:59:39 +09:00
parent 47781e69e2
commit 3681d02253
8 changed files with 110 additions and 0 deletions

View File

@@ -7,7 +7,16 @@
#define LIBCRYPTOCOMPAT_UNISTD_H
#ifndef _MSC_VER
#include_next <unistd.h>
#ifdef __MINGW32__
int ftruncate(int fd, off_t length);
uid_t getuid(void);
ssize_t pread(int d, void *buf, size_t nbytes, off_t offset);
ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset);
#endif
#else
#include <stdlib.h>
@@ -22,10 +31,19 @@
#define X_OK 0
#define F_OK 0
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define access _access
unsigned int sleep(unsigned int seconds);
int ftruncate(int fd, off_t length);
uid_t getuid(void);
ssize_t pread(int d, void *buf, size_t nbytes, off_t offset);
ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset);
#endif
#ifndef HAVE_GETENTROPY