stdlib(5) stdlib(5)
NAME
stdlib - standard library definitions
SYNOPSIS
#include <stdlib.h>
DESCRIPTION
The <stdlib.h> header defines the following macro names:
EXITFAILURE Unsuccessful termination for exit(), evaluates to a
non-zero value.
EXITSUCCESS Successful termination for exit(), evaluates to 0.
NULL Null pointer.
RANDMAX Maximum value returned by rand(), at least 32,767.
MBCURMAX Integer expression whose value is the maximum number
of bytes in a character specified by the current
locale.
The following data types are defined through typedef:
divt Structure type returned by div() function.
ldivt Structure type returned by ldiv() function.
sizet As described in <stddef.h>.
wchart As described in <stddef.h>.
In addition, the following symbolic names and macros are defined as in
<sys/wait.h>, for use in decoding the return value from system():
WNOHANG
WUNTRACED
WEXITSTATUS()
WIFEXITED()
WIFSIGNALED()
WIFSTOPPED()
WSTOPSIG()
WTERMSIG()
Page 1 Reliant UNIX 5.44 Printed 11/98
stdlib(5) stdlib(5)
The following are declared as functions and may also be defined as
macros:
long a64l(const char *s);
void abort(void);
int abs(int i);
int atexit(void (*func)(void));
double atof(const char *str);
int atoi(const char *str);
long int atol(const char *str);
void *bsearch(const void *key, const void *base,
sizet nel, sizet width,
int (*compar)(const void *, const void *));
void *calloc(sizet nelem, sizet elsize);
divt div(int numer, int denom);
double drand48(void);
double erand48(unsigned short int xsubi[3]);
char *ecvt (double value, int ndigit, int *decpt, int *sign);
void exit(int status);
char *fcvt (double value, int ndigit, int *decpt, int *sign);
void free(void *ptr);
char *gcvt (double value, int ndigit, char *buf);
char *getenv(const char *name);
int getsubopt(char **optionp, char *const *tokens, char **valuep);
int grantpt(int fildes);
char *initstate(unsigned seed, char *state, int size);
long int jrand48 (unsigned short int xsubi[3]);
char *l64a(long value);
long int labs(long int j);
void lcong48(unsigned short int param[7]);
ldivt ldiv(long int numer, long int denom);
long int lrand48 (void);
void *malloc(sizet size);
int mblen (const char *s, sizet n);
sizet mbstowcs (wchart *pwcs, const char *s, sizet n);
int mbtowc (wchart *pwc, const char *s, sizet n);
char *mktemp(char *template);
int mkstemp(char *template);
long int mrand48 (void);
long int nrand48 (unsigned short int xsubi[3]);
char *ptsname(int fildes);
int putenv(const char *string);
void qsort(void *base, sizet nel, sizet width,
int (*compar)(const void *, const void *));
int rand(void);
long random(void);
void *realloc(void *ptr, sizet size);
char *realpath(const char *filename, char *resolvedname);
unsigned short int *seed48 (unsigned short int seed18v[3]);
void setkey(const char *key);
char *setstate(char *state);
void srand(unsigned int seed);
Page 2 Reliant UNIX 5.44 Printed 11/98
stdlib(5) stdlib(5)
void srand48(long int seedval);
void srandom(unsigned seed);
double strtod(const char *str, char **ptr);
long int strtol(const char *str, char **ptr, int base);
unsigned long int strtoul(const char *str, char **ptr, int base);
int system(const char *string);
int ttyslot(void);
int unlockpt(int fildes);
void *valloc(sizet size);
sizet wcstombs(char *s, const wchart *pwcs, sizet n);
int wctomb(char *s, wchart wchar);
Inclusion of the stdlib() header may also make visible all symbols
from <stddef.h>, <limits.h>, <math.h> and <sys/wait.h>.
SEE ALSO
exit(2), initstate(3), mkstemp(3), setstate(3), srandom(3), a64l(3C),
abort(3C), abs(3C), atexit(3C), atof(3C), atoi(3C), atol(3C),
bsearch(3C), calloc(3C), div(3C), drand48(3C), ecvt(3C), erand48(3C),
fcvt(3C), free(3C), gcvt(3C), getenv(3C), getsubopt(3C), grantpt(3C),
jrand48(3C), l64a(3C), labs(3C), lcong48(3C), ldiv(3C), lrand48(3C),
malloc(3C), mblen(3C), mbstowcs(3C), mbtowc(3C), mktemp(3C),
mrand48(3C), nrand48(3C), ptsname(3C), putenv(3C), qsort(3C),
rand(3C), realloc(3C), realpath(3C), srand(3C), srand48(3C),
strtod(3C), strtol(3C), strtoul(3C), ttyslot(3C), unlockpt(3C),
valloc(3C), wcstombs(3C), wctomb(3C), types(5).
Page 3 Reliant UNIX 5.44 Printed 11/98