putpwent

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

putpwent - パスワードファイルエントリーの書き込み  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>

int putpwent(const struct passwd *restrict p, FILE *restrict stream);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

putpwent():

    glibc 2.19 以降:
        _DEFAULT_SOURCE
    glibc 2.19 以前:
        _SVID_SOURCE
 

説明

putpwent() 関数は、構造体 p からのパスワードエントリーを stream に結びつけられたファイルに書き込む。

passwd 構造体は、<pwd.h> で以下のように定義されている:

struct passwd {
    char    *pw_name;        /* ユーザー名 */
    char    *pw_passwd;      /* ユーザーのパスワード */
    uid_t    pw_uid;         /* ユーザー ID */
    gid_t    pw_gid;         /* グループ ID */
    char    *pw_gecos;       /* 本名 */
    char    *pw_dir;         /* ホームディレクトリ */
    char    *pw_shell;       /* シェルプログラム */
};
 

返り値

The putpwent() function returns 0 on success. On failure, it returns -1, and errno is set to indicate the error.  

エラー

EINVAL
無効な(NULL)引数が渡された。
 

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
putpwent() Thread safetyMT-Safe locale
 

標準規格

なし。  

歴史

SVr4.  

関連項目

endpwent(3), fgetpwent(3), getpw(3), getpwent(3), getpwnam(3), getpwuid(3), setpwent(3)


 

Index

名前
ライブラリ
書式
説明
返り値
エラー
属性
標準規格
歴史
関連項目

This document was created by man2html, using the manual pages.