Index: osl/unx/system.c =================================================================== RCS file: /cvs/porting/sal/osl/unx/system.c,v retrieving revision 1.3.18.1.2.1 diff -u -r1.3.18.1.2.1 system.c --- osl/unx/system.c 15 Aug 2002 15:22:26 -0000 1.3.18.1.2.1 +++ osl/unx/system.c 3 Sep 2002 01:48:39 -0000 @@ -78,8 +78,27 @@ #include #include - +/* [ed] 9/1/02 On OS 10.2 and higher, the OS headers define this function slightly differently. + A fourth argument is expected, a struct passwd **. We still want to make our own definition, + however, so when we run on 10.1 we can still locate the symbol in our own libraries. So + if we're building on 10.2, simply change the prototype to match the expected system + prototype and provide the duplicate symbol. + */ +#ifdef MACOSX +#ifdef BUILD_OS_APPLEOSX +#if (BUILD_OS_MAJOR >= 10) && (BUILD_OS_MINOR >= 2) +int getpwnam_r(const char* name, struct passwd* s, char* buffer, size_t size, struct passwd **ignore ) +#else /* BUILD_OS_MAJOR && BUILD_OS_MINOR */ +/* previous versions of MacOS X...10.0/1. Use old prototype */ +struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size ) +#endif /* BUILD_OS_MAJOR && BUILD_OS_MINOR */ +#else /* BUILD_OS_APPLE_OSX */ +/* configure didn't take, or we're building on darwin. Fallback on old prototype */ +struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size ) +#endif /* BUILD_OS_APPLEOSX */ +#else /* MACOSX */ struct passwd *getpwnam_r(const char* name, struct passwd* s, char* buffer, int size ) +#endif /* MACOSX */ { struct passwd* res; @@ -131,7 +150,19 @@ pthread_mutex_unlock(&getrtl_mutex); - return res; +#ifdef MACOSX +#ifdef BUILD_OS_APPLEOSX +#if (BUILD_OS_MAJOR >= 10) && (BUILD_OS_MINOR >= 2) + return((int)res); +#else + return(res); +#endif /* BUILD_OS_MAJOR && BUILD_OS_MINOR */ +#else /* BUILD_OS_APPLEOSX */ + return(res); +#endif /* BUILD_OS_APPLEOSX */ +#else /* MACOSX */ + return(res); +#endif /* MACOSX */ } #if defined(NETBSD) || defined(MACOSX)