getgrent

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



åå
       getgrent, setgrent, endgrent - ã°ã«ã¼ããã¡ã¤ã«ã¨ã³ããªã®åå¾

æ¸å¼
       #include <sys/types.h>
       #include <grp.h>

       struct group *getgrent(void);

       void setgrent(void);

       void endgrent(void);

   glibc åãã®æ©è½æ¤æ»ãã¯ãã®è¦ä»¶ (feature_test_macros(7)  åç§):

       setgrent():
           _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 ||
           _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED ||
           /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L

       getgrent(), endgrent():
           _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 ||
           _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED

説æ
       getgrent()  é¢æ°ã¯ãã°ã«ã¼ãã»ãã¼ã¿ãã¼ã¹ããåå¾ããã¨ã³ããªã
       è¦ç´ æ¯ã«å解ããåè¦ç´ ãæ ¼ç´ããæ§é ä½ã¸ã®ãã¤ã³ã¿ãè¿ã
       (ã°ã«ã¼ãã»ãã¼ã¿ãã¼ã¹ã®ä¾: ãã¼ã«ã«ã®ã°ã«ã¼ããã¡ã¤ã« /etc/group, NIS,
       LDAP)ã getgrent() ã¯ãæåã«å¼ã³åºãããæã¯æåã®ã¨ã³ããªãè¿ãã
       ãã以éã¯å¼ã³åºãããæ¯ã«æ¬¡ã®ã¨ã³ããªãè¿ãã

       setgrent()  é¢æ°ã使ãã¨ãããä¸åº¦èªã¿è¾¼ããããã«ã
       ã°ã«ã¼ãã»ãã¼ã¿ãã¼ã¹ã®åé ã«æ»ãã

       endgrent()  é¢æ°ã¯ãå¨ã¦ã®å¦çãçµãã£ãå¾ã«ã°ã«ã¼ãã» ãã¼ã¿ãã¼ã¹ãã¯ãã¼ãºããã

       group æ§é ä½ã¯ <grp.h> ã§ä»¥ä¸ã®ããã«å®ç¾©ããã¦ãã:

           struct group {
               char   *gr_name;       /* ã°ã«ã¼ãå */
               char   *gr_passwd;     /* ã°ã«ã¼ãã®ãã¹ã¯ã¼ã */
               gid_t   gr_gid;        /* ã°ã«ã¼ã ID */
               char  **gr_mem;        /* ã°ã«ã¼ãã®ã¡ã³ã */
           };

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

è¿ãå¤
       getgrent()  é¢æ°ã¯ group æ§é ä½ã¸ã®ãã¤ã³ã¿ãè¿ãã
       ãã以ä¸ã¨ã³ããªãç¡ãããã¨ã©ã¼ãçºçããå ´å㯠NULL ãè¿ãã

       ã¨ã©ã¼ãçºçããã¨ã errno ãé©åã«è¨å®ãããã ãã®é¢æ°ã®å¼ã³åºãå¾ã« errno
       ããã§ãã¯ãããå ´åã¯ãå¼ã³åºãåã« errno ã 0 ã«è¨å®ãã¦ãããªãã¨ãããªãã

       è¿ãå¤ã¯éçãªé åãæãã¦ããããã®å¾ã® getgrent(), getgrgid(3), getgrnam(3)
       ã®å¼ã³åºãã§ä¸æ¸ãããããããããªãã (è¿ããããã¤ã³ã¿ã free(3)  ã«æ¸¡ããªããã¨ã)

ã¨ã©ã¼
       EINTR  ã·ã°ãã«ãææãããã

       EIO    I/O ã¨ã©ã¼ã

       EMFILE å¼ã³åºããããã»ã¹ãæ¢ã«ãã¡ã¤ã«ããªã¼ãã³ãéãã¦ããã

       ENFILE ã·ã¹ãã ä¸ã«ãªã¼ãã³ããããã¡ã¤ã«ãå¤éããã

       ENOMEM group æ§é ä½ãå²ãå½ã¦ãããã®ã¡ã¢ãªãä¸ååã

       ERANGE ä¸ãããããããã¡ç©ºéãä¸ååã§ããã

ãã¡ã¤ã«
       /etc/group
              ãã¼ã«ã«ã®ã°ã«ã¼ãã»ãã¼ã¿ãã¼ã¹ãã¡ã¤ã«

æºæ
       SVr4, 4.3BSD, POSIX.1-2001.

é¢é£é ç®
       fgetgrent(3), getgrent_r(3), getgrgid(3), getgrnam(3) getgrouplist(3),
       putgrent(3), group(5)

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



                                  2010-10-21                       GETGRENT(3)