{"id":6769,"date":"2022-12-20T19:33:37","date_gmt":"2022-12-20T22:33:37","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/fgetgrent-man3\/"},"modified":"2022-12-20T19:33:37","modified_gmt":"2022-12-20T22:33:37","slug":"fgetgrent-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/fgetgrent-man3\/","title":{"rendered":"FGETGRENT (man3)"},"content":{"rendered":"<h1 align=\"center\">FGETGRENT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#ATTRIBUTES\">ATTRIBUTES<\/a><br \/> <a href=\"#CONFORMING TO\">CONFORMING TO<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">fgetgrent \u2212 get group file entry<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <stdio.h> <br \/> #include <sys\/types.h> <br \/> #include <grp.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>struct group *fgetgrent(FILE *<\/b><i>stream<\/i><b>);<\/b><\/p>\n<p style=\"margin-left:5%; margin-top: 1em\">Feature Test Macro Requirements for glibc (see <b>feature_test_macros<\/b>(7)):<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>fgetgrent<\/b>(): <br \/> Since glibc 2.19: <br \/> _DEFAULT_SOURCE <br \/> Glibc 2.19 and earlier: <br \/> _SVID_SOURCE<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>fgetgrent<\/b>() function returns a pointer to a structure containing the group information from the file referred to by <i>stream<\/i>. The first time it is called it returns the first entry; thereafter, it returns successive entries. The file referred to by <i>stream<\/i> must have the same format as <i>\/etc\/group<\/i> (see <b>group<\/b>(5)).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>group<\/i> structure is defined in <i><grp.h><\/i> as follows:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">struct group { <br \/> char *gr_name; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var group name bodies\/ usr\/ <br \/> char *gr_passwd; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var group password bodies\/ usr\/ <br \/> gid_t gr_gid; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var group ID bodies\/ usr\/ <br \/> char **gr_mem; \/bin \/boot \/dead.letter \/dev \/etc \/home \/initrd \/lib \/lib64 \/lost+found \/media \/mnt \/opt \/proc \/release-notes.html \/release-notes.txt \/root \/run \/sbin \/srv \/sys \/tmp \/usr \/var NULL-terminated array of pointers <br \/> to names of group members bodies\/ usr\/ <br \/> };<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>fgetgrent<\/b>() function returns a pointer to a <i>group<\/i> structure, or NULL if there are no more entries or an error occurs. In the event of an error, <i>errno<\/i> is set to indicate the cause.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>ENOMEM<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"73%\">\n<p style=\"margin-top: 1em\">Insufficient memory to allocate <i>group<\/i> structure.<\/p>\n<\/td>\n<td width=\"5%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>ATTRIBUTES <a name=\"ATTRIBUTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">For an explanation of the terms used in this section, see <b>attributes<\/b>(7).<\/p>\n<p align=\"center\" style=\"margin-top: 1em\"><img decoding=\"async\" src=\"grohtml-1633521.png\" alt=\"Image grohtml-1633521.png\"><\/p>\n<h2>CONFORMING TO <a name=\"CONFORMING TO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">SVr4.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>endgrent<\/b>(3), <b>fgetgrent_r<\/b>(3), <b>fopen<\/b>(3), <b>getgrent<\/b>(3), <b>getgrgid<\/b>(3), <b>getgrnam<\/b>(3), <b>putgrent<\/b>(3), <b>setgrent<\/b>(3), <b>group<\/b>(5)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  fgetgrent \u2212 get group file entry <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3140,3007],"class_list":["post-6769","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-fgetgrent","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6769"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6769\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}