mirror of https://git.musl-libc.org/git/musl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
297 B
17 lines
297 B
#include "pwf.h"
|
|
|
|
#define LINE_LIM 256
|
|
|
|
struct spwd *getspnam(const char *name)
|
|
{
|
|
static struct spwd sp;
|
|
static char *line;
|
|
struct spwd *res;
|
|
int e;
|
|
|
|
if (!line) line = malloc(LINE_LIM);
|
|
if (!line) return 0;
|
|
e = getspnam_r(name, &sp, line, LINE_LIM, &res);
|
|
if (e) errno = e;
|
|
return res;
|
|
}
|
|
|