TARGET_J2EE fixes
[mono.git] / support / macros.c
index c64c7dae52832cde199f77566d25f3ac8696abeb..802f0631942be93fa8c47e1ef97bfb226e4e33cd 100644 (file)
@@ -1,3 +1,4 @@
+#include "mph.h"
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
@@ -7,6 +8,7 @@
 #include <errno.h>
 #include <dirent.h>
 #include <string.h>
+#include <glib.h>
 
 int wifexited (int status)
 {
@@ -38,7 +40,7 @@ int wstopsig (int status)
        return WSTOPSIG (status);
 }
 
-int helper_Mono_Posix_Stat(char *filename, int dereference, 
+int helper_Mono_Posix_Stat(const char *filename, int dereference, 
        int *device,
        int *inode,
        int *mode,
@@ -46,12 +48,12 @@ int helper_Mono_Posix_Stat(char *filename, int dereference,
        int *uid,
        int *gid,
        int *rdev,
-       long *size,
-       long *blksize,
-       long *blocks,
-       long *atime,
-       long *mtime,
-       long *ctime
+       gint64 *size,
+       gint64 *blksize,
+       gint64 *blocks,
+       gint64 *atime,
+       gint64 *mtime,
+       gint64 *ctime
        ) {
        int ret;
        struct stat buf;
@@ -79,19 +81,19 @@ int helper_Mono_Posix_Stat(char *filename, int dereference,
        return 0;
 }
 
-char *helper_Mono_Posix_GetUserName(int uid) {
+const char *helper_Mono_Posix_GetUserName(int uid) {
        struct passwd *p = getpwuid(uid);
        if (p == NULL) return NULL;
        return strdup (p->pw_name);
 }
-char *helper_Mono_Posix_GetGroupName(int gid) {
+const char *helper_Mono_Posix_GetGroupName(int gid) {
        struct group *p = getgrgid(gid);
        if (p == NULL) return NULL;
        return strdup (p->gr_name);
 }
 
-char *helper_Mono_Posix_readdir(DIR *dir) {
-       struct dirent* e = readdir(dir);
+const char *helper_Mono_Posix_readdir(void *dir) {
+       struct dirent* e = readdir((DIR*) dir);
        if (e == NULL) return NULL;
        return strdup (e->d_name);
 }