#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
+#ifdef HAVE_UTIME_H
#include <utime.h>
+#endif
#include "wrapper.h"
extern char **environ;
if (fstat ((int)fd, &fs) == -1)
return -errno;
- buf->st_dev = fs.st_dev;
- buf->st_mode = fs.st_mode;
- buf->st_nlink = fs.st_nlink;
- buf->st_uid = fs.st_uid;
- buf->st_gid = fs.st_gid;
- buf->st_size = fs.st_size;
- buf->st_atime = fs.st_atime;
- buf->st_mtime = fs.st_ctime;
- buf->st_ctime = fs.st_ctime;
+ buf->mst_dev = fs.st_dev;
+ buf->mst_mode = fs.st_mode;
+ buf->mst_nlink = fs.st_nlink;
+ buf->mst_uid = fs.st_uid;
+ buf->mst_gid = fs.st_gid;
+ buf->mst_size = fs.st_size;
+ buf->mst_atime = fs.st_atime;
+ buf->mst_mtime = fs.st_mtime;
+ buf->mst_ctime = fs.st_ctime;
return 0;
}
if (stat (path, &fs) != 0)
return errno;
- buf->st_dev = fs.st_dev;
- buf->st_mode = fs.st_mode;
- buf->st_nlink = fs.st_nlink;
- buf->st_uid = fs.st_uid;
- buf->st_gid = fs.st_gid;
- buf->st_size = fs.st_size;
- buf->st_atime = fs.st_atime;
- buf->st_mtime = fs.st_ctime;
- buf->st_ctime = fs.st_ctime;
+ buf->mst_dev = fs.st_dev;
+ buf->mst_mode = fs.st_mode;
+ buf->mst_nlink = fs.st_nlink;
+ buf->mst_uid = fs.st_uid;
+ buf->mst_gid = fs.st_gid;
+ buf->mst_size = fs.st_size;
+ buf->mst_atime = fs.st_atime;
+ buf->mst_mtime = fs.st_mtime;
+ buf->mst_ctime = fs.st_ctime;
return 0;
}
p = readdir((DIR*)dir);
- /*
- if (p)
- return p->d_name;
- else
- return NULL;
- */
return p != NULL ? p->d_name : NULL;
}
int
mono_wrapper_mkdir (const char *path, int mode)
{
+#ifndef PLATFORM_WIN32
if (mkdir (path, mode) == -1)
return -errno;
+#endif
return 0;
}
int
mono_wrapper_utime (const char *path, int atime, int mtime)
{
+#ifndef PLATFORM_WIN32
struct utimbuf buf;
buf.actime = atime;
if (utime (path, &buf) == -1)
return -errno;
+#endif
return 0;
}