putpwent − 패스워드 파일 엔트리를 쓴다.
#include <pwd.h>
#include <stdio.h>
#include <sys/types.h>
int putpwent(const struct passwd *p, FILE *stream);
putpwent() 함수는 stream과 관련된 파일에 구조체 p 인 패스워드 엔트리를 쓴다.
passwd 구조체는 다음처럼 <pwd.h>에 정의되어 있다:
struct passwd {
char *pw_name;
/* 유저 이름 */ |
|||
/* 유저 패스워드 */ |
|||
/* 유저 id */ |
|||
/* 그룹 id */ |
char *pw_gecos; /* 실제 이름 */
char *pw_dir;
/* 홈 디렉토리 */ |
char *pw_shell; /* shell 프로그램 */
};
putpwent() 함수는 성공시 0을 리턴하고, 에러가 발생하면 −1을 반환한다. occurs.
EINVAL |
유효하지 않은 인자가 주어졌다. |
SVID 3
fgetpwent(3), getpwent(3), setpwent(3), endpwent(3), getpwnam(3), getpwuid(3), getpw(3)
정강훈 <skyeyes AT soback DOT kornet DOT net>, 2001년 4월 30일