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

LSEEK(2)

��������
lseek - ������������ ��������� ������/������

���������

        long lseek (fildes, offset, whence)
        int fildes;
        long offset;
        int whence;

��������
�������� fildes - ��� ���������� �����, ���������� ����� ���������� ��������� ������� creat, open, dup ��� fcntl. ��������� ����� lseek ������������� ��������� ������� ������� �����, ���������������� � ������������ fildes, ��������� �������, � ����������� �� �������� ��������� whence:

0�������� ��������� ��������������� ������ offset ����.
1� �������� �������� ��������� ������������ �������� offset.
2��������� ��������� ���������� ������ ����� ���� offset.

��� �������� ���������� ���������� ������ lseek ������������ ����� �������� ��������� ������� ������� (� ������) ������������ ������ �����. �������, ��� ���� fildes �������� ������������ ����� �� ��������� ���������� � �������� offset ������������, ����� lseek ���������� �������� ��������� ������� �������, ���� ���� ��� ������������.

��������� ����� lseek ����������� �������� � ��������� ������� ������� �� ����������, ���� ��������� ���� �� ���� �� ��������� �������:

[EBADF]
�������� fildes �� �������� ���������� ������������ ��������� �����.
[PIPE]
���������� ����� fildes ������������ � �������.
[EINVAL � ������ SIGSYS] �������� ��������� whence �� ����� 0, 1 ��� 2.
[EINVAL]
���������� fildes �� �������� ������������ �����, �������������� �� ��������� ����������, � �������������� �������� ��������� ������� ������� ������������.

��������� ���������� �� ������������ ������������ ��������� ������� �������. ��� ������, ��������������� � ������ ������������, �������� ��������� �� ����������.

��. �����
creat(2), dup(2), fcntl(2), open(2).

�����������
��� �������� ���������� ����������� ������ ��������������� ����� ����� - ��������� ������� ������� � �����; � ������ ������ ������������ -1, � ���������� errno ������������� ��� ������
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT