pmode = va_arg(ap, int);
va_end(ap);
ws = NULL;
- if ((flags & ~O_BINARY) == O_RDONLY) {
+ if ((flags & ~_O_BINARY) == _O_RDONLY) {
/*
* When we open a directory, _open function returns
* "Permission denied" error.
return ((ssize_t)bytes_read);
}
-/* Remove directory */
-int
-la_rmdir(const char *path)
-{
- wchar_t *ws;
- int r;
-
- r = _rmdir(path);
- if (r >= 0 || errno != ENOENT)
- return (r);
- ws = permissive_name(path);
- if (ws == NULL) {
- errno = EINVAL;
- return (-1);
- }
- r = _wrmdir(ws);
- free(ws);
- return (r);
-}
-
/* Convert Windows FILETIME to UTC */
__inline static void
fileTimeToUTC(const FILETIME *filetime, time_t *time, long *ns)
} else {
DWORD avail;
- st->st_mode = S_IFIFO;
+ st->st_mode = AE_IFIFO;
if (PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL))
st->st_size = avail;
else
ret = __hstat((HANDLE)_get_osfhandle(fd), &u);
if (ret >= 0) {
copy_stat(st, &u);
- if (u.st_mode & (S_IFCHR | S_IFIFO)) {
+ if ((u.st_mode & AE_IFMT) == AE_IFCHR
+ || (u.st_mode & AE_IFMT) == AE_IFIFO) {
st->st_dev = fd;
st->st_rdev = fd;
}
return (bytes_written);
}
-#endif
+//#endif
/*
* The following function was modified from PostgreSQL sources and is
* subject to the copyright below.
errno = EINVAL;
return;
}
+#endif
*
* $FreeBSD$
*/
-
#ifndef CPIO_WINDOWS_H
#define CPIO_WINDOWS_H 1
-#include <direct.h>
#include <io.h>
#define getgrgid(id) NULL
#ifdef _MSC_VER
#define snprintf sprintf_s
+#define strdup _strdup
#endif
struct passwd {
gid_t gr_gid;
};
+struct _timeval64i32 {
+ time_t tv_sec;
+ long tv_usec;
+};
+#define __timeval _timeval64i32
+
+extern int futimes(int fd, const struct __timeval *times);
+#ifndef HAVE_FUTIMES
+#define HAVE_FUTIMES 1
+#endif
+extern int utimes(const char *name, const struct __timeval *times);
+#ifndef HAVE_UTIMES
+#define HAVE_UTIMES 1
+#endif
+
#endif /* CPIO_WINDOWS_H */