| |
� ���������� ������ shmctl ��������� ������� ���������� ������ ������ ���:
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int shmctl (shmid, cmd, buf)
int shmid, cmd;
struct shmid_ds *buf;
��� �������� ���������� ��������� ����� ����; � ������ �������
������������ -1.
� �������� ��������� shmid ������ ��������� ������������� ������������ �������� ������, �������������� ���������� ��� ������ ���������� ������ shmget.
����������� �������� ������������ ��������� ��������� cmd. ��������� ��������� ��������:
IPC_STAT
��������� ���������� � ��������� ������������ ��������, ������������ � ��������� ������, ��������������� � ��������������� shmid, � ���������������� ���������, �� ������� ��������� �������� buf.
IPC_SET
� ��������� ������, ��������������� � ��������������� shmid, �������������� �������� ����������� ��������������� ������������ � ������, � ����� ���� �� ��������. ������ �������� ����������� �� ��������� ������, �� ������� ��������� �������� buf.
IPC_RMID
������� �� ������� ������������� shmid, ������������� ����������� ������� ������ � ��������������� � ��� ��������� ������.
SHM_LOCK
���������� � ������ ����������� �������, �������� ��������������� shmid.
SHM_UNLOCK
���������� (��������� ���������� � ������) ����������� �������, �������� ��������������� shmid.