getpw

GETPW(3)                   Linux Programmer's Manual                  GETPW(3)



åå
       getpw - ãã¹ã¯ã¼ãè¡ã¨ã³ããªãåå¾ãã

æ¸å¼
       #define _GNU_SOURCE             /* feature_test_macros(7) åç§ */
       #include <sys/types.h>
       #include <pwd.h>

       int getpw(uid_t uid, char *buf);

説æ
       getpw()  é¢æ°ã¯ããããã¡ buf ã«æå®ã¦ã¼ã¶ ID uid ã®
       ãã¹ã¯ã¼ãè¡ã¨ã³ããªãåå¾ããã è¿ããããããã¡ã¯ã以ä¸ã®å½¢å¼ã®è¡ãå«ãã

              name:passwd:uid:gid:gecos:dir:shell

       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;      /* ã·ã§ã«ããã°ã©ã  */
           };

       ãã®æ§é ä½ã®ãã£ã¼ã«ãã®è©³ç´°ã¯ passwd(5)  ãåç§ã®ãã¨ã

è¿ãå¤
       getpw()  é¢æ°ã¯ãæåããå ´å 0 ãè¿ã; ã¨ã©ã¼ãçºçããå ´å -1 ãè¿ããã¨ã©ã¼ã
       示ãããã« error ãã»ãããããã

ã¨ã©ã¼
       EINVAL buf ã NULLã

       ENOENT uid ã«å¯¾å¿ããã¦ã¼ã¶ãããªãã

       ENOMEM passwd æ§é ä½ã«å²ãå½ã¦ãã¡ã¢ãªãååãªãã£ãã

ãã¡ã¤ã«
       /etc/passwd
              ãã¹ã¯ã¼ããã¼ã¿ãã¼ã¹ãã¡ã¤ã«

æºæ
       SVr2

ãã°
       getpw()  é¢æ°ã¯ãä¸ãããããããã¡ buf ããªã¼ãã¼ããã¼ãããããããªãã®ã§å±éºã§ããã
       ãã®é¢æ°ã¯ getpwuid(3)  ã«ãã£ã¦å¤ããã®ã¨ãªã£ãã

é¢é£é ç®
       endpwent(3), fgetpwent(3), getpwent(3), getpwnam(3), getpwuid(3),
       putpwent(3), setpwent(3), passwd(5)

ãã®ææ¸ã«ã¤ãã¦
       ãã® man ãã¼ã¸ã¯ Linux man-pages ããã¸ã§ã¯ãã®ãªãªã¼ã¹ 3.51 ã®ä¸é¨
       ã§ãããããã¸ã§ã¯ãã®èª¬æã¨ãã°å ±åã«é¢ããæå ±ã¯
       http://www.kernel.org/doc/man-pages/ ã«æ¸ããã¦ããã



GNU                               2010-10-21                          GETPW(3)