home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / mq_open.z / mq_open
Encoding:
Text File  |  2002-10-03  |  10.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4. mmmmqqqq____ooooppppeeeennnn((((3333cccc))))                                                        mmmmqqqq____ooooppppeeeennnn((((3333cccc))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _mmmm_qqqq______oooo_pppp_eeee_nnnn - open/create a message queue
  10.  
  11. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_mmmm_qqqq_uuuu_eeee_uuuu_eeee_...._hhhh_>>>>
  13.  
  14.      _mmmm_qqqq_dddd______tttt _mmmm_qqqq______oooo_pppp_eeee_nnnn _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_m_q__n_a_m_e_,,,, _iiii_nnnn_tttt _o_f_l_a_g_,,,, _...._...._.... _////_**** _mmmm_oooo_dddd_eeee______tttt _m_o_d_e_,,,, _ssss_tttt_rrrr_uuuu_cccc_tttt
  15.      _mmmm_qqqq______aaaa_tttt_tttt_rrrr _****_m_q__a_t_t_r _****_////_))));
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _mmmm_qqqq______oooo_pppp_eeee_nnnn is used to open or to create and open a message queue. It returns
  19.      a message queue descriptor that is used as the handle for other
  20.      operations on the queue. _m_q__n_a_m_e points to a path name that is
  21.      constructed using the standard filename conventions.
  22.  
  23.      The _o_f_l_a_g argument is used to specify send, receive or send/receive
  24.      access to the queue.  It is also used to specify creation of the queue.
  25.      The following _o_f_l_a_g_s may be selected (the first three flags are mutually
  26.      exclusive):
  27.  
  28.      _OOOO______RRRR_DDDD_OOOO_NNNN_LLLL_YYYY     Open the queue for receiving messages, but not for sending
  29.                   messages.
  30.  
  31.      _OOOO______WWWW_RRRR_OOOO_NNNN_LLLL_YYYY     Open the queue for sending messages, but not for receiving
  32.                   messages.
  33.  
  34.      _OOOO______RRRR_DDDD_WWWW_RRRR       Open the queue for both sending and receiving messages.
  35.  
  36.      _OOOO______NNNN_OOOO_NNNN_BBBB_LLLL_OOOO_CCCC_KKKK   Do not block on _mmmm_qqqq______ssss_eeee_nnnn_dddd when sending messages to a full
  37.                   queue (or if required resources are unavailable) or on
  38.                   _mmmm_qqqq______rrrr_eeee_cccc_eeee_iiii_vvvv_eeee when receiving messages from a empty queue (or if
  39.                   required resources are unavailable).  [see _mmmm_qqqq______ssss_eeee_nnnn_dddd(3c) and
  40.                   _mmmm_qqqq______rrrr_eeee_cccc_eeee_iiii_vvvv_eeee(3c)].
  41.  
  42.      _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT      Create the message queue.  If the message queue exists, this
  43.                   flag has no effect, except as noted under _OOOO______EEEE_XXXX_CCCC_LLLL below.
  44.                   Otherwise, the third argument, _m_o_d_e and the fourth argument
  45.                   _m_q__a_t_t_r are used to create the message queue. The uid and
  46.                   gid of the queue are set to the effective uid and gid,
  47.                   respectively, of the process. The mode for the queue is set
  48.                   to the value of the _m_o_d_e argument, similar to that for file
  49.                   creation. The mode of queue specifies the read and write
  50.                   (corresponding to receive and send) permission for user,
  51.                   group and the world. The queue is created according to the
  52.                   specifications in the fourth argument, _m_q__a_t_t_r. If this
  53.                   argument is non-NULL, the _m_q__m_s_g_s_i_z_e field of the _m_q__a_t_t_r
  54.                   structure specifies the maximum size of a single message in
  55.                   the queue. Messages larger than this size sent to the queue
  56.                   will generate an error. The _m_q__m_a_x_m_s_g field specifies the
  57.                   maximum number of messages on the queue at any one time.  If
  58.                   the _m_q__a_t_t_r argument is NULL, the queue is created using the
  59.                   default values of 32 and 64 for _m_q__m_a_x_m_s_g and _m_q__m_s_g_s_i_z_e,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmqqqq____ooooppppeeeennnn((((3333cccc))))                                                        mmmmqqqq____ooooppppeeeennnn((((3333cccc))))
  71.  
  72.  
  73.  
  74.                   respectively.
  75.  
  76.      _OOOO______EEEE_XXXX_CCCC_LLLL       If _OOOO______EEEE_XXXX_CCCC_LLLL and _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT are set, _mmmm_qqqq______oooo_pppp_eeee_nnnn will fail if the
  77.                   queue exists. The check for the existence of the file and
  78.                   the creation of the queue if it does not exist is atomic
  79.                   with respect to other processes executing _mmmm_qqqq______oooo_pppp_eeee_nnnn with the
  80.                   same name in the same directory with _OOOO______EEEE_XXXX_CCCC_LLLL and _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT set.
  81.  
  82.      When a new message queue is created, the queue is void of messages.
  83.      Opening an existing message queue has no effect on its contents.
  84.  
  85.      Message queue state is preserved across application termination, but the
  86.      contents of a queue after system reboot are undefined.
  87.  
  88.      POSIX message queues are compatible across all MIPS ABIs: o32, n32 and
  89.      64.
  90.  
  91.      _mmmm_qqqq______oooo_pppp_eeee_nnnn will fail if one or more of the following conditions are true:
  92.  
  93.      [EACCES]       The message queue does not exist and permission to create
  94.                     the queue is denied.
  95.  
  96.      [EACCES]       The message queue exists, but the permissions in oflag are
  97.                     denied.
  98.  
  99.      [EACCES]       A component of _m_q__n_a_m_e has no search permission or does
  100.                     not exist.
  101.  
  102.      [EEXIST]       _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT and _OOOO______EEEE_XXXX_CCCC_LLLL are set, and the message queue exists.
  103.  
  104.      [EFAULT]       _m_q__n_a_m_e points outside the allocated address space of the
  105.                     process.
  106.  
  107.      [EINTR]        A signal interrupted the _mmmm_qqqq______oooo_pppp_eeee_nnnn function call.
  108.  
  109.      [EINVAL]       The values of _m_q__m_s_g_s_i_z_e and _m_q__m_a_x_m_s_g fields in the
  110.                     mq_attr structure are outside the valid range. Invalid
  111.                     flags specified in the _o_f_l_a_g argument.
  112.  
  113.      [EMFILE]       The process has too many open files or message queues[see
  114.                     _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  115.  
  116.      [ENAMETOOLONG] The length of the _m_q__n_a_m_e argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or
  117.                     the length of a _m_q__n_a_m_e component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while
  118.                     {______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC} is in effect.
  119.  
  120.      [ENFILE]       There are too many files and/or message queues in the
  121.                     system.
  122.  
  123.      [ENOENT]       _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is not set and the named queue does not exist.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. mmmmqqqq____ooooppppeeeennnn((((3333cccc))))                                                        mmmmqqqq____ooooppppeeeennnn((((3333cccc))))
  137.  
  138.  
  139.  
  140.      [ENOENT]       _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is set and a component of the _m_q__n_a_m_e does not
  141.                     exist or is not directory.
  142.  
  143.      [ENOMEM]       The system is unable to allocate a message queue
  144.                     descriptor.
  145.  
  146.      [ENOSPC]       _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is set, the message queue does not exist and the
  147.                     system cannot create the queue due to lack of resources.
  148.  
  149. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  150.      _mmmm_qqqq______cccc_llll_oooo_ssss_eeee(3c), _oooo_pppp_eeee_nnnn(3c), _gggg_eeee_tttt_dddd_tttt_aaaa_bbbb_llll_eeee_ssss_iiii_zzzz_eeee(2), _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2), _iiii_nnnn_tttt_rrrr_oooo(3c),
  151.      _mmmm_qqqq______rrrr_eeee_cccc_eeee_iiii_vvvv_eeee(3c), _mmmm_qqqq______ssss_eeee_nnnn_dddd(3c), _mmmm_qqqq______gggg_eeee_tttt_aaaa_tttt_tttt_rrrr(3c), _mmmm_qqqq______ssss_eeee_tttt_aaaa_tttt_tttt_rrrr(3c),
  152.      _mmmm_qqqq______nnnn_oooo_tttt_iiii_ffff_yyyy(3c), _uuuu_mmmm_aaaa_ssss_kkkk(2)
  153.  
  154. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  155.      Upon successful completion, the message queue descriptor is returned.
  156.      Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the
  157.      error.
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.