srv_capability

Description

Determine whether Open Server supports a platform-dependent service.

Syntax

CS_BOOL srv_capability(capability)
CS_INT                 capability;

Parameters

capability

A constant that represents the Open Server services to test. Table 3-19 describes the legal values for capability:

Table 3-19: Values for capability (srv_capability)

Value

Description

SRV_C_DEBUG

srv_dbg_stack and srv_dbg_switch are supported.

SRV_C_EXIT

A callback routine can be invoked when a thread terminates.

SRV_C_RESUME

A callback routine can be invoked when a thread resumes execution.

SRV_C_PREEMPT

Preemptive scheduling is supported.

SRV_C_SELECT

srv_select is supported.

SRV_C_SUSPEND

A callback routine can be invoked when a thread is suspended.

SRV_C_TIMESLICE

A callback routine can be invoked when a thread exceeds the maximum number of clock ticks.

SRV_POLL

srv_poll is supported.

Returns

Table 3-20: Return values (srv_capability)

Returns

To indicate

CS_TRUE

Open Server supports the service.

CS_FALSE

Open Server does not support the service.

Examples

Example 1

#include          <ospublic.h>
/*
 ** Local Prototype
 */
extern CS_RETCODE ex_srv_capability PROTOTYPE((void));
/* 
 ** EX_SRV_CAPABILITY
**
**     Example routine to determine whether srv_poll is supported 
 **     on this platform.
 **
** Arguments:
**     None.
**
** Returns:
**
**     CS_SUCCEED   srv_poll is supported on this platform.
**     CS_FAIL      srv_poll is not supported on this platform.
 */
CS_RETCODE          ex_srv_capability()
{
     CS_BOOL supported;
     /*
      ** Check to see whether srv_poll is supported on this 
      ** platform.
      */
      supported = srv_capability(SRV_C_POLL);
     /*
      ** If “supported” is CS_TRUE, we return CS_SUCCEED, if it is
      ** CS_FALSE we return CS_FAIL.
      */
      return(supported ? CS_SUCCEED : CS_FAIL);
}

Usage

See also

srv_callback, srv_capability, srv_dbg_stack, srv_dbg_switch, srv_poll (UNIX only), srv_select (UNIX only), srv_capability_info