aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/pwd.h
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-07 17:28:00 -0500
committerIan Moffett <ian@osmora.org>2024-03-07 17:28:32 -0500
commitbd5969fc876a10b18613302db7087ef3c40f18e1 (patch)
tree7c2b8619afe902abf99570df2873fbdf40a4d1a1 /lib/mlibc/options/posix/include/pwd.h
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/include/pwd.h')
-rw-r--r--lib/mlibc/options/posix/include/pwd.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/mlibc/options/posix/include/pwd.h b/lib/mlibc/options/posix/include/pwd.h
new file mode 100644
index 0000000..b885f57
--- /dev/null
+++ b/lib/mlibc/options/posix/include/pwd.h
@@ -0,0 +1,45 @@
+
+#ifndef _PWD_H
+#define _PWD_H
+
+#include <abi-bits/uid_t.h>
+#include <abi-bits/gid_t.h>
+#include <bits/size_t.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct passwd {
+ char *pw_name;
+ char *pw_passwd;
+ uid_t pw_uid;
+ gid_t pw_gid;
+ char *pw_gecos;
+ char *pw_dir;
+ char *pw_shell;
+};
+
+#define NSS_BUFLEN_PASSWD 512
+
+#ifndef __MLIBC_ABI_ONLY
+
+void endpwent(void);
+struct passwd *getpwent(void);
+struct passwd *getpwnam(const char *);
+int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **);
+struct passwd *getpwuid(uid_t);
+int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **);
+void setpwent(void);
+int putpwent(const struct passwd *, FILE *);
+struct passwd *fgetpwent(FILE *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _PWD_H
+