![]() Chapter Contents |
![]() Previous |
![]() Next |
| costat |
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| CAUTION | |
| EXAMPLE |
| SYNOPSIS |
#include <coproc.h> int costat(coproc_t id);
| DESCRIPTION |
The
costat
function returns information about the status of a coprocess.
The
id
argument is the
ID of the coprocess whose status is desired.
| RETURN VALUE |
The value returned by
costat
is one of the symbolic constants
STARTING
,
ACTIVE
,
BUSY
,
IDLE
, or
ENDED
. These constants have the
following significance:
STARTING
costart
but
has never been cocalled.
ACTIVE
BUSY
cocall
function. A
BUSY
coprocess cannot be cocalled itself.
IDLE
coreturn
.
The coprocess will not execute again until it is cocalled.
ENDED
| CAUTION |
The effects of passing an invalid coprocess
ID to
costat
are unpredictable.
Usually, this causes the value
ENDED
to be returned.
| EXAMPLE |
#include <stddef.h>
#include <coproc.h>
#include <stdlib.h>
coproc_t err_proc;
/* Cocall the coprocess whose ID is in the variable err_proc. But */
/* abort instead if that coprocess cannot be legally cocalled. */
switch (costat(err_proc)) {
case STARTED:
case IDLE:
cocall(err_proc,NULL); /* Call the error coprocess if */
break; /* this is legal. */
default:
abort(); /* Abort if error coprocess not */
} /* available for cocall. */
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.