A

Top  Previous  Next

abort

#include <stdlib.h>

void abort (void);

 server

abort raises the signal SIGABRT.  If this returns (that is, if no signal handler has been nominated for SIGABRT by a call to signal) the program is terminated, and the status returned to the host operating system is set to 1 (EXIT_FAILURE).  Before termination, all functions registered by atexit are called, and all the task's files are closed.

abs

#include <stdlib.h>

int abs (

   int arg

);

 stand-alone

abs returns the absolute value of its integer operand.  The result returned by abs is not defined if arg is the largest negative integer.

acos

#include <math.h>

double acos (

   double x

);

stand-alone

acos returns the arc cosine in the range [0, π].  If x is outside the range [-1, +1], the value 0.0 is returned, and errno is set to the value EDOM.

alt_nowait

#include <alt.h>

int alt_nowait (

   int n,

   ...

);

 stand-alone

Use alt_nowait to find out which, if any, of a set of channels is attempting to provide data.

 

Dragons003alt_nowait can be used only on internal or virtual channels; it does not work with physical channels.

 

 

The parameter n is followed by a series of CHAN * arguments chan0, chan1...  which are pointers to the channels to be tested. n is the number of channels to be tested; it must match the actual number of channel pointers passed.

 

For example: alt_nowait(2, &c0, &c1);

 

Dragons003The channels must be unique within the call; the same channel must not appear more than once.

 

alt_nowait returns a non-negative value if another thread has already executed a chan_out_message call (or equivalent) using any one of the specified channels.  The returned value will be in the range 0…n-1, indicating which channel (chan0, chan1...) is ready to communicate; a chan_in_message call on that channel will then not block.  If more than one channel is ready to communicate, one will be arbitrarily chosen.

 

A negative value is returned if no thread is attempting to send a message on any of the channels tested.

alt_nowait_vec

#include <alt.h>

int alt_nowait_vec (

   int   n,

   CHAN *channels[]

);

 stand-alone

Use alt_wait to block execution of the calling thread until any one of a set of channels is attempting to provide data.  No processor time is consumed while waiting, so alt_wait is to be preferred over a 'busy wait' loop that repeatedly calls alt_nowait.

 

Dragons003alt_nowait_vec can be used only on internal or virtual channels; it does not work with physical channels.

 

The parameter n is followed by a series of CHAN * arguments chan0, chan1..., which are pointers to the channels. n is the number of channels; it must match the actual number of channel pointers passed.

 

For example: alt_wait(2, &c0, &c1);

 

Dragons003The channels must be unique within the call; the same channel must not appear more than once.

 

alt_wait returns only when a different thread or task executes a chan_out_message (or variant) call on any one of the specified channels.  The returned value will be in the range 0…n-1, indicating which channel (chan0, chan1, …) is ready to communicate; a chan_in_message call on that channel will then not block.

alt_wait

#include <alt.h>

int alt_wait (

   int n,

   ...

);

 stand-alone

Use alt_wait to block execution of the calling thread until any one of a set of channels is attempting to provide data.  No processor time is consumed while waiting, so alt_wait is to be preferred over a 'busy wait' loop that repeatedly calls alt_nowait.

 

Dragons003alt_wait can be used only on internal or virtual channels; it does not work with physical channels.

 

The parameter n is followed by a series of CHAN * arguments chan0, chan1..., which are pointers to the channels. n is the number of channels; it must match the actual number of channel pointers passed.

 

For example: alt_wait(2, &c0, &c1);

 

Dragons003The channels must be unique within the call; the same channel must not appear more than once.

 

alt_wait returns only when a different thread or task executes a chan_out_message (or variant) call on any one of the specified channels.  The returned value will be in the range 0…n-1, indicating which channel (chan0, chan1, …) is ready to communicate; a chan_in_message call on that channel will then not block.

 

If more than one channel becomes ready to communicate, one will be arbitrarily chosen.

alt_wait_vec

#include <alt.h>

int alt_wait_vec (

   int   n,

   CHAN *channels[]

);

 stand-alone

Use alt_wait_vec to block execution of the calling thread until any one of a group of channels is attempting to provide data.  No processor time is consumed while waiting, so alt_wait_vec is to be preferred over a 'busy wait' loop that repeatedly calls alt_nowait_vec.

 

Dragons003alt_wait_vec can be used only on internal or virtual channels; it does not work with physical channels.

 

channels is an array of pointers to the channels. n is the number of elements in the array.  Note that the channels themselves need not be in an array. alt_wait_vec returns only when a different thread or task executes a chan_out_message (or variant) call on any one of the specified channels.  The returned value will be in the range 0…n-1, indicating which channel (channel[0], channel[1], …) is ready to communicate; a chan_in_message call on that channel will then not block.  If more than one channel becomes ready to communicate, one will be arbitrarily chosen.

 

Dragons003The channels must be unique within the call; the same channel must not appear more than once.

asin

#include <math.h>

double asin (

   double x

);

 stand-alone

asin returns the arc sine of its argument in the range [-π/2, π/2].  If x is outside the range [-1, +1], the value HUGE_VAL is returned, and errno is set to the value EDOM.

assert

#include <assert.h>

void assert (

   int expression

);

server

If the macro identifier NDEBUG is defined at the point in the source file where <assert.h> is included, use of the assert function has no effect, in particular, expression may not be evaluated. For this reason, the correct functioning of the program must not depend on the execution of any assert functions. In particular, the expression should have no side-effects.

 

The assert function puts diagnostics into programs. The expression argument is any scalar expression. When it is executed, if expression is false (that is, evaluates to zero), assert writes a message on the standard error stream and terminates the program. The message gives the filename and line number of the assert call which failed.

 

No value is returned by assert.

atan

#include <math.h>

double atan (

   double x

);

stand-alone

atan returns the arc tangent of x. The result is in radians.

atan2

#include <math.h>

double atan2 (

   double x,

   double y

);

 stand-alone

atan2 returns the arc tangent of x/y. The result is in radians in the range [-π, π]. If both arguments are zero, the value 0.0 is returned, and errno is set to the value EDOM.

atexit

#include <stdlib.h>

int atexit (

   void (*func)(void)

);

stand-alone

The run-time library registers the value of func. The function it points to will be called (with no arguments) at normal program termination, when the main function returns or exit is called.

 

atexit returns 0 if func is registered successfully, otherwise it returns a non-zero value. There is no practical limit on the number of functions that may be registered.

 

The same function may be registered more than once, and will be called more than once.

atof

#include <stdlib.h>

double atof (

   const char *nptr

);

stand-alone

The string pointed to by nptr is converted to double-precision floating point representation. The format accepted by atof is the same as that accepted by strtod; in fact, a call to atof is equivalent to:

 

      strtod(nptr, (char **)NULL)

atoi

#include <stdlib.h>

int atoi (

   const char *nptr

);

stand-alone

This function converts the string pointed to by nptr to integer representation. The format accepted by atoi is the same as that accepted by strtol, with a decimal base; in fact, a call to atoi is equivalent to:

 

      (int)strtol(nptr, (char **)NULL, 10)

atol

#include <stdlib.h>

long atol (

   const char *nptr

);

 stand-alone

This function converts the string pointed to by nptr to long int representation. The format accepted by atol is the same as that accepted by strtol, with a decimal base; in fact, a call to atol is equivalent to:

 

      strtol(nptr, (char **)NULL, 10)