summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/config.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-06-12 23:32:53 +0000
committerEric Andersen <andersen@codepoet.org>2002-06-12 23:32:53 +0000
commit8947d55f1762406b2749deb45742aaa144d74e79 (patch)
tree6f415810796e2d71e565d5a45e701298c5e4598b /libc/pwd_grp/config.h
parentc617db9065afa51100199d9ac4561feee4279291 (diff)
Don't use fixed buffers if we have an mmu such that malloc
and realloc are cheap. -Erik
Diffstat (limited to 'libc/pwd_grp/config.h')
-rw-r--r--libc/pwd_grp/config.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/libc/pwd_grp/config.h b/libc/pwd_grp/config.h
index 2c3c6c3f0..860f7dee9 100644
--- a/libc/pwd_grp/config.h
+++ b/libc/pwd_grp/config.h
@@ -22,6 +22,7 @@
#ifndef _CONFIG_GRP_H
#define _CONFIG_GRP_H
+#include <features.h>
#include <pwd.h>
#include <grp.h>
#include <shadow.h>
@@ -39,7 +40,7 @@ extern int __sgetspent_r(const char * string, struct spwd * spwd,
#define PWD_BUFFER_SIZE 256
-
+
/*
* Define GR_SCALE_DYNAMIC if you want grp to dynamically scale its read buffer
* so that lines of any length can be used. On very very small systems,
@@ -48,7 +49,20 @@ extern int __sgetspent_r(const char * string, struct spwd * spwd,
* On larger systems, you will want to define this, because grp will _not_
* deal with long lines gracefully (they will be skipped).
*/
+/*
+ * Define GR_DYNAMIC_GROUP_LIST to make initgroups() dynamically allocate
+ * space for it's GID array before calling setgroups(). This is probably
+ * unnecessary scalage, so it's undefined by default.
+ */
+#ifdef __UCLIBC_HAS_MMU__
+#define GR_SCALE_DYNAMIC 1
+#define GR_DYNAMIC_GROUP_LIST 1
+#else
#undef GR_SCALE_DYNAMIC
+#undef GR_DYNAMIC_GROUP_LIST
+#endif
+
+
#ifndef GR_SCALE_DYNAMIC
/*
@@ -64,13 +78,6 @@ extern int __sgetspent_r(const char * string, struct spwd * spwd,
#endif /* !GR_SCALE_DYNAMIC */
-/*
- * Define GR_DYNAMIC_GROUP_LIST to make initgroups() dynamically allocate
- * space for it's GID array before calling setgroups(). This is probably
- * unnecessary scalage, so it's undefined by default.
- */
-#undef GR_DYNAMIC_GROUP_LIST
-
#ifndef GR_DYNAMIC_GROUP_LIST
/*
* GR_MAX_GROUPS is the size of the static array initgroups() uses for