X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=support%2Fmacros.c;h=8d455889d7ca4c30ea10c8a6e7c2471afcec7179;hb=edbc5c2334e10836479d1cc528c68d4ad5b47440;hp=802f0631942be93fa8c47e1ef97bfb226e4e33cd;hpb=5d9434fcb3acc1ed7d3d30603faae797d672fe65;p=mono.git diff --git a/support/macros.c b/support/macros.c index 802f0631942..8d455889d7c 100644 --- a/support/macros.c +++ b/support/macros.c @@ -9,6 +9,7 @@ #include #include #include +#include "map.h" int wifexited (int status) { @@ -81,23 +82,33 @@ int helper_Mono_Posix_Stat(const char *filename, int dereference, return 0; } -const char *helper_Mono_Posix_GetUserName(int uid) { +char *helper_Mono_Posix_GetUserName(int uid) { struct passwd *p = getpwuid(uid); if (p == NULL) return NULL; return strdup (p->pw_name); } -const char *helper_Mono_Posix_GetGroupName(int gid) { +char *helper_Mono_Posix_GetGroupName(int gid) { struct group *p = getgrgid(gid); if (p == NULL) return NULL; return strdup (p->gr_name); } -const char *helper_Mono_Posix_readdir(void *dir) { +char *helper_Mono_Posix_readdir(void *dir) { struct dirent* e = readdir((DIR*) dir); if (e == NULL) return NULL; return strdup (e->d_name); } +#if HAVE_GETPWNAM_R +int helper_Mono_Posix_getpwnamuid (int mode, char *in_name, int in_uid, + char **account, + char **password, + int *uid, + int *gid, + char **name, + char **home, + char **shell); + int helper_Mono_Posix_getpwnamuid (int mode, char *in_name, int in_uid, char **account, char **password, @@ -144,3 +155,5 @@ int helper_Mono_Posix_getpwnamuid (int mode, char *in_name, int in_uid, return 0; } +#endif /* def HAVE_GETPWNAM_R */ +