������� ������������ / ������ "������������ ��� Linux" / ���������� ���������
next up previous contents index
Next: ���������-������ Up: ���������� ���������� Previous: ���������� ����������   Contents   Index

������������� semctl

� ���������� ������ semctl ��������� ������� ���������� ������ ������ ���:

        #include <sys/types.h>
        #include <sys/ipc.h>
        #include <sys/sem.h>

        int semctl (semid, semnum, cmd, arg)
        int semid, cmd;
        int semnum;
        union semun {
          int val;
          struct semid_ds *buf;
          ushort *array;
        } arg;
��������� ���������� ������ semctl � ������ ��������� ���������� ������� �� ������������ ������������ ��������. ��� ������� �� ����� 0, �� ������ �������� (GETVAL, GETPID, GETNCNT � GETZCNT) �������� ������������. ��� ������������� ������ ������ ������������ -1.

��������� semid � semnum ���������� ��������� ��� ��������� �������, ��� ������� ����������� ����������� ��������. � �������� ��������� semid ������ ��������� ������������� ��������� ���������, �������������� ���������� ��� ������ ���������� ������ semget. �������� semnum ������ ����� �������� � ���������. �������� ���������� � ����.

���������� ��������� arg ������� �� ������������ ��������, ������� ������������ ��������� ��������� cmd. ��������� ��������� ��������:

GETVAL

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

SETVAL

���������� �������� �������� ������ arg.val.

GETPID

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

GETNCNT

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

GETZCNT

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

GETALL

��������� �������� ���� ��������� ��������� � ��������� �� � ������, �� ������� ��������� arg.array.

SETALL

���������� �������� ���� ��������� ��������� ������� ��������� ��������� �������, �� ������� ��������� arg.array.

IPC_STAT

��������� ���������� � ��������� ��������� ���������, ������������ � ��������� ������, ��������������� � ��������������� semid, � ���������������� ���������, �� ������� ��������� arg.buf.

IPC_SET

� ��������� ������, ��������������� � ��������������� semid, �������������� �������� ����������� ��������������� ������������ � ������, � ����� ���� �� ��������. ������ �������� ����������� �� ��������� ������, �� ������� ��������� arg.buf.

IPC_RMID

������� �� ������� ������������� semid, ������������� ��������� ��������� � ��������������� � ��� ��������� ������.

����� ��������� ����������� �������� IPC_SET ��� IPC_RMID, ������� ������ ����� ����������� ������������� ������������, ������ ���� ��������������� ��������� ��� ��������� �������, ���� �������������� �����������������. ��� ���������� ����������� �������� SETVAL � SETALL ��������� ����� �� ���������, � ��� ���������� ��������� �������� - ����� �� ������.



Alex Otwagin 2002-12-16



������:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
�������:

�������� �� �����
���������� �� ���������
Created 1996-2026 by Maxim Chirkov
��������, ����������, ����������