fgetpwent(3) Library Functions Manual fgetpwent(3)

fgetpwent - obtiene una entrada de un fichero de contraseñas

Biblioteca Estándar C (libc, -lc)

#include <stdio.h>
#include <sys/types.h>
#include <pwd.h>
struct passwd *fgetpwent(FILE *flujo);
Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

fgetpwent():

    A partir de glibc 2.19:
        _DEFAULT_SOURCE
    En glibc 2.19 y anteriores:
        _SVID_SOURCE

The fgetpwent() function returns a pointer to a structure containing the broken out fields of a line in the file stream. The first time it is called it returns the first entry; thereafter, it returns successive entries. The file referred to by stream must have the same format as /etc/passwd (see passwd(5)).

La estructura passwd se define en <pwd.h> así:


struct passwd {
    char    *pw_name;       /* nombre de usuario */
    char    *pw_passwd;     /* contraseña del usuario */
    uid_t    pw_uid;        /* identificación del usuario */
    gid_t    pw_gid;        /* identificación del grupo */
    char    *pw_gecos;      /* nombre real */
    char    *pw_dir;        /* directorio inicial */
    char    *pw_shell;      /* programa `shell' */
};

The fgetpwent() function returns a pointer to a passwd structure, or NULL if there are no more entries or an error occurs. In the event of an error, errno is set to indicate the error.

Memoria insuficiente para alojar la estructura passwd.

/etc/passwd
archivo con los datos de las cuentas de usuario

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
fgetpwent() Seguridad del hilo MT-Unsafe race:fgetpwent

None.

SVr4.

endpwent(3), fgetpwent_r(3), fopen(3), getpw(3), getpwent(3), getpwnam(3), getpwuid(3), putpwent(3), setpwent(3), passwd(5)

La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García <gerardo.aburruzaga@uca.es>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

31 Octubre 2023 Páginas de manual de Linux 6.06