AT&T UNIX™PC Unix System V Users Manual - tenox
AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox
MSGOP ( 2) MSGOP (2) the calling process resumes execution in the manner prescribed in signal(2)). Msgsnd will fail and no message will be sent if one or more of the following are true: Ms qid is not a valid message queue identifier. [EINV AL] Operation permission is denied to the calling process (see intro(2)). [EACCESJ Mtype is less than 1. [EINVALJ The message cannot be sent for one of the reasons cited above and (msgflg & IPC_NOWAIT) is "true". [EAGAINJ Msgsz is less than zero or greater than the system imposed limi�. [EINVALJ Msgp points to an illegal address. [EF AUL TJ Upon successful completion, the following actions are taken with respect to the data structure associated with msqid (see intro (2)). Msg_qnum is incremented by 1. Msg_lspid is set equal to the process ID of the calling process. Msg_stime is set equal to the current time. Msgrcv reads a message from the queue associated with the message queue identifier specified by msqid and places it in the structure pointed to by msgp . {READ} This structure is composed of the following members: long mtype; char mtext[]; I* message type *I I* message text *I Mtype is the received message's type as specified by the sending process. Mtext is the text of the message. Msgsz specifies the size in bytes of mtext. The received message is truncated to msgsz bytes if it is larger than msgsz and (msgflg & MSG_NOERROR) is "true"- The truncated part of the message is lost and no indication of the truncation is given to the calling process. Msgtyp specifies the type of message requested as follows: If msgtyp is equal to 0, the first message on the queue is received. If msgtyp is greater than 0, the first message of type msgtyp is received. If msgtyp is less than 0, the first message of the lowest type that is less than or equal to the absolute value of · msgtyp is received. Msgflg specifies the action to be taken if a message of the desired type is not on the queue. These are as follows: If (msgflg & IPC_NOWAIT) is "true", the calling process will return immediately with a return value of -1 and errno set to ENOMSG. - 2- '"""" " )
� I MSGOP {2) MSGOP {2) If (msgftg & IPC_NOWAIT) is "false", the calling process will suspend execution until one of the following occurs: A message of the desired type is placed on the queue. Msqid is removed from the system. When this occurs, errno is set equal to EIDRM, and a value of -1 is returned. The calling process receives a signal that is to be caught. In this case a message is not received and the calling process resumes execution in the manner prescribed in signal(2)). Msgrcv will fail and no message will be received if one or more of the following are true: Msqid is not a valid message queue identifier. ]EINV AL] Operation permission is denied to the calling process. ]EACCES] Msgsz is less than 0. ]EINV AL] Mtext is greater than msgsz and ( msgftg & MSG_NOERROR) is "false". ]E2BIG] The queue does not contain a message of the desired type and ( msgtyp & IPC_NOW AIT) is "true". ]ENOMSGJ Msgp points to an illegal address. ]EFAULT] Upon successful completion, the following actions are taken with respect to the data structure associated with msqid (see intro (2)). Msg_qnum is decremented by 1. Msg_lrpid is set equal to the process ID of the calling process. Msg_rtime is set equal to the current time. RETURN VALUES If msgsnd or msgrcv return due to the receipt of a signal, a value of -1 is returned to the calling process and errno is set to EINTR. If they return due to removal of msqid from the system, a value of - 1 is returned and errno is set to EIDRM. Upon successful completion, the return value is as follows: Msgsnd returns a value of 0. Msgrcv returns a value equal to the number of bytes actually placed into mtext. Otherwise, a value of -1 is returned and errno is set to indicate the error. SEE ALSO msgct1(2), msgget(2), stdipc(3C). - 3-
- Page 661 and 662: ALARM (2) ALARM (2) NAME alarm - se
- Page 663: BRK(2) BRK ( 2 ) NAME brk, sbrk - c
- Page 667 and 668: CHMOD (2) CHMOD (2) NAME chmod - ch
- Page 669: CHOWN(2) CHOWN(2) NAME chown - chan
- Page 673 and 674: CLOSE ( 2) CLOSE (2) NAME close - c
- Page 675 and 676: CREAT ( 2 ) CREAT ( 2 ) NAME creat
- Page 677 and 678: DUP (2) DUP (2) NAME dup - duplicat
- Page 679 and 680: EXEC (2) EXEC (2) NAME execl, execv
- Page 681: EXEC (2) EXEC (2) Search perm1ss10n
- Page 684 and 685: EXIT (2) EXIT (2) WARNING See WARNI
- Page 686 and 687: FCNTL (2) FCNTL (2) immediately wit
- Page 689 and 690: FORK(2) FORK(2) NAME fork - create
- Page 691: GETPID ( 2} GETPID (2) NAME getpid,
- Page 694 and 695: I I I I I I I I I I I I I I I I I I
- Page 696 and 697: �-
- Page 699: LINK ( 2 ) LINK ( 2 ) NAME link - l
- Page 703 and 704: MKNOD (2) MKNOD (2) NAME mknod - ma
- Page 705: MOUNT (2) MOUNT (2) NAME mount - mo
- Page 708 and 709: MSGCTL(2) MSGCTL ( 2 ) user ID of t
- Page 710 and 711: MSGGET (2) MSGGET (2) SEE ALSO msgc
- Page 714 and 715: If)
- Page 717 and 718: OPEN ( 2 ) OPEN ( 2 ) NAME open - o
- Page 719: OPEN(2) OPEN(2) O_NDELAY is set, th
- Page 722 and 723: I�
- Page 725 and 726: PLOCK(2) PLOCK(2) NAME plock - lock
- Page 727: PROFIL ( 2 ) PROFIL ( 2 ) NAME prof
- Page 730 and 731: PTRACE (2) PTRACE (2) 4, 5 With the
- Page 732 and 733: (� �--- .
- Page 735 and 736: SEMCTL ( 2 ) SEMCTL ( 2 ) NAME semc
- Page 737 and 738: SEMGET (2) SEMGET (2) NAME semget -
- Page 739 and 740: SEMOP ( 2) SEMOP {2) NAME semop - s
- Page 741 and 742: SEMOP (2) SEMOP (2) Operation permi
- Page 743: SETPGRP (2) SETPGRP (2) NAME setpgr
- Page 747 and 748: SHMCTL (2) SHMCTL (2) NAME shmctl -
- Page 749 and 750: � ! SHMGET (2) SHMGET (2) NAME sh
- Page 751 and 752: SHMOP ( 2 ) SHMOP ( 2 ) NAME shmop
- Page 753 and 754: SIGNAL (2) SIGNAL (2) NAME signal -
- Page 755 and 756: SIGNAL (2) SIGNAL (2) Sig is an ill
- Page 757 and 758: STAT ( 2 ) STAT ( 2 ) NAME stat, fs
- Page 759 and 760: STIME(2) STIME(2) NAME stime - set
- Page 761 and 762: SYNC ( 2) SYNC (2) NAME sync - upda
�<br />
I<br />
MSGOP {2) MSGOP {2)<br />
If (msgftg & IPC_NOWAIT) is "false", the calling process<br />
will suspend execution until one of the following occurs:<br />
A message of the desired type is placed on the<br />
queue.<br />
Msqid is removed from the system. When this<br />
occurs, errno is set equal to EIDRM, and a value<br />
of -1 is returned.<br />
The calling process receives a signal that is to be<br />
caught. In this case a message is not received<br />
and the calling process resumes execution in the<br />
manner prescribed in signal(2)).<br />
Msgrcv will fail and no message will be received if one or more of<br />
the following are true:<br />
Msqid is not a valid message queue identifier. ]EINV AL]<br />
Operation permission is denied to the calling process.<br />
]EACCES]<br />
Msgsz is less than 0. ]EINV AL]<br />
Mtext is greater than msgsz and ( msgftg &<br />
MSG_NOERROR) is "false". ]E2BIG]<br />
The queue does not contain a message of the desired type<br />
and ( msgtyp & IPC_NOW AIT) is "true". ]ENOMSGJ<br />
Msgp points to an illegal address. ]EFAULT]<br />
Upon successful completion, the following actions are taken with<br />
respect to the data structure associated with msqid (see intro (2)).<br />
Msg_qnum is decremented by 1.<br />
Msg_lrpid is set equal to the process ID of the calling<br />
process.<br />
Msg_rtime is set equal to the current time.<br />
RETURN VALUES<br />
If msgsnd or msgrcv return due to the receipt of a signal, a value<br />
of -1 is returned to the calling process and errno is set to EINTR.<br />
If they return due to removal of msqid from the system, a value of<br />
- 1 is returned and errno is set to EIDRM.<br />
Upon successful completion, the return value is as follows:<br />
Msgsnd returns a value of 0.<br />
Msgrcv returns a value equal to the number of bytes actually<br />
placed into mtext.<br />
Otherwise, a value of -1 is returned and errno is set to indicate<br />
the error.<br />
SEE ALSO<br />
msgct1(2), msgget(2), stdipc(3C).<br />
- 3-