[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

gamma Subroutine

Purpose

Computes the natural logarithm of the gamma function.

Libraries

The gamma:
IEEE Math Library (libm.a)
or System V Math Library (libmsaa.a)

Syntax

#include <math.h>

extern int signgam;

double gamma (x)
double x;

Description

The gamma subroutine computes the logarithm of the gamma function.

The sign of gamma( x) is returned in the external integer signgam.

Note
Compile any routine that uses subroutines from the libm.a with the -lm flag. To compile the lgamma.c file, enter:

cc lgamma.c -lm

Parameters

x Specifies the value to be computed.

Related Information

exp, expf, or expl Subroutine, feclearexcept Subroutine, fetestexcept Subroutine, and class, _class, finite, isnan, or unordered Subroutines.

The exp, expm1, log, log10, log1p or pow (exp, expf, or expl Subroutine) subroutine, matherr (matherr Subroutine) subroutine.

Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

128-Bit long double Floating-Point Format in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

math.h in AIX 5L Version 5.2 Files Reference.

gencore or coredump Subroutine

Purpose

Creates a core file without terminating the process.

Library

Standard C Library (libc.a)

Syntax

#include <core.h>

int gencore (coredumpinfop)
struct coredumpinfo *coredumpinfop;

int coredump (coredumpinfop)
struct coredumpinfo *coredumpinfop;

Description

The gencore subroutine creates a core file of the process without terminating. The new core file contains the memory image of the process, and this can be used with the dbx command for debugging purposes. In multithreaded processes, only one thread at a time should attempt to call this subroutine. Subsequent calls to coredump while a core dump (initiated by another thread) is in progress will fail.

The coredump subroutine generates a core file for the process from which it is called.

The gencore subroutine creates a core file for the process specified by the pid member of the coredumpinfo structure.

The coredumpinfo structure contains the following fields:

Member Type Member Name Description
unsigned int length Length of the core file name.
char * name Points to a char string, name of the core file.
pid_t pid Id of the process to be coredumped.
int flags Flags.
int reserved[] Reserved fields for future use.

Parameters

coredumpinfop Points to the coredumpinfo structure.

pid, should be set to the ID of the process, for which a core file needs to be generated. EPERM may be returned, if the user does not have enough privileges. flags should be set to COREGEN_VERSION_1, otherwise EINVAL is returned. If any thread in the process is in system call, when core is generated the register information returned may not be reliable (except stack pointer). To save register contents across system call, the application should be built using the "-bM:UR" flags. coredump is provided only for binary compatibly reasons.

Return Values

Upon successful completion, the gencore and coredump subroutines return a 0. If unsuccessful, a -1 is returned, and the errno global variable is set to indicate the error

Error Codes

EINVAL Invalid argument.
EACCESS Search permission is denied on a component of the path prefix. The file exists and write permission is denied, or the file does not exist and write permission is denied for the parent directory of the file to be created.
EINPROGRESS A core dump is already in progress.
ENOMEM Not enough emory.
EFAULT Invalid user address.
EPERM Operation not permitted.

Related Information

The adb Command, in AIX 5L Version 5.2 Commands Reference, Volume 1.

The dbx command, and gencore Command in AIX 5L Version 5.2 Commands Reference, Volume 2.

The core file format in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]