From 34977c6415b49165f2fcfa3632025733e530fe41 Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Mon, 19 Apr 2010 20:07:18 +0000 Subject: * configure.in: Add header, structure member, and function checks as Android doesn't provide all the headers, structure members, and functions that a "full" Linux distro includes. * support/dirent.c, support/grp.c, support/macros.c, support/pwd.c, support/signal.c, support/sys-statvfs.c, support/sys-time.c, support/unistd.c: Add #if HAVE_XXX checks for functions which aren't provided on Android. svn path=/trunk/mono/; revision=155753 --- support/pwd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'support/pwd.c') diff --git a/support/pwd.c b/support/pwd.c index 13bccef9b55..4bb6ad6ca2b 100644 --- a/support/pwd.c +++ b/support/pwd.c @@ -22,7 +22,9 @@ static const mph_string_offset_t passwd_offsets[] = { MPH_STRING_OFFSET (struct passwd, pw_name, MPH_STRING_OFFSET_PTR), MPH_STRING_OFFSET (struct passwd, pw_passwd, MPH_STRING_OFFSET_PTR), +#if HAVE_STRUCT_PASSWD_PW_GECOS MPH_STRING_OFFSET (struct passwd, pw_gecos, MPH_STRING_OFFSET_PTR), +#endif /* def HAVE_STRUCT_PASSWD_PW_GECOS */ MPH_STRING_OFFSET (struct passwd, pw_dir, MPH_STRING_OFFSET_PTR), MPH_STRING_OFFSET (struct passwd, pw_shell, MPH_STRING_OFFSET_PTR) }; @@ -31,7 +33,9 @@ static const mph_string_offset_t mph_passwd_offsets[] = { MPH_STRING_OFFSET (struct Mono_Posix_Syscall__Passwd, pw_name, MPH_STRING_OFFSET_PTR), MPH_STRING_OFFSET (struct Mono_Posix_Syscall__Passwd, pw_passwd, MPH_STRING_OFFSET_PTR), +#if HAVE_STRUCT_PASSWD_PW_GECOS MPH_STRING_OFFSET (struct Mono_Posix_Syscall__Passwd, pw_gecos, MPH_STRING_OFFSET_PTR), +#endif /* def HAVE_STRUCT_PASSWD_PW_GECOS */ MPH_STRING_OFFSET (struct Mono_Posix_Syscall__Passwd, pw_dir, MPH_STRING_OFFSET_PTR), MPH_STRING_OFFSET (struct Mono_Posix_Syscall__Passwd, pw_shell, MPH_STRING_OFFSET_PTR) }; @@ -187,6 +191,7 @@ Mono_Posix_Syscall_getpwuid_r (mph_uid_t uid, } #endif /* ndef HAVE_GETPWUID_R */ +#if HAVE_GETPWENT gint32 Mono_Posix_Syscall_getpwent (struct Mono_Posix_Syscall__Passwd *pwbuf) { @@ -208,6 +213,7 @@ Mono_Posix_Syscall_getpwent (struct Mono_Posix_Syscall__Passwd *pwbuf) } return 0; } +#endif /* def HAVE_GETPWENT */ #ifdef HAVE_FGETPWENT gint32 @@ -233,6 +239,7 @@ Mono_Posix_Syscall_fgetpwent (void *stream, struct Mono_Posix_Syscall__Passwd *p } #endif /* ndef HAVE_FGETPWENT */ +#if HAVE_SETPWENT int Mono_Posix_Syscall_setpwent (void) { @@ -243,7 +250,9 @@ Mono_Posix_Syscall_setpwent (void) mph_return_if_val_in_list5(errno, EIO, EMFILE, ENFILE, ENOMEM, ERANGE); return 0; } +#endif /* def HAVE_SETPWENT */ +#if HAVE_ENDPWENT int Mono_Posix_Syscall_endpwent (void) { @@ -253,6 +262,7 @@ Mono_Posix_Syscall_endpwent (void) return -1; return 0; } +#endif /* def HAVE_ENDPWENT */ G_END_DECLS -- cgit v1.2.3