|
��������
shmop - �������� ��� ������������ ���������� ������
���������
#include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> char *shmat (shmid, shmaddr, shmflg) int shmid; char *shmaddr; int shmflg; int shmdt (shmaddr) char *shmaddr;
��������
������������� ��������
��������� ����� shmat (��. ��������) ������������ ����������� ������� ������, ��������������� � ��������������� shmid, � �������� ������ ����������� ��������.
������� �������������� �� ������, ��������� ����� ��
��������� ��������:
������������ ��������
��������� ����� shmdt ����������� ����������� �������
������, ������������� �� ������ shmaddr, �� ��������
������ ����������� ��������.
���� ��������� (shmflg & SHM_RDONLY) �������, �� ������� �������������� ��� ������ {��������� ����� �� ������}, � ��������� ������ ������� �������������� ��� ������ � ������ {��������� ����� �� ������ � ������}.
��������� ����� shmat ����������� �������� � ����������� ������� �� ��������������, ���� ��������� ���� �� ���� �� ��������� �������:
��������� ����� shmdt ����������� �������� � ����������� ������� �� �������������, ����:
��. �����
exec(2), exit(2), fork(2), intro(2), shmctl(2),
shmget(2).
�����������
��� �������� ���������� ���������� ������ shmat ������������ ��������� ����� ��������������� ��������.
��� �������� ���������� ���������� ������ shmdt ��������� ����� 0.
� ������ ������ ������������ -1, � ���������� errno ������������� ��� ������.
����������
���������� ���� ������� ����������� ������� ������ ����� ����, ��� ��������� ��������� ������ �� ����.
��������
� ������ ���������� ��������� ���������� ������ shmat
����� ��� int, � �� char *.
|