.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" .\" Modified Sat Jul 24 19:22:14 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified Mon May 27 21:37:47 1996 by Martin Schulze (joey@linux.de) .\" Translated into Spanish Fri Jan 30 1998 by Gerardo Aburruzaga .\" García .\" Traducción revisada por Miguel Pérez Ibars el 19-marzo-2005 .\" .TH GETPWENT 3 "27 mayo 1996" "GNU" "Manual del Programador de Linux" .SH NOMBRE getpwent, setpwent, endpwent \- obtiene una entrada del fichero de cuentas de usuario .SH SINOPSIS .nf .B #include .B #include .sp .B struct passwd *getpwent(void); .sp .B void setpwent(void); .sp .B void endpwent(void); .fi .SH DESCRIPCIÓN La función \fBgetpwent()\fP devuelve un puntero a una estructura que contiene los campos de una línea de \fI/etc/passwd\fP. La primera vez que se la llama devuelve la primera entrada; a partir de ahí, devuelve las entradas sucesivas. .PP La función \fBsetpwent()\fP rebobina el indicador de posición del fichero para ponerlo apuntando al principìo de \fI/etc/passwd\fP. .PP La función \fBendpwent()\fP cierra el fichero \fI/etc/passwd\fP. .PP La estructura \fIpasswd\fP se define en \fI\fP como sigue: .sp .RS .nf .ta 8n 16n 32n struct passwd { char *pw_name; /* nombre de usuario */ char *pw_passwd; /* contraseña cifrada */ uid_t pw_uid; /* id. del usuario */ gid_t pw_gid; /* id. del grupo primario */ char *pw_gecos; /* nombre real */ char *pw_dir; /* directorio de inicio */ char *pw_shell; /* programa caparazón */ }; .ta .fi .RE .SH "VALOR DEVUELTO" La función \fBgetpwent()\fP devuelve la estructura \fIpasswd\fP, o NULL si no hay más entradas u ocurre un error. .SH ERRORES .TP .B ENOMEM Memoria insuficiente para alojar la estructura passwd. .SH FICHEROS .TP .I /etc/passwd fichero con los datos de las cuentas de usuario .SH "CONFORME A" SVID 3, BSD 4.3 .SH "VÉASE TAMBIÉN" .BR fgetpwent "(3), " getpwnam "(3), " getpwuid "(3), " getpw (3), .BR putpwent (3), .BR passwd (5).