Added README file
[swift-upb.git] / compat / unixio.h
1 /*
2  * Written by Arno Bakker
3  * see LICENSE.txt for license information
4  *
5  * Defines UNIX like I/O calls and parameters for Win32
6  */
7 #ifdef _WIN32
8
9 #ifndef UNIXIO_H_
10 #define UNIXIO_H_
11
12 #define open(a,b,c)     _open(a,b,c)
13 #define S_IRUSR _S_IREAD
14 #define S_IWUSR _S_IWRITE
15 #define S_IRGRP _S_IREAD
16 #define S_IROTH _S_IREAD
17 #define ftruncate(a, b) _chsize(a,b)
18
19 size_t pread(int fildes, void *buf, size_t nbyte, long offset);
20 /** UNIX pread approximation. Does change file pointer. Is not thread-safe */
21 size_t pwrite(int fildes, const void *buf, size_t nbyte, long offset);
22 /** UNIX pwrite approximation. Does change file pointer. Is not thread-safe */
23
24 int inet_aton(const char *cp, struct in_addr *inp);
25
26
27 #endif /* UNIXIO_H_ */
28
29 #endif // WIN32