|
��������
statfs, fstatfs - ��������� ���������� � �������� �������
���������
#include <sys/types.h> #include <sys/statfs.h> int statfs (path, buf, len, fstyp) char *path; struct statfs *buf; int len, fstyp; int fstatfs (fildes, buf, len, fstyp) int fildes; struct statfs *buf; int len, fstyp;
��������
��������� ����� statfs ���������� "������� ���������",
����������� �������� �������. ����� ����� �������������� ��� ������� ���������� ��� � ��������������, ��� � �
���������������� �������� �������; ������������� ������
��������� ����������� � ���� ���� �������. � ����� ������� �������� buf �������� ���������� �� ���������
(����������� ����), ���� ������� ����������� � ���������� ���������� ���������� ������, � �������� len ������ ���������� ���� ����������, ������� ������� ������
��������� � ���������. �������� len �� ������ ���������
������ ���������: sizeof (struct statfs) � ������ len
�������� ������ ���� ������; ���� �������� len ��������
������� ��������, �� ������� �������� � ��������� �����
�������� ���������� ����, ��� ���� ����������� � �����
������� ������� ��������� � ��������� statfs ����� ����
��� �������������� ������ ��������.
���� ����������� �������� ������� � ������� ������ ������������, �� ���������� ��� path ������ ���� ������ �����, ������� ������������� � ������ �������� �������. � ���� ������ ��� �������� ������� �������� ��, � �������� fstyp ������ ���� �������. ��� ���������������� �������� ������� ���������� ��� path ������ ���� ������ ������������ �������� �����, ����������� ��, � �������� fstyp ������ ��������� (���������) ��� �������� �������. � ����� ������� ����� ������� �� ������, ������ ��� ���������� ���������� ����� �� ���������, �� ��� ��������, ������������� � ���������� �����, ������ ���� �������� �� �����.
��������� statfs, �� ������� ��������� �������� buf, ������� �� ��������� �����:
short f_fstyp; /* ��� �������� ������� */ short f_bsize; /* ������ ����� */ short f_frsize; /* ������ �������� */ long f_blocks; /* ����� ���������� ������ */ long f_bfree; /* ������� ��������� ������ */ long f_files; /* ����� ���-�� ���������� ������ */ long f_ffree; /* ������� ������. ������. ������ */ char f_fname [6]; /* ��� ���� */ char f_fpack [6]; /* ��� ������ */
��������� ����� fstatfs ���������� �� statfs ������ ���, ��� ���� ���������������� �� ���������� ������, � ������������ ��������� ����� fildes, �������������� � ���������� ��������� ���������� ��������� ��������� �������: open(2), creat(2), dup(2), fcntl(2) ��� pipe(2).
��������� ����� statfs �������� ����� ������� ��������� ���������� ������ ustat(2) � � ����� ���������� ������������ ������� �������� statfs.
��������� ������ statfs � fstatfs ����������� ��������, ���� ��������� ���� �� ���� �� ��������� �������:
��. �����
chmod(2), chown(2), creat(2), link(2), mknod(2),
pipe(2), read(2), time(2), unlink(2), utime(2),
ustat(2), write(2), fs(4).
�����������
��� �������� ���������� ��������� ����� 0; � ������
������ ������������ -1, � ���������� errno ������������� ��� ������.
|