diff options
| author | cashmere <cashmere@autistici.org> | 2026-09-04 09:05:24 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-09-04 09:05:24 +0200 |
| commit | 4f49b16079b27d7ce633619e4cddfdf2bffbc952 (patch) | |
| tree | c296c1e7f3c3e2f6859c6d3a1b1b208779b89679 /win/include/unistd.h | |
| download | relic-4f49b16079b27d7ce633619e4cddfdf2bffbc952.tar.gz | |
Diffstat (limited to 'win/include/unistd.h')
| -rw-r--r-- | win/include/unistd.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/win/include/unistd.h b/win/include/unistd.h new file mode 100644 index 0000000..14a84a5 --- /dev/null +++ b/win/include/unistd.h @@ -0,0 +1,47 @@ +#ifndef _UNISTD_H +#define _UNISTD_H 1 + +/* This file intended to serve as a drop-in replacement for + * unistd.h on Windows + * Please add functionality as neeeded + */ + +#include <stdlib.h> +#include <io.h> +#define srandom srand +#define random rand +#if defined(__DMC__) +#endif + +#if defined(_WIN32) +#define _CRT_SECURE_NO_WARNINGS 1 + +#ifndef F_OK +#define F_OK 0 +#endif /* not F_OK */ + +#ifndef X_OK +#define X_OK 1 +#endif /* not X_OK */ + +#ifndef W_OK +#define W_OK 2 +#endif /* not W_OK */ + +#ifndef R_OK +#define R_OK 4 +#endif /* not R_OK */ + +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + + + +#endif + +#define access _access +#define ftruncate _chsize + +#define ssize_t int + +#endif /* unistd.h */ |
