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

IOCTL(2)

��������
ioctl - ���������� ������������

���������

        ioctl (fildes, command, arg)
        int fildes, command;

��������
��������� ����� ioctl ��������� ��������� ����������� �������� ��� �������� ������������ � ������������������. ��� ������, �� ���������� ������������������, ��������, ������� ��������� ���� ��������� �����, ������� �� ����������. ��������� command � arg ���������� � ����, ��������������� � ������������ fildes, � ���������������� ��������� ����������. �������� ������ ���������� ��� ������� ��������� ������������ �����; �������� �������� �����/������ ����������� � ������� ��������� ������� read(2)write(2).

�������� ��� ������������������, ����������� � ������� ���������� ������ ioctl, ������� � streamio(7).

�������� fildes - ��� �������� ���������� �����, ����������� �����������. �������� command ������ ����������� �������� � ������� �� ����������, � ������� ������� ������. �������, arg ������ �������������� ����������, ������� ����� ������������� ��� ���������� ��������� ��������. ��� ��������� arg ������� �� ����������� ������������ �������� � �������� ���� �����, ���� ���������� �� ����������� ��� ���������� ���������.

�������, ��� ���������� ��������� ����� ��������, ������� ����������� ���������� ��������� ���������, �������� ����� ��������� � ���������� [��. termio(7)].

��������� ����� ioctl ����������� �������� ��� ������ ������ ����, ���� ��������� ���� �� ���� �� ��������� �������:

[EBADF]
�������� fildes �� �������� ���������� ������������ ��������� �����.
[ENOTTY]
�������� fildes �� ������ � �����������, ������� �������� ������������ ����������� �������.
[EINTR]
�� ����� ���������� ���������� ������ ���������� ������.

��������� ����� ioctl ����� ����������� ��������, ���� ������� ���������� ��������� ������. � ���� ������ ������ ������������ ��������� ������� ��� ���������. ���������� ������� ����� ������������ �� ��� ������ �� ������������� ����:

[EFAULT]
�������� command ������� ������ ������� � �������, ��������� � ������� ��������� arg, �� ��� ����� ��� ��� ����� ��������� �� ��������� ����������� �������� ��������� ������������.
[EINVAL]
�������� ���������� command ��� arg ����������� ��� ������� ����������.
[EIO]
���������� ������ �����/������.
[ENXIO]
�������� ���������� command ��� arg ��������� ��� ������� ��������, �� ��� ������ ����������� ��������� ������ �� ����� ���� ��������.
[ENOLINK]
�������� fildes �������� ������������ ����� �� ��������� ����������, ����� � ������� � ������ ������ ���.
������ ��������������� ������� � streamio(7).

��. �����
streamio(7), termio(7) � ����������� ��������������.

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