NAME
irReturn - return channel to parent process or default owner
SYNOPSIS
#include <irapi.h>
int irReturn (channel_id cid, int value, int tag);
DESCRIPTION
The function irReturn returns ownership the channel referred
to by channel identifier cid to either the parent process or
the default owner. The parent process is defined as the
most recent process to call irSubProg(3IRAPI) on the chan-
nel. If a parent process exists, the return of ownership to
the parent will preserve the service state, resource alloca-
tions and save-on-exec parameter values established by the
current process. If no parent process exists, the channel
will be released to the default owner in a manner analogous
to irDeinit(3IRAPI).
If the IRE_DEINIT_DONE event is set for notification, via
irSetEvent(3IRAPI), then an IRE_DEINIT_DONE event is
returned to the application with tag set to the tag value
passed to irReturn(3IRAPI).
Transient applications must call:
(void) irSetEvent(cid, IRE_DEINIT_DONE, IRF_NOTIFY);
and wait for the subsequent IRE_DEINIT_DONE event before
exiting, otherwise a CGEN_DEFOWN alarm may be generated.
EVENTS
The event IRE_RETURN is posted to the parent process if one
exists. event_mod1 contains the value argument specified by
the child calling irReturn and the tag for IRE_RETURN is the
tag passed to irSubProg(3IRAPI) by the parent process.
RETURN VALUE
IRR_OK is returned on success.
IRR_FAIL is returned on error.
ERROR
irError is set as follows on error:
IRER_INVALID if cid is invalid
IRER_SYSERROR if a driver call or system call failure occurs
(see irSysError for additional information)
SEE ALSO
irDeinit(3IRAPI), irSetEvent(3IRAPI), irSubProg(3IRAPI),
VERSION
This is version 11/25/02 of this man page.