SrrProxyAttach

SrrProxyAttach — creates a proxy message for a process.

Syntax

#include <srripc.h>
pid_t SrrProxyAttach(pid_t  pid,
 char*  data,
 int  nbytes,
 int  priority);

Arguments

pid

The process ID of the task to receive the message. If set to 0, the proxy is attached to the calling process.

data

The message data.

nbytes

The message size.

priority

The priority of the proxy. If set to -1, the proxy priority is the same as the calling process.

Returns

The process ID of the proxy, else -1.

Description

This function creates a message proxy that will deliver a standard message to a task whenever it is called. The proxy will accept any message from any other task, but will always send its one message to the task identified with pid. The sending process will not block, and its message data will be discarded by the proxy.

Proxies are used to wake up receive-blocked processes that are waiting for messages. They can also be used to send non-blocking messages between processes. Proxy messages are queued, so if a proxy is triggered 95 times, its receiving task will get 95 identical messages. A proxy may have at most 65535 messages pending.

Errors

    EAGAIN  No process entries free to make a proxy.

    EINVAL  The proxy message exceeds the maximum size.

    ENOMEM  The kernel doesn't have enough memory to hold the message.

    ESRCH  The process ID (pid) does not exist.

See Also

SrrProxyDetach