#include <grp.h>
#include <errno.h>
#include <dirent.h>
+#include <string.h>
int wifexited (int status)
{
char *helper_Mono_Posix_GetUserName(int uid) {
struct passwd *p = getpwuid(uid);
if (p == NULL) return NULL;
- return p->pw_name;
+ return strdup (p->pw_name);
}
char *helper_Mono_Posix_GetGroupName(int gid) {
struct group *p = getgrgid(gid);
if (p == NULL) return NULL;
- return p->gr_name;
+ return strdup (p->gr_name);
}
char *helper_Mono_Posix_readdir(DIR *dir) {
struct dirent* e = readdir(dir);
if (e == NULL) return NULL;
- return e->d_name;
+ return strdup (e->d_name);
}