RV_IBC_RECEIVE

This ioctl can only be issued against a Secondary RVG with a valid key obtained from the RV_IBC_REGISTER ioctl. The ioctl receives an IBC message sent from the Primary RVG. At the time of receipt, Secondary replication is frozen. The state of the data volumes on the Secondary is the same as that on the Primary at the time the IBC message was sent. Secondary replication remains frozen until an RV_IBC_UNFREEZE ioctl is issued against the Secondary RVG, or the freeze_timeout specified when the IBC message was sent expires, or the deliver_timeout specified when the application name was registered for the Primary RVG expires and the receive operation has not been performed.

The ioctl argument structure for the RV_IBC_RECEIVE command is:

    struct ibc_receive_args {
        ibc_appid_t     application_id;
        int             flags;
        ibc_timeout_t   timeout;
        int             drop_count; 
        caddr_t         msg_buf;
        size_t          buf_len;
        size_t          msg_len; 
};

Argument application_id is the key returned by the RV_IBC_REGISTER ioctl. A registration must be done before the RV_IBC_RECEIVE ioctl can be used.

Argument flags may specify IBC_BLOCK. If this flag is set, the ioctl will block until an IBC message is available to receive. If IBC_BLOCK is not set, the ioctl returns with an error if no IBC message is available.

Argument timeout specifies a time-out value in seconds to block waiting for an IBC message if flag IBC_BLOCK is set. When the time-out has expired, the ioctl returns with an error. A time-out of zero is used to specify no time-out. If you set IBC_FREEZE flag, indicates that a freeze timeout is enforced.

Value drop_count is returned by the ioctl. This value contains the number of messages that have been dropped due to delivery time-outs. If drop_count is non-zero, no message is returned and the ioctl returns an error.

Argument msg_buf is a pointer to a buffer to receive the IBC message.

Argument buf_len is the length, in bytes, of the msg_buf.

Value msg_len is returned by the ioctl and specifies the length in bytes of the IBC message. The maximum IBC message length is 128K bytes. If msg_len is greater than buf_len, the IBC message is truncated to buf_len bytes and no error is indicated.

On failure, possible values returned in errno are:

EIBC_NO_APPLICATION

Argument application_id is not valid.

ENOMSG

IBC messages have been dropped due to delivery time-out, or if no IBC message was available.