From 8947d55f1762406b2749deb45742aaa144d74e79 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 12 Jun 2002 23:32:53 +0000 Subject: Don't use fixed buffers if we have an mmu such that malloc and realloc are cheap. -Erik --- libc/pwd_grp/config.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'libc/pwd_grp') 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 #include #include #include @@ -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 -- cgit v1.2.3