diff --git a/include/grp.h b/include/grp.h index 7d9d114e70f8..c9e94166171a 100644 --- a/include/grp.h +++ b/include/grp.h @@ -1,4 +1,4 @@ -/* $NetBSD: grp.h,v 1.21 2005/04/02 04:54:35 christos Exp $ */ +/* $NetBSD: grp.h,v 1.22 2005/05/24 17:36:29 kleink Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,15 +57,18 @@ struct group { __BEGIN_DECLS struct group *getgrgid(gid_t); struct group *getgrnam(const char *); -#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) -struct group *getgrent(void); -void setgrent(void); -void endgrent(void); +#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \ + defined(_REENTRANT) || defined(_NETBSD_SOURCE) int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); #endif +#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) +struct group *getgrent(void); +void setgrent(void); +void endgrent(void); +#endif #if defined(_NETBSD_SOURCE) void setgrfile(const char *); int setgroupent(int); diff --git a/include/pwd.h b/include/pwd.h index aff393f44760..372c3bf84695 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -1,4 +1,4 @@ -/* $NetBSD: pwd.h,v 1.38 2005/04/02 04:54:35 christos Exp $ */ +/* $NetBSD: pwd.h,v 1.39 2005/05/24 17:36:29 kleink Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -120,15 +120,18 @@ struct passwd { __BEGIN_DECLS struct passwd *getpwuid(uid_t); struct passwd *getpwnam(const char *); -#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) -struct passwd *getpwent(void); -void setpwent(void); -void endpwent(void); +#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \ + defined(_REENTRANT) || defined(_NETBSD_SOURCE) int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); #endif +#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) +struct passwd *getpwent(void); +void setpwent(void); +void endpwent(void); +#endif #if defined(_NETBSD_SOURCE) int pw_gensalt(char *, size_t, const char *, const char *); int pw_scan(char *, struct passwd *, int *);