Fix using right functions for file descriptor with MS Visual Studio
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* Kinichiro Inoguchi <inoguchi@openbsd.org>
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int
|
||||
@@ -11,3 +13,5 @@ ftruncate(int fd, off_t length)
|
||||
{
|
||||
return _chsize(fd, length);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -4,6 +4,8 @@
|
||||
* Kinichiro Inoguchi <inoguchi@openbsd.org>
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
uid_t
|
||||
@@ -12,3 +14,5 @@ getuid(void)
|
||||
/* Windows fstat sets 0 as st_uid */
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -4,6 +4,10 @@
|
||||
* Kinichiro Inoguchi <inoguchi@openbsd.org>
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define NO_REDEF_POSIX_FUNCTIONS
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
ssize_t
|
||||
@@ -21,3 +25,5 @@ pread(int d, void *buf, size_t nbytes, off_t offset)
|
||||
return -1;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -4,6 +4,10 @@
|
||||
* Kinichiro Inoguchi <inoguchi@openbsd.org>
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define NO_REDEF_POSIX_FUNCTIONS
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
ssize_t
|
||||
@@ -21,3 +25,5 @@ pwrite(int d, const void *buf, size_t nbytes, off_t offset)
|
||||
return -1;
|
||||
return bytes;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user