+static int bb__pgsreader(
+ int FAST_FUNC (*parserfunc)(void *d, char *line),
+ void *data,
+ char *__restrict line_buff,
+ size_t buflen,
+ FILE *f);
+
+static int FAST_FUNC bb__parsepwent(void *pw, char *line);
+static int FAST_FUNC bb__parsegrent(void *gr, char *line);
+#if ENABLE_USE_BB_SHADOW
+static int FAST_FUNC bb__parsespent(void *sp, char *line);
+#endif
+
+/**********************************************************************/
+/* We avoid having big global data. */
+
+struct statics {
+ /* Smaller things first */
+ struct passwd getpwuid_resultbuf;
+ struct group getgrgid_resultbuf;
+ struct passwd getpwnam_resultbuf;
+ struct group getgrnam_resultbuf;
+
+ char getpwuid_buffer[PWD_BUFFER_SIZE];
+ char getgrgid_buffer[GRP_BUFFER_SIZE];
+ char getpwnam_buffer[PWD_BUFFER_SIZE];
+ char getgrnam_buffer[GRP_BUFFER_SIZE];
+#if 0
+ struct passwd fgetpwent_resultbuf;
+ struct group fgetgrent_resultbuf;
+ struct spwd fgetspent_resultbuf;
+ char fgetpwent_buffer[PWD_BUFFER_SIZE];
+ char fgetgrent_buffer[GRP_BUFFER_SIZE];
+ char fgetspent_buffer[PWD_BUFFER_SIZE];
+#endif
+#if 0 //ENABLE_USE_BB_SHADOW
+ struct spwd getspuid_resultbuf;
+ struct spwd getspnam_resultbuf;
+ char getspuid_buffer[PWD_BUFFER_SIZE];
+ char getspnam_buffer[PWD_BUFFER_SIZE];
+#endif
+// Not converted - too small to bother
+//pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
+//FILE *pwf /*= NULL*/;
+//FILE *grf /*= NULL*/;
+//FILE *spf /*= NULL*/;
+#if 0
+ struct passwd getpwent_pwd;
+ struct group getgrent_gr;
+ char getpwent_line_buff[PWD_BUFFER_SIZE];
+ char getgrent_line_buff[GRP_BUFFER_SIZE];
+#endif
+#if 0 //ENABLE_USE_BB_SHADOW
+ struct spwd getspent_spwd;
+ struct spwd sgetspent_spwd;
+ char getspent_line_buff[PWD_BUFFER_SIZE];
+ char sgetspent_line_buff[PWD_BUFFER_SIZE];
+#endif
+};
+
+static struct statics *ptr_to_statics;
+
+static struct statics *get_S(void)
+{
+ if (!ptr_to_statics)
+ ptr_to_statics = xzalloc(sizeof(*ptr_to_statics));
+ return ptr_to_statics;
+}