diff options
author | mike <mike@FreeBSD.org> | 2002-06-09 19:39:18 +0000 |
---|---|---|
committer | mike <mike@FreeBSD.org> | 2002-06-09 19:39:18 +0000 |
commit | 27f173c485a1818d3a83fd93de39625a30b9764e (patch) | |
tree | d605220df514540ee719a3440e134ff19a290e76 /include/pwd.h | |
parent | c1a6b37593a63bce8e662b7e8770e09a482d71d3 (diff) | |
download | FreeBSD-src-27f173c485a1818d3a83fd93de39625a30b9764e.zip FreeBSD-src-27f173c485a1818d3a83fd93de39625a30b9764e.tar.gz |
o Remove include of <sys/types.h>, it adds too much pollution;
instead, add typedefs of only gid_t, time_t, and uid_t.
o Remove an unneeded conditional that hid macros that are in the
implementation namespace and therefore don't need to be hidden when
_POSIX_SOURCE is defined.
o Adjust some conditionals for compatibility with X/Open and POSIX.
o Note missing functions getpwnam_r() and getpwuid_r().
Diffstat (limited to 'include/pwd.h')
-rw-r--r-- | include/pwd.h | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/include/pwd.h b/include/pwd.h index 8634a7f..b038fa7 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -42,9 +42,24 @@ #ifndef _PWD_H_ #define _PWD_H_ -#include <sys/types.h> +#include <sys/cdefs.h> +#include <sys/_types.h> + +#ifdef _BSD_GID_T_ +typedef _BSD_GID_T_ gid_t; +#undef _BSD_GID_T_ +#endif + +#ifdef _BSD_TIME_T_ +typedef _BSD_TIME_T_ time_t; +#undef _BSD_TIME_T_ +#endif + +#ifdef _BSD_UID_T_ +typedef _BSD_UID_T_ uid_t; +#undef _BSD_UID_T_ +#endif -#ifndef _POSIX_SOURCE #define _PATH_PWD "/etc" #define _PATH_PASSWD "/etc/passwd" #define _PASSWD "passwd" @@ -67,7 +82,6 @@ #define _PASSWORD_EFMT1 '_' /* extended encryption format */ #define _PASSWORD_LEN 128 /* max length, not counting NULL */ -#endif struct passwd { char *pw_name; /* user name */ @@ -101,16 +115,21 @@ struct passwd { #define _PWF_NIS 0x2000 #define _PWF_HESIOD 0x3000 -#include <sys/cdefs.h> - __BEGIN_DECLS -struct passwd *getpwuid(uid_t); struct passwd *getpwnam(const char *); -#ifndef _POSIX_SOURCE +struct passwd *getpwuid(uid_t); + +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 +void endpwent(void); struct passwd *getpwent(void); -int setpassent(int); void setpwent(void); -void endpwent(void); +/* + * XXX missing getpwnam_r() and getpwuid_r(). + */ +#endif + +#if __BSD_VISIBLE +int setpassent(int); const char *user_from_uid(uid_t, int); #endif __END_DECLS |