mirror of git://git.musl-libc.org/musl
add fgetpwent (nonstandard function)
based on patch by Jeremy Huntwork
This commit is contained in:
parent
4619901ec4
commit
5e9314ff03
|
@ -9,6 +9,10 @@ extern "C" {
|
||||||
#define __NEED_uid_t
|
#define __NEED_uid_t
|
||||||
#define __NEED_gid_t
|
#define __NEED_gid_t
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
#define __NEED_FILE
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <bits/alltypes.h>
|
#include <bits/alltypes.h>
|
||||||
|
|
||||||
struct passwd
|
struct passwd
|
||||||
|
@ -33,6 +37,7 @@ int getpwnam_r (const char *, struct passwd *, char *, size_t, struct passwd **)
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
char *getpass(const char *);
|
char *getpass(const char *);
|
||||||
|
struct passwd *fgetpwent(FILE *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#include "pwf.h"
|
||||||
|
|
||||||
|
struct passwd *fgetpwent(FILE *f)
|
||||||
|
{
|
||||||
|
static char *line;
|
||||||
|
static struct passwd pw;
|
||||||
|
size_t size=0;
|
||||||
|
return __getpwent_a(f, &pw, &line, &size);
|
||||||
|
}
|
Loading…
Reference in New Issue