dm_mqueue_open Interface

public interface dm_mqueue_open

Generic message queue open function.


Module Procedures

private function mqueue_open_raw(mqueue, name, max_msg, msg_size, access, mode, create, exclusive, blocking) result(rc)

Opens POSIX message queue of given name.

The function returns the following error codes:

  • E_INVALID if name is empty or starts with /.
  • E_MQUEUE if system call to open the queue failed.

Arguments

Type IntentOptional Attributes Name
type(mqueue_type), intent(out) :: mqueue

Message queue type.

character(len=*), intent(in) :: name

Message queue name (without leading /).

integer, intent(in) :: max_msg

Maximum number of messages in queue.

integer, intent(in) :: msg_size

Message size.

integer, intent(in), optional :: access

Access type (MQUEUE_RDONLY, MQUEUE_WRONLY, MQUEUE_RDWR).

integer, intent(in), optional :: mode

Access permissions.

logical, intent(in), optional :: create

Creates message queue if true.

logical, intent(in), optional :: exclusive

Opens message queue exclusively if true.

logical, intent(in), optional :: blocking

Blocking access if true.

Return Value integer

private function mqueue_open_type(mqueue, type, name, access, blocking) result(rc)

Opens message queue for reading/writing logs or observations (in blocking mode by default).

The function returns the following error codes:

  • E_INVALID if type is invalid, name is empty, or name starts with /.
  • E_MQUEUE if system call to open the queue failed.

Arguments

Type IntentOptional Attributes Name
type(mqueue_type), intent(out) :: mqueue

Message queue type.

integer, intent(in) :: type

Data type (TYPE_LOG, TYPE_OBSERV).

character(len=*), intent(in) :: name

Message queue name (without leading /).

integer, intent(in) :: access

MQUEUE_RDONLY, MQUEUE_WRONLY, MQUEUE_RDWR.

logical, intent(in), optional :: blocking

Blocking access if true.

Return Value integer