1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" References consulted:
25 .\" Linux libc source code
26 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2003-11-15 by aeb
32 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
33 .\" all rights reserved.
34 .\" Translated 1997-12-19, HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
35 .\" Updated & Modefied 1999-02-26, Shouichi Saito
36 .\" Updated & Modified 2004-06-05, Yuichi SATO <ysato444@yahoo.co.jp>
37 .\" Updated & Modified 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
38 .\" Updated 2008-12-24, Akihiro MOTOKI, LDP v3.14
40 .TH GETGRNAM 3 2009-03-30 "" "Linux Programmer's Manual"
42 getgrnam, getgrnam_r, getgrgid, getgrgid_r \- ¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë¥¨¥ó¥È¥ê¤Î¼è¤ê½Ð¤·
45 .B #include <sys/types.h>
48 .BI "struct group *getgrnam(const char *" name );
50 .BI "struct group *getgrgid(gid_t " gid );
52 .BI "int getgrnam_r(const char *" name ", struct group *" grp ,
54 .BI " char *" buf ", size_t " buflen ", struct group **" result );
56 .BI "int getgrgid_r(gid_t " gid ", struct group *" grp ,
58 .BI " char *" buf ", size_t " buflen ", struct group **" result );
62 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
63 .RB ( feature_test_macros (7)
70 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _BSD_SOURCE ||
71 _SVID_SOURCE || _POSIX_SOURCE
77 ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò
78 Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹
79 (¥Ñ¥¹¥ï¡¼¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÎã:
80 ¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¥Õ¥¡¥¤¥ë
87 ¤Ë¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¨¥ó¥È¥ê¤ò
88 Í×ÁÇËè¤Ëʬ²ò¤·¡¢³ÆÍ×ÁǤò³ÊǼ¤·¤¿¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
93 ´Ø¿ô¤Ï (¾åµ¤Î´Ø¿ô¤È) Ʊ¤¸¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¬¡¢
98 ¤¬»Ø¤¹Îΰè¤Ë³ÊǼ¤¹¤ë¡£
101 ¹½Â¤ÂΤˤÏʸ»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¡¢
102 ¤³¤ì¤é¤Îʸ»úÎó¤Ï¥µ¥¤¥º
109 ¤Ë¤Ï·ë²Ì¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬³ÊǼ¤µ¤ì¤ë¡£
110 ¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¤Ï
114 \fIgroup\fP ¹½Â¤ÂΤϡ¢\fI<grp.h>\fP ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë:
119 char *gr_name; /* ¥°¥ë¡¼¥×̾ */
120 char *gr_passwd; /* ¥°¥ë¡¼¥×¤Î¥Ð¥¹¥ï¡¼¥É */
121 gid_t gr_gid; /* ¥°¥ë¡¼¥× ID */
122 char **gr_mem; /* ¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð */
128 ¤ËºÇÂçɬÍפʥµ¥¤¥º¤Ï¡¢
131 .B _SC_GETGR_R_SIZE_MAX
132 ¤ò»ØÄꤷ¤Æ¼Â¹Ô¤¹¤ë¤³¤È¤Çʬ¤«¤ë¡£
139 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
140 ¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢
141 ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤¹¡£
142 ¥¨¥é¡¼¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢
147 ¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢
148 ¸Æ¤Ó½Ð¤·¤ÎÁ°¤Ë (¤³¤ÎÃͤò) 0 ¤ËÀßÄꤷ¤Æ¤ª¤¯¤Ù¤¤Ç¤¢¤ë¡£
150 ÊÖ¤êÃͤÏÀÅŪ¤ÊÎΰè¤ò»Ø¤·¤Æ¤ª¤ê¡¢¤½¤Î¸å¤Î
154 ¤Î¸Æ¤Ó½Ð¤·¤Ç¾å½ñ¤¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
168 ¥Þ¥Ã¥Á¤¹¤ë¥°¥ë¡¼¥×¡¦¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
172 ¥¨¥é¡¼¤Î¾ì¹ç¡¢¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¡¢
177 .BR 0 " ¤Þ¤¿¤Ï " ENOENT " ¤Þ¤¿¤Ï " ESRCH " ¤Þ¤¿¤Ï " EBADF " ¤Þ¤¿¤Ï " EPERM " ¤Þ¤¿¤Ï ... "
185 ¥·¥°¥Ê¥ë¤¬¥¥ã¥Ã¥Á¤µ¤ì¤¿¡£
191 ¸Æ¤Ó½Ð¤·¤¿¥×¥í¥»¥¹¤Ë¤ª¤¤¤Æ¡¢
194 ¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£
197 ¥·¥¹¥Æ¥à¾å¤Ç´û¤ËºÇÂç¿ô¤Î¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¡£
202 ¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î¥á¥â¥ê¤¬ÉÔ½½Ê¬¡£
203 .\" ¥°¥ë¡¼¥×¾ðÊó¹½Â¤ÂΤò³ä¤êÅö¤Æ¤ë¤¿¤á¡¢¤Þ¤¿¤Ï¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤ë¤¿¤á¤Î
206 Í¿¤¨¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¶õ´Ö¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¡£
210 ¥í¡¼¥«¥ë¤Î¥°¥ë¡¼¥×¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë
212 SVr4, 4.3BSD, POSIX.1-2001.
214 ¾åµ¤Î¡ÖÊÖ¤êÃ͡װʲ¼¤Îµ½Ò¤Ï POSIX.1-2001 ¤Ëµò¤ë¡£
215 ¤³¤Îɸ½à¤Ï¡Ö(¥¨¥ó¥È¥ê¤¬) ¸«¤Ä¤«¤é¤Ê¤¤¤³¤È¡×¤ò¥¨¥é¡¼¤È¤·¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢
218 ¤¬¤É¤Î¤è¤¦¤ÊÃͤˤʤ뤫¤òÄê¤á¤Æ¤¤¤Ê¤¤¡£
219 ¤½¤Î¤¿¤á¡¢¥¨¥é¡¼¤òǧ¼±¤¹¤ë¤³¤È¤ÏÉÔ²Äǽ¤Ç¤¢¤ë¡£
220 POSIX ¤Ë½àµò¤·¤Æ¡¢¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï
222 ¤òÊѹ¹¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤¤Ç¤¢¤ë¡¢¤È¼çÄ¥¤¹¤ë¿Í¤â¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
223 ÍÍ¡¹¤Ê Unix ·Ï¤Î¥·¥¹¥Æ¥à¤Ç»î¤·¤Æ¤ß¤ë¤È¡¢¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ë¤Ï
224 0, ENOENT, EBADF, ESRCH, EWOULDBLOCK, EPERM ¤È¤¤¤Ã¤¿ÍÍ¡¹¤ÊÃͤ¬ÊÖ¤µ¤ì¤ë¡£
225 ¾¤ÎÃͤ¬ÊÖ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
227 .\" AIX 5.1 ¤Ï ESRCH ¤òÊÖ¤¹¡£
228 .\" OSF1 4.0g ¤Ï EWOULDBLOCK ¤òÊÖ¤¹¡£
229 .\" libc, glibc (¥Ð¡¼¥¸¥ç¥ó 2.6 ¤Þ¤Ç), Irix 6.5 ¤Ï ENOENT ¤òÊÖ¤¹¡£
230 .\" glibc (¥Ð¡¼¥¸¥ç¥ó 2.7 °Ê¹ß) ¤Ï 0 ¤òÊÖ¤¹¡£
231 .\" FreeBSD 4.8, OpenBSD 3.2, NetBSD 1.6 ¤Ï EPERM ¤òÊÖ¤¹¡£
232 .\" SunOS 5.8 ¤Ï EBADF ¤òÊÖ¤¹¡£
233 .\" Tru64 5.1b, HP-UX-11i, SunOS 5.7 ¤Ï 0 ¤òÊÖ¤¹¡£