__signgam() — Return signgam reference

Standards

Standards / Extensions C or C++ Dependencies
z/OS® UNIX both  

Format

#define _XOPEN_SOURCE
#include <math.h>

int *__signgam(void);
#define signgam (*__signgam())

General description

The __signgam() function returns the address of the calling thread's storage for the signgam external variable used by the gamma() and lgamma() functions. This extended mechanism is necessary for multithreaded processes which use either of these two functions, since each thread has its own instance of signgam. The <math.h> header defines signgam to an invocation of __signgam(), so generally, all references to signgam will be mapped to calls to __signgam(). If the user eliminates this definition, either by not including the header, or by using #undef, then references to signgam will refer to the actual signgam external variable, which contains the signgam value for the IPT only. In the absence of the definition of signgam to a call to __signgam(), signgam values in threads other than the IPT are inaccessible.

Returned value

__signgam() is always successful.

Related information