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

MSGGET(3)
XENIX System V (21 ���� 1987)

���
msgget - co��ae� o�epe�� coo��e���

���������

	#include <sys/types.h>
	#include <sys/ipc.h>
	#include <sys/msg.h>
	
	int msgget (key, msgflg)
	key_t key;
	int msgflg;

��������
msgget ��� �a�a��o�o key �o��pa�ae� ��e������a�op o�epe�� coo��e���.

��e������a�op o�epe�� coo��e���, c���a���e c ��� o�epe�� � c�py��ypa �a���x (c�. intro(3)) co��a��c� ��� �a��o�o key, ec�� ���o���e�c� o��o �� c�e�y���x yc�o���:

     key pa�e� IPC_PRIVATE.
	
     key �e ��ee� c���a��o�o c ��� ��e������a�opa o�epe��
     coo��e��� � (msgflg&IPC_CREAT) o�����o o� �y��.

�o�� c�py��yp� �a���x, c���a��o� c �o��� ��e������a�opo� o�epe�� coo��e���, �����a����py��c� c�e�y���� o�pa�o�:

     msg_perm.cuid � msg_perm.uid yc�a�a����a��c� pa�����
     ���e�����o�y �o���o�a�e��c�o�y ID �e�y�e�o �po�ecca.
     msg_perm.cgid � msg_perm.gid yc�a�a����a��c� pa�����
     ���e�����o�y �py��o�o�y ID �e�y�e�o �po�ecca.
	
     M�a���e 9 ��� msg_perm.mode yc�a�a����a��c� pa�����
     ��a���� 9-�� ���a� msgflg.
	
     msg_qnum, msg_lspid, msg_lrpid � msg_rtime
     yc�a�a����a��c� pa����� 0.
	
     msg_ctime yc�a�a����ae�c� pa���� �e�y�e�y �pe�e��.
	
     msg_qbytes yc�a�a����ae�c� pa���� c�c�e��o�y
     o�pa���e���.

msgget a�ap���o �a�ep�ae�c�, ec�� ���o���e�c� xo�� �� o��o �� c�e�y���x yc�o���:
[EACCES] ��e������a�op o�epe�� coo��e��� cy�ec��ye� ��� key, �o �pa�a, �a�a���e ��a����� 9-�� ���a�� msgflg, �e �o�y� ���� �pe�oc�a��e�� (c�. intro(3)).
[ENOENT] ��e������a�op o�epe�� coo��e��� �e cy�ec��ye� ��� key � (msgflg&IPC_CREAT) pa��o 0.
[ENOSPC] ��e������a�op o�epe�� coo��e��� �e �o�e� ���� co��a� ����y o�pa���e��� �a o��ee ��c�o �a��x ��e������a�opo� � c�c�e�e.
[EEXIST] ��e������a�op o�epe�� coo��e��� cy�ec��ye� ��� key, �o (msgflg&IPC_CREAT)&(msgflg&IPC_EXCL) o�����o o� 0.

BO��PA�AE�OE ��A�E��E
B c�y�ae yc�e��o�o �a�ep�e��� �o��pa�ae�c� ��e������a�op o�epe�� coo��e��� �a� �eo�p��a�e���oe �e�oe ��c�o. ��a�e �o��pa�ae�c� ��a�e��e -1 � � errno �a�oc��c� �o� o�����.

��. �����
intro(3), msgctl(3), msgop(3)

�A�E�A���
�po�pa��a, �c�o���y��a� ��y �y�����, �o���a �o�����po�a��c� c ��a�o� -Me.
Comments: [email protected]
Designed by Andrey Novikov
Copyright © CIT