Server for Information Technologies ������ ��������������
������� �������������� ����������
(095) 932-9212, 932-9213, 939-0783
E-mail: [email protected]
������ �������� ����(!) ������������� ���������� CIT Forum CD-ROM

GETPWENT(3C)

��������
getpwent, getpwuid, getpwnam, setpwent, endpwent, fgetpwent - ��������� ��������� ����� �������

���������

	#include <pwd.h>
	
	struct passwd *getpwent ( )
	
	struct passwd *getpwuid (uid)
	int uid;
	
	struct passwd *getpwnam (name)
	char *name;
	
	void setpwent ( )
	
	void endpwent ( )
	
	struct passwd *fgetpwent (f)
	FILE *f;

��������
������ �� ������� getpwent, getpwuid � getpwnam ���������� ��������� �� ��������� ���� passwd, ���������� ����������� �� ���� ������ ����� ������� /etc/passwd. ��������� ������� �� ���������� ����� <pwd.h>:

	     struct passwd {
	       char *pw_name;
	       char *pw_passwd;
	       int  pw_uid;
	       int  pw_gid;
	       char *pw_age;
	       char *pw_comment;
	       char *pw_gecos;
	       char *pw_dir;
	       char *pw_shell;
	     };
�� ������ ������ ����� ��������� ��. passwd(4).

��� ������ ������ ������� getpwent ���������� ��������� �� ������ ��������� ���� passwd � �����; ��� ��������� ������ ������������ ��������� �� ��������� ���������; ������� ���������������� ������ ������� ����� ������������ ��� ��������� ����� �����. ������� getpwuid ���� � ������ ����� ������, ���������� �������� ������������� ������������ uid, � ���������� ��������� �� ���������, ��������������� ������� ������. ������� getpwnam ���� � ������ ����� ������, ���������� ����������������� ������� ��� name � ���������� ��������� �� ��������������� ���������. � ������ ���������� ������ (� ��� ����� �� �� ������ ������) ��������� ������� ���������� ������ ��������� NULL.

����� ������� setpwent �������� � ������������� ��������� ������ �� ������ ����� �������, �� ���� ����� ����� ������ ����� ����� ��������� �������� ����� �����. ������� endpwent ������ ��� �������� ����� �������.

������� fgetpwent ���������� ��������� �� ��������� ��������� ���� passwd � ������ f, ��������������� ������� ����� /etc/passwd.

�����

	/etc/passwd

��. �����
getlogin(3C), getgrent(3C), passwd(4).

�����������
� ������ ���������� ������ (� ��� ����� �� �� ������ ������) ������������ ������ ��������� NULL.

���������������
��������� ������� ���������� ����������� ����� �����/ ������, ��� �������� � ������������ ���������� ������� ��������, �� ������������ ����������� ����/�����.

�����������
��������, ������������ ���������� ���������, ��������� �� ���� � ��� �� ����������� ������, ���������� �������� ��������� ���������� ����� ������� ������. �������, ���� ���������� ��������� ���������� � ������� ������� ����������, ������� ����������� ��.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT