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

DUP(2)

��������
dup - ������������ ����������� ��������� �����

���������

        int dup (fildes)
        int fildes;

��������
�������� fildes - ��� ���������� �����, ���������� ����� ���������� ��������� ������� creat, open, dup, fcntl � pipe. ��������� ����� dup ���������� ����� ���������� �����, ������� ��������� ����� �������� � �������� ������������:

  1. ��� �� �������� ���� (��� �����).
  2. ��� �� ��������� ������� ������� � ����� (�� ���� ��� ����������� ��������� ���� � ��� �� ���������).
  3. ��� �� ����� ������� (������, ������ ��� ������/������).

����� ���������� ��������� �����, ����� ����� ���������� ��������� ������� exec(2) ���� ��������� �������� [��. fcntl(2)].

������������ ���������� �� ��������� ������������.

��������� ����� dup ����������� ��������, ���� ��������� ���� �� ���� �� ��������� �������:

[EBADF]
�������� fildes �� �������� ���������� ������������ ��������� �����.
[EINTR]
�� ����� ���������� ���������� ������ ���������� ������.
[EMFILE]
����������� ����������� ���������� ���������� ������, �������� ������������ � ����� ��������.
[ENOLINK]
�������� fildes ��������� �� ��������� ���������, ����� � ������� � ������ ������ ���.

��. �����
close(2), creat(2), exec(2), fcntl(2), open(2), pipe(2), lockf(3C).

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