summaryrefslogtreecommitdiff
path: root/src/passwd/putpwent.c
blob: 312b76530254d14b246ca1fc5972096c3f53ba65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
#define _GNU_SOURCE
#include <pwd.h>
#include <stdio.h>

int putpwent(const struct passwd *pw, FILE *f)
{
	return fprintf(f, "%s:%s:%u:%u:%s:%s:%s\n",
		pw->pw_name, pw->pw_passwd, pw->pw_uid, pw->pw_gid,
		pw->pw_gecos, pw->pw_dir, pw->pw_shell)<0 ? -1 : 0;
}