*
* @APPLE_LICENSE_HEADER_START@
*
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License"). You may not use this file except in compliance with the
- * License. Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this
+ * file.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _PWD_H_
#define _PWD_H_
-#include <sys/types.h>
+#include <_types.h>
-#ifndef _POSIX_SOURCE
+#ifndef _GID_T
+typedef __darwin_gid_t gid_t;
+#define _GID_T
+#endif
+
+#ifndef _SIZE_T
+#define _SIZE_T
+typedef __darwin_size_t size_t;
+#endif
+
+#ifndef _UID_T
+typedef __darwin_uid_t uid_t;
+#define _UID_T
+#endif
+
+#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
+#define _PATH_PWD "/etc"
#define _PATH_PASSWD "/etc/passwd"
+#define _PASSWD "passwd"
#define _PATH_MASTERPASSWD "/etc/master.passwd"
#define _PATH_MASTERPASSWD_LOCK "/etc/ptmp"
+#define _MASTERPASSWD "master.passwd"
#define _PATH_MP_DB "/etc/pwd.db"
+#define _MP_DB "pwd.db"
#define _PATH_SMP_DB "/etc/spwd.db"
+#define _SMP_DB "spwd.db"
#define _PATH_PWD_MKDB "/usr/sbin/pwd_mkdb"
char *pw_passwd; /* encrypted password */
uid_t pw_uid; /* user uid */
gid_t pw_gid; /* user gid */
- time_t pw_change; /* password change time */
+ __darwin_time_t pw_change; /* password change time */
char *pw_class; /* user access class */
char *pw_gecos; /* Honeywell login info */
char *pw_dir; /* home directory */
char *pw_shell; /* default shell */
- time_t pw_expire; /* account expiration */
+ __darwin_time_t pw_expire; /* account expiration */
};
#include <sys/cdefs.h>
__BEGIN_DECLS
-struct passwd *getpwuid __P((uid_t));
-struct passwd *getpwnam __P((const char *));
-int getpwuid_r __P((uid_t, struct passwd *, char *, size_t, struct passwd **));
-int getpwnam_r __P((const char *, struct passwd *, char *, size_t, struct passwd **));
-#ifndef _POSIX_SOURCE
-struct passwd *getpwent __P((void));
-#ifndef _XOPEN_SOURCE
-int setpassent __P((int));
-#endif
-int setpwent __P((void));
-void endpwent __P((void));
+struct passwd *getpwuid(uid_t);
+struct passwd *getpwnam(const char *);
+int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
+int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
+struct passwd *getpwent(void);
+#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
+int setpassent(int);
+char *user_from_uid(uid_t, int);
#endif
+void setpwent(void);
+void endpwent(void);
__END_DECLS
#endif /* !_PWD_H_ */