Annotation of coherent/a/usr/man/COHERENT/msgrcv, revision 1.1.1.1

1.1       root        1: 
                      2: 
                      3: msgrcv()               COHERENT System Call              msgrcv()
                      4: 
                      5: 
                      6: 
                      7: 
                      8: Receive a message
                      9: 
                     10: #include <sys/msg.h>
                     11: mmssggrrccvv(_m_s_q_i_d, _m_s_g_p, _m_s_g_s_z, _m_s_g_t_y_p, _m_s_g_f_l_g)
                     12: iinntt _m_s_q_i_d, _m_s_g_s_z, _m_s_g_f_l_g; ssttrruucctt mmssggbbuuff *_m_s_g_p; lloonngg _m_s_g_t_y_p;
                     13: 
                     14: msgrcv reads  a message from the queue  associated with the queue
                     15: identifier msqid  and writes  it in  the structure pointed  to by
                     16: msgp.  This structure consists of the following members:
                     17: 
                     18: 
                     19: long mtype;    /* message type */
                     20: char mtext[];  /* message text */
                     21: 
                     22: 
                     23: mtype is the received message's type, as specified by the sending
                     24: process.  mtext is the text of the message.  msgsz gives the size
                     25: of mtext,  in bytes.  The received message  is truncated to msgsz
                     26: bytes if  it is larger  than msgsz and (_m_s_g_f_l_g  & MMSSGG_NNOOEERRRROORR) is
                     27: true.  The truncated portion of  the message is lost, with no in-
                     28: dication given to the calling process.
                     29: 
                     30: msgtyp specifies the type of message requested, as follows:
                     31: 
                     32: *   If  msgtyp equals  0L,  the  first message  on  the queue  is
                     33:    received.
                     34: 
                     35: *  If msgtyp is greater than 0L, the first message of type msgtyp
                     36:    is received.
                     37: 
                     38: *  If  msgtyp is less  than 0L, the  first message of  the lowest
                     39:    type  that is  less than  or  equal to  the absolute  value of
                     40:    msgtyp is received.
                     41: 
                     42: msgflg specifies  the action  taken if  a message of  the desired
                     43: type is not on the queue, as follows:
                     44: 
                     45: *   If (_m_s_g_f_l_g  & IIPPCC_NNOOWWAAIITT)  is true,  the calling  process im-
                     46:    mediately returns -1 and sets errno to ENOMSG.
                     47: 
                     48: *   If  (_m_s_g_f_l_g  &  IIPPCC_NNOOWWAAIITT)  is  false, the  calling  process
                     49:    suspends execution until one of the following occurs:
                     50: 
                     51: 11. A message of the desired type is placed on the queue.
                     52: 
                     53: 22. msqid  is removed from  the system.  When  this occurs, msgrcv
                     54:    sets errno to EDOM
                     55: 
                     56: 33. The  calling process receives  a signal that is  to be caught.
                     57:    In  this  case, a  message  is not  received  and the  calling
                     58:    process resumes execution in the manner prescribed in signal.
                     59: 
                     60: msgrcv fails  and no message is received if  any of the following
                     61: is true:
                     62: 
                     63: 
                     64: COHERENT Lexicon                                           Page 1
                     65: 
                     66: 
                     67: 
                     68: 
                     69: msgrcv()               COHERENT System Call              msgrcv()
                     70: 
                     71: 
                     72: 
                     73: 
                     74: *  msqid  is not a valid message  queue identifier.  msgrcv errno
                     75:    to EINVAL.
                     76: 
                     77: *   Operation  permission   is  denied  to  the  calling  process
                     78:    (EEAACCCCEESS).
                     79: 
                     80: *  msgsz is less than zero (EEIINNVVAALL).
                     81: 
                     82: *   mtext is  greater than  msgsz and  (_m_s_g_f_l_g &  MMSSGG_NNOOEERRRROORR) is
                     83:    false (EE22BBIIGG).
                     84: 
                     85: *  The queue  does not contain a message of  the desired type and
                     86:    (_m_s_g_t_y_p & IIPPCC_NNOOWWAAIITT) is true (EENNOOMMSSGG).
                     87: 
                     88: *  msgp points to an illegal address (EEFFAAUULLTT).
                     89: 
                     90: Upon successful completion,  the following actions are taken with
                     91: respect to the data structure associated with msqid:
                     92: 
                     93: *  msg_qnum is decremented by one.
                     94: 
                     95: *   msg_lrpid  is set  equal  to the  process  identifier of  the
                     96:    calling process.
                     97: 
                     98: *  msg_rtime is set equal to the current time.
                     99: 
                    100: ***** Return Values *****
                    101: 
                    102: If msgrcv returns  due to the receipt of a  signal, it returns -1
                    103: and sets  errno to EINTR.   If it returns  due to the  removal of
                    104: msqid  from the  system, it  returns -1 and  sets errno  to EDOM.
                    105: Upon successful  completion, msgrcv returns a  value equal to the
                    106: number of bytes written into mtext.  Otherwise, it returns -1 and
                    107: sets errno to an appropriate value.
                    108: 
                    109: ***** Files *****
                    110: 
                    111: /usr/include/sys/ipc.h
                    112: /usr/include/sys/msg.h
                    113: /dev/msg
                    114: 
                    115: ***** See Also *****
                    116: 
                    117: COHERENT system calls, msg, msgctl(), msgget(), msgsnd()
                    118: 
                    119: ***** Notes *****
                    120: 
                    121: To improve portability, the COHERENT system implements the mmssgg as
                    122: a device driver rather than as an actual system call.
                    123: 
                    124: 
                    125: 
                    126: 
                    127: 
                    128: 
                    129: 
                    130: COHERENT Lexicon                                           Page 2
                    131: 
                    132: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.