NAME
irChDefOwn - change the default owner for a channel
SYNOPSIS
#include <irapi.h>
ir_key_t irChDefOwn (int chan, ir_key_t msgqkey);
DESCRIPTION
irChDefOwn is used to set or change the default owner for a
channel chan. The process that is to become the default
owner is indicated by its message key msgqkey. The message
key for the current process is obtained when calling
irRegister(3IRAPI) and the message key for another process
can be obtained by calling irGetQKey(3IRAPI).
This function is primarily intended for use by maintenance
and application dispatch processes, but can be used by
applications that require an alternate application dispatch
process. The process executing this command does not need
to be the process identified by msgqkey.
The channel will be returned to the default owner whenever
the last owner de-init's the channel by calling
irDeinit(3IRAPI) or irReturn(3IRAPI) or whenever the last
owner exits via exit(2) or by a sudden exit (for example,
dumping core).
This function will not change the current owner of the chan-
nel to the default owner; the new default owner must call
irInit(3IRAPI) itself if it wants to assume ownership for
the channel.
EVENT
No event is generated as a result of a call to irChDefOwn.
RETURN VALUE
If there was a prior default owner, the message key for the
prior default owner is returned. If the msgqkey is nega-
tive, the message key for the current default owner is
returned, but the default owner is not changed. If there
never was a default owner for this channel, or if the
default owner has exited, irChDefOwn returns a zero.
IRR_FAIL is returned if an error occurs.
ERROR
irError is set as follows if an error occurs:
IRER_INVALID if chan is invalid.
IRER_SYSERROR on system or driver call failure (see
irSysError for additional information).
SEE ALSO
irRegister(3IRAPI), irGetQKey(3IRAPI)
VERSION
This is version 8/31/00 of this man page.