aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/options/posix/include/grp.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/grp.h
parenta95b38b1b92b172e6cc4e8e56a88a30cc65907b0 (diff)
lib: Add mlibc
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'lib/mlibc/options/posix/include/grp.h')
-rw-r--r--lib/mlibc/options/posix/include/grp.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/mlibc/options/posix/include/grp.h b/lib/mlibc/options/posix/include/grp.h
new file mode 100644
index 0000000..a50396e
--- /dev/null
+++ b/lib/mlibc/options/posix/include/grp.h
@@ -0,0 +1,43 @@
+#ifndef _GRP_H
+#define _GRP_H
+
+#include <stddef.h>
+#include <stdio.h>
+#include <abi-bits/gid_t.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct group {
+ char *gr_name;
+ char *gr_passwd;
+ gid_t gr_gid;
+ char **gr_mem;
+};
+
+#ifndef __MLIBC_ABI_ONLY
+
+void endgrent(void);
+struct group *getgrent(void);
+struct group *getgrgid(gid_t);
+int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **);
+struct group *getgrnam(const char *);
+int getgrnam_r(const char *, struct group *, char *, size_t, struct group **);
+void setgrent(void);
+int putgrent(const struct group *, FILE *);
+struct group *fgetgrent(FILE *);
+
+int setgroups(size_t size, const gid_t *list);
+int initgroups(const char *user, gid_t group);
+
+// Non standard extension
+int getgrouplist(const char *, gid_t, gid_t *, int *);
+
+#endif /* !__MLIBC_ABI_ONLY */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GRP_H