unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (HP-UX-11.11)
Page:
Section:
Apropos / Subsearch:
optional field



 mq_send(2)							  mq_send(2)




 NAME
      mq_send - send a message to a message queue

 SYNOPSIS
      #include <&lt&lt&lt;sys/mqueue.h>&gt&gt&gt;

      int mq_send(mqd_t	       mqdes,
		  const char   *msg_ptr,
		  size_t       msg_len,
		  unsigned int msg_prio
      );

 DESCRIPTION
      The mq_send() system call adds a message pointed to by the argument
      msg_ptr to the message queue specified by mqdes.	The msg_len argument
      specifies the length of the message in bytes. The value of msg_len
      should be less than or equal to the mq_msgsize attribute of the
      message queue, or mq_send() will fail.

      If the specified message queue is not full, mq_send() will insert the
      message into the queue at the position indicated by the msg_prio
      argument. A message with priority, msg_prio, will be inserted behind
      any other messages with larger or equal priority.	 The value of
      msg_prio should be less than MQ_PRIO_MAX.

      If the specified message queue is full and the O_NONBLOCK flag is not
      set in the message queue blocking status associated with mqdes,
      mq_send() will block in priority order, until it can send a message on
      the queue, or until mq_send() is interrupted by a signal.	 If the
      specified message queue is full and the O_NONBLOCK flag is set in the
      message queue blocking status associated with mqdes, the message will
      not be enqueued, and mq_send() will return with an error.

 RETURN VALUE
      mq_send() returns the following values:

	   0	Successful completion. The message is enqueued.

	   -1	Failure.  errno is set to indicate the error and the message
		is not enqueued.

 ERRORS
      If mq_send() fails, errno is set to one of the following values:

	   [EAGAIN]	  The O_NONBLOCK flag is set in the message queue
			  blocking status associated with mqdes, and the
			  message queue is full.

	   [EBADF]	  mqdes is not a valid message queue descriptor open
			  for writing.




 Hewlett-Packard Company	    - 1 -   HP-UX Release 11i: November 2000






 mq_send(2)							  mq_send(2)




	   [EINTR]	  A signal interrupted the call to mq_send().

	   [EINVAL]	  msg_ptr points to an invalid address, or the value
			  of msg_prio is outside the valid range.

	   [EMSGSIZE]	  The specified message length, msg_len, exceeds the
			  message size attribute of the message queue.

	   [ENOSYS]	  mq_send() is not supported by the implementation.

 SEE ALSO
      mq_receive(2), mq_setattr(2), mq_getattr(2).

 STANDARDS CONFORMANCE
      mq_send(): POSIX 1003.1b







































 Hewlett-Packard Company	    - 2 -   HP-UX Release 11i: November 2000