



Synopsys:
     #include <stdlib.h>
     void *malloc(size_t NBYTES);
     void *realloc(void *APTR, size_t NBYTES);
     void free(void *APTR);

     void *memalign(size_t ALIGN, size_t NBYTES);

     size_t malloc_usable_size(void *APTR);

     void *_malloc_r(void *REENT, size_t NBYTES);
     void *_realloc_r(void *REENT,
         void *APTR, size_t NBYTES);
     void _free_r(void *REENT, void *APTR);

     void *_memalign_r(void *REENT,
         size_t ALIGN, size_t NBYTES);

     size_t _malloc_usable_size_r(void *REENT, void *APTR);
   
Description:
These functions manage a pool of system memory.

   Use 'malloc' to request allocation of an object with at least NBYTES
bytes of storage available.  If the space is available, malloc
returns a pointer to a newly allocated block as its result.

   If you already have a block of storage allocated by malloc, but
you no longer need all the space allocated to it, you can make it
smaller by calling 'realloc' with both the object pointer and the new
desired size as arguments.  realloc guarantees that the contents of
the smaller object match the beginning of the original object.

   Similarly, if you need more space for an object, use realloc to
request the larger size; again, realloc guarantees that the beginning
of the new, larger object matches the contents of the original object.

   When you no longer need an object originally allocated by malloc
or realloc (or the related function calloc), return it to the
memory storage pool by calling 'free' with the address of the object as
the argument.  You can also use realloc for this purpose by calling
it with 0 as the NBYTES argument.

   The 'memalign' function returns a block of size NBYTES aligned to a
ALIGN boundary.  The ALIGN argument must be a power of two.

   The 'malloc_usable_size' function takes a pointer to a block
allocated by malloc.  It returns the amount of space that is
available in the block.  This may or may not be more than the size
requested from malloc, due to alignment or minimum size constraints.

   The alternate functions '_malloc_r', '_realloc_r', '_free_r',
'_memalign_r', and '_malloc_usable_size_r' are reentrant versions.  The
extra argument REENT is a pointer to a reentrancy structure.

   If you have multiple threads of execution which may call any of these
routines, or if any of these routines may be called reentrantly, then
you must provide implementations of the __malloc_lock and
__malloc_unlock functions for your system.  See the documentation for
those functions.

   These functions operate by calling the function '_sbrk_r' or 'sbrk',
which allocates space.  You may need to provide one of these functions
for your system.  _sbrk_r is called with a positive value to allocate
more space, and with a negative value to release previously allocated
space if it is no longer required.  *Note Stubs::.

Returns:
malloc returns a pointer to the newly allocated space, if successful;
otherwise it returns NULL.  If your application needs to generate
empty objects, you may use malloc(0) for this purpose.

   realloc returns a pointer to the new block of memory, or NULL if
a new block could not be allocated.  NULL is also the result when you
use realloc(APTR,0) (which has the same effect as free(APTR)).
You should always check the result of realloc; successful
reallocation is not guaranteed even when you request a smaller object.

   free does not return a result.

   memalign returns a pointer to the newly allocated space.

   malloc_usable_size returns the usable size.

Portability:
malloc, realloc, and free are specified by the ANSI C standard,
but other conforming implementations of malloc may behave differently
when NBYTES is zero.

   memalign is part of SVR4.

   malloc_usable_size is not portable.

   Supporting OS subroutines required: sbrk.
 





Synopsys:
     #include <malloc.h>
     struct mallinfo mallinfo(void);
     void malloc_stats(void);
     int mallopt(int PARAMETER, VALUE);

     struct mallinfo _mallinfo_r(void *REENT);
     void _malloc_stats_r(void *REENT);
     int _mallopt_r(void *REENT, int PARAMETER, VALUE);
   
Description:
'mallinfo' returns a structure describing the current state of memory
allocation.  The structure is defined in malloc.h.  The following
fields are defined: 'arena' is the total amount of space in the heap;
'ordblks' is the number of chunks which are not in use; 'uordblks' is
the total amount of space allocated by malloc; 'fordblks' is the
total amount of space not in use; 'keepcost' is the size of the top
most memory block.

   'malloc_stats' print some statistics about memory allocation on
standard error.

   'mallopt' takes a parameter and a value.  The parameters are defined
in malloc.h, and may be one of the following: 'M_TRIM_THRESHOLD' sets
the maximum amount of unused space in the top most block before
releasing it back to the system in free (the space is released by
calling _sbrk_r with a negative argument); 'M_TOP_PAD' is the amount
of padding to allocate whenever _sbrk_r is called to allocate more
space.

   The alternate functions '_mallinfo_r', '_malloc_stats_r', and
'_mallopt_r' are reentrant versions.  The extra argument REENT is a
pointer to a reentrancy structure.

Returns:
mallinfo returns a mallinfo structure.  The structure is defined in
malloc.h.

   malloc_stats does not return a result.

   mallopt returns zero if the parameter could not be set, or
non-zero if it could be set.

Portability:
mallinfo and mallopt are provided by SVR4, but mallopt takes
different parameters on different systems.  malloc_stats is not
portable.

 





Synopsys:
     #include <malloc.h>
     void __malloc_lock (struct _reent *REENT);
     void __malloc_unlock (struct _reent *REENT);
   
Description:
The malloc family of routines call these functions when they need to
lock the memory pool.  The version of these routines supplied in the
library use the lock API defined in sys/lock.h.  If multiple threads of
execution can call malloc, or if malloc can be called reentrantly,
then you need to define your own versions of these functions in order
to safely lock the memory pool during a call.  If you do not, the
memory pool may become corrupted.

   A call to malloc may call '__malloc_lock' recursively; that is,
the sequence of calls may go __malloc_lock, __malloc_lock,
__malloc_unlock, '__malloc_unlock'.  Any implementation of these
routines must be careful to avoid causing a thread to wait for a lock
that it already holds.

 





Synopsys:
     #include <stdlib.h>
     int mblen(const char *S, size_t N);
   
Description:
When '_MB_CAPABLE' is not defined, this is a minimal ANSI-conforming
implementation of 'mblen'.  In this case, the only "multi-byte
character sequences" recognized are single bytes, and thus 1 is
returned unless S is the null pointer or has a length of 0 or is the
empty string.

   When _MB_CAPABLE is defined, this routine calls '_mbtowc_r' to
perform the conversion, passing a state variable to allow state
dependent decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

Returns:
This implementation of mblen returns 0 if S is NULL or the empty
string; it returns 1 if not _MB_CAPABLE or the character is a
single-byte character; it returns -1 if the multi-byte character is
invalid; otherwise it returns the number of bytes in the multibyte
character.

Portability:
mblen is required in the ANSI C standard.  However, the precise
effects vary with the locale.

   mblen requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     int mbstowcs(wchar_t *PWC, const char *S, size_t N);
   
Description:
When '_MB_CAPABLE' is not defined, this is a minimal ANSI-conforming
implementation of 'mbstowcs'.  In this case, the only "multi-byte
character sequences" recognized are single bytes, and they are
"converted" to wide-char versions simply by byte extension.

   When _MB_CAPABLE is defined, this routine calls '_mbstowcs_r' to
perform the conversion, passing a state variable to allow state
dependent decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

Returns:
This implementation of mbstowcs returns 0 if S is NULL or is the
empty string; it returns -1 if _MB_CAPABLE and one of the multi-byte
characters is invalid or incomplete; otherwise it returns the minimum
of: n or the number of multi-byte characters in s plus 1 (to
compensate for the nul character).  If the return value is -1, the
state of the pwc string is indeterminate.  If the input has a length
of 0, the output string will be modified to contain a wchar_t nul
terminator.

Portability:
mbstowcs is required in the ANSI C standard.  However, the precise
effects vary with the locale.

   mbstowcs requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     int mbtowc(wchar_t *PWC, const char *S, size_t N);
   
Description:
When '_MB_CAPABLE' is not defined, this is a minimal ANSI-conforming
implementation of 'mbtowc'.  In this case, only "multi-byte character
sequences" recognized are single bytes, and they are "converted" to
themselves.  Each call to mbtowc copies one character from *S to
*PWC, unless S is a null pointer.  The argument n is ignored.

   When _MB_CAPABLE is defined, this routine calls '_mbtowc_r' to
perform the conversion, passing a state variable to allow state
dependent decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

Returns:
This implementation of mbtowc returns 0 if S is NULL or is the
empty string; it returns 1 if not _MB_CAPABLE or the character is a
single-byte character; it returns -1 if n is 0 or the multi-byte
character is invalid; otherwise it returns the number of bytes in the
multibyte character.  If the return value is -1, no changes are made to
the pwc output string.  If the input is the empty string, a wchar_t
nul is placed in the output string and 0 is returned.  If the input has
a length of 0, no changes are made to the pwc output string.

Portability:
mbtowc is required in the ANSI C standard.  However, the precise
effects vary with the locale.

   mbtowc requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     int on_exit (void (*FUNCTION)(int, void *), void *ARG);
   
Description:
You can use 'on_exit' to enroll functions in a list of functions that
will be called when your program terminates normally.  The argument is
a pointer to a user-defined function which takes two arguments.  The
first is the status code passed to exit and the second argument is of
type pointer to void.  The function must not return a result.  The value
of ARG is registered and passed as the argument to FUNCTION.

   The functions are kept in a LIFO stack; that is, the last function
enrolled by atexit or on_exit will be the first to execute when
your program exits.  You can intermix functions using atexit and
on_exit.

   There is no built-in limit to the number of functions you can enroll
in this list; however, after every group of 32 functions is enrolled,
atexit/on_exit will call malloc to get space for the next part of
the list.   The initial list of 32 functions is statically allocated, so
you can always count on at least that many slots available.

Returns:
on_exit returns 0 if it succeeds in enrolling your function, -1
if it fails (possible only if no space was available for malloc to
extend the list of functions).

Portability:
on_exit is a non-standard glibc extension

   Supporting OS subroutines required: None

 





Synopsys:
     #include <stdlib.h>
     int rand(void);
     void srand(unsigned int SEED);
     int rand_r(unsigned int *SEED);
   
Description:
'rand'/'rand_r' returns a different integer each time it is called; each integer
is chosen by an algorithm designed to be unpredictable, so that you can
use rand when you require a random number.  The algorithm depends on
a static variable called the "random seed"; starting with a given value
of the random seed always produces the same sequence of numbers in
successive calls to rand.

   You can set the random seed using 'srand'; it does nothing beyond
storing its argument in the static variable used by rand.  You can
exploit this to make the pseudo-random sequence less predictable, if
you wish, by using some other unpredictable value (often the least
significant parts of a time-varying value) as the random seed before
beginning a sequence of calls to rand; or, if you wish to ensure (for
example, while debugging) that successive runs of your program use the
same "random" numbers, you can use srand to set the same random seed
at the outset.

Returns:
rand returns the next pseudo-random integer in sequence; it is a
number between 0 and RAND_MAX (inclusive).

   srand does not return a result.

Portability:
rand is required by ANSI, but the algorithm for pseudo-random number
generation is not specified; therefore, even if you use the same random
seed, you cannot expect the same sequence of results on two different
systems.

   rand requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     double drand48(void);
     double erand48(unsigned short XSEED[3]);
     long lrand48(void);
     long nrand48(unsigned short XSEED[3]);
     long mrand48(void);
     long jrand48(unsigned short XSEED[3]);
     void srand48(long SEED);
     unsigned short *seed48(unsigned short XSEED[3]);
     void lcong48(unsigned short P[7]);
   
Description:
The rand48 family of functions generates pseudo-random numbers using
a linear congruential algorithm working on integers 48 bits in size.
The particular formula employed is r(n+1) = (a * r(n) + c) mod m where
the default values are for the multiplicand a = 0xfdeece66d =
25214903917 and the addend c = 0xb = 11. The modulo is always fixed at
m = 2 ** 48.  r(n) is called the seed of the random number generator.

   For all the six generator routines described next, the first
computational step is to perform a single iteration of the algorithm.

   'drand48' and 'erand48' return values of type double. The full 48
bits of r(n+1) are loaded into the mantissa of the returned value, with
the exponent set such that the values produced lie in the interval
[0.0, 1.0].

   'lrand48' and 'nrand48' return values of type long in the range [0,
2**31-1]. The high-order (31) bits of r(n+1) are loaded into the lower
bits of the returned value, with the topmost (sign) bit set to zero.

   'mrand48' and 'jrand48' return values of type long in the range
[-2**31, 2**31-1]. The high-order (32) bits of r(n+1) are loaded into
the returned value.

   drand48, lrand48, and mrand48 use an internal buffer to store
r(n). For these functions the initial value of r(0) = 0x1234abcd330e =
20017429951246.

   On the other hand, erand48, nrand48, and jrand48 use a
user-supplied buffer to store the seed r(n), which consists of an array
of 3 shorts, where the zeroth member holds the least significant bits.

   All functions share the same multiplicand and addend.

   'srand48' is used to initialize the internal buffer r(n) of
drand48, lrand48, and mrand48 such that the 32 bits of the seed
value are copied into the upper 32 bits of r(n), with the lower 16 bits
of r(n) arbitrarily being set to 0x330e.  Additionally, the constant
multiplicand and addend of the algorithm are reset to the default
values given above.

   'seed48' also initializes the internal buffer r(n) of drand48,
lrand48, and mrand48, but here all 48 bits of the seed can be
specified in an array of 3 shorts, where the zeroth member specifies
the lowest bits. Again, the constant multiplicand and addend of the
algorithm are reset to the default values given above.  seed48
returns a pointer to an array of 3 shorts which contains the old seed.
This array is statically allocated, thus its contents are lost after
each new call to seed48.

   Finally, 'lcong48' allows full control over the multiplicand and
addend used in drand48, erand48, lrand48, nrand48, mrand48,
and jrand48, and the seed used in drand48, lrand48, and mrand48.
An array of 7 shorts is passed as parameter; the first three shorts are
used to initialize the seed; the second three are used to initialize the
multiplicand; and the last short is used to initialize the addend.  It
is thus not possible to use values greater than 0xffff as the addend.

   Note that all three methods of seeding the random number generator
always also set the multiplicand and addend for any of the six
generator calls.

   For a more powerful random number generator, see random.

Portability:
SUS requires these functions.

   No supporting OS subroutines are required.

 





Synopsys:
     #include <stdlib.h>
     double strtod(const char *STR, char **TAIL);
     float strtof(const char *STR, char **TAIL);

     double _strtod_r(void *REENT,
         const char *STR, char **TAIL);
   
Description:
The function 'strtod'/'strtof' parses the character string STR, producing a
substring which can be converted to a double value.  The substring
converted is the longest initial subsequence of STR, beginning with the
first non-whitespace character, that has the format:
     [+|-]DIGITS[.][DIGITS][(e|E)[+|-]DIGITS]
   The substring contains no characters if STR is empty, consists
entirely of whitespace, or if the first non-whitespace character is
something other than +, -, ., or a digit. If the substring is
empty, no conversion is done, and the value of STR is stored in
*TAIL.  Otherwise, the substring is converted, and a pointer to the
final string (which will contain at least the terminating null
character of STR) is stored in *TAIL.  If you want no assignment to
*TAIL, pass a null pointer as TAIL.  strtof is identical to
strtod except for its return type.

   This implementation returns the nearest machine number to the input
decimal string.  Ties are broken by using the IEEE round-even rule.

   The alternate function '_strtod_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
strtod returns the converted substring value, if any.  If no
conversion could be performed, 0 is returned.  If the correct value is
out of the range of representable values, plus or minus HUGE_VAL is
returned, and ERANGE is stored in errno. If the correct value would
cause underflow, 0 is returned and ERANGE is stored in errno.

   Supporting OS subroutines required: close, fstat, isatty,
lseek, read, sbrk, write.

 





Synopsys:
     #include <stdlib.h>
     long strtol(const char *S, char **PTR,int BASE);

     long _strtol_r(void *REENT,
         const char *S, char **PTR,int BASE);
   
Description:
The function 'strtol' converts the string *S to a long. First, it
breaks down the string into three parts: leading whitespace, which is
ignored; a subject string consisting of characters resembling an
integer in the radix specified by BASE; and a trailing portion
consisting of zero or more unparseable characters, and always including
the terminating null character. Then, it attempts to convert the
subject string into a long and returns the result.

   If the value of BASE is 0, the subject string is expected to look
like a normal C integer constant: an optional sign, a possible 0x
indicating a hexadecimal base, and a number. If BASE is between 2 and
36, the expected form of the subject is a sequence of letters and
digits representing an integer in the radix specified by BASE, with an
optional plus or minus sign. The letters a-z (or, equivalently,
A-Z) are used to signify values from 10 to 35; only letters whose
ascribed values are less than BASE are permitted. If BASE is 16, a
leading 0x is permitted.

   The subject sequence is the longest initial sequence of the input
string that has the expected form, starting with the first
non-whitespace character.  If the string is empty or consists entirely
of whitespace, or if the first non-whitespace character is not a
permissible letter or digit, the subject string is empty.

   If the subject string is acceptable, and the value of BASE is zero,
strtol attempts to determine the radix from the input string. A
string with a leading 0x is treated as a hexadecimal value; a string
with a leading 0 and no x is treated as octal; all other strings are
treated as decimal. If BASE is between 2 and 36, it is used as the
conversion radix, as described above. If the subject string begins with
a minus sign, the value is negated. Finally, a pointer to the first
character past the converted subject string is stored in PTR, if PTR is
not NULL.

   If the subject string is empty (or not in acceptable form), no
conversion is performed and the value of S is stored in PTR (if PTR is
not NULL).

   The alternate function '_strtol_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
strtol returns the converted value, if any. If no conversion was
made, 0 is returned.

   strtol returns LONG_MAX or LONG_MIN if the magnitude of the
converted value is too large, and sets errno to ERANGE.

Portability:
strtol is ANSI.

   No supporting OS subroutines are required.

 





Synopsys:
     #include <stdlib.h>
     long long strtoll(const char *S, char **PTR,int BASE);

     long long _strtoll_r(void *REENT,
         const char *S, char **PTR,int BASE);
   
Description:
The function 'strtoll' converts the string *S to a long long.
First, it breaks down the string into three parts: leading whitespace,
which is ignored; a subject string consisting of characters resembling
an integer in the radix specified by BASE; and a trailing portion
consisting of zero or more unparseable characters, and always including
the terminating null character. Then, it attempts to convert the
subject string into a long long and returns the result.

   If the value of BASE is 0, the subject string is expected to look
like a normal C integer constant: an optional sign, a possible 0x
indicating a hexadecimal base, and a number. If BASE is between 2 and
36, the expected form of the subject is a sequence of letters and
digits representing an integer in the radix specified by BASE, with an
optional plus or minus sign. The letters a-z (or, equivalently,
A-Z) are used to signify values from 10 to 35; only letters whose
ascribed values are less than BASE are permitted. If BASE is 16, a
leading 0x is permitted.

   The subject sequence is the longest initial sequence of the input
string that has the expected form, starting with the first
non-whitespace character.  If the string is empty or consists entirely
of whitespace, or if the first non-whitespace character is not a
permissible letter or digit, the subject string is empty.

   If the subject string is acceptable, and the value of BASE is zero,
strtoll attempts to determine the radix from the input string. A
string with a leading 0x is treated as a hexadecimal value; a string
with a leading 0 and no x is treated as octal; all other strings are
treated as decimal. If BASE is between 2 and 36, it is used as the
conversion radix, as described above. If the subject string begins with
a minus sign, the value is negated. Finally, a pointer to the first
character past the converted subject string is stored in PTR, if PTR is
not NULL.

   If the subject string is empty (or not in acceptable form), no
conversion is performed and the value of S is stored in PTR (if PTR is
not NULL).

   The alternate function '_strtoll_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
strtoll returns the converted value, if any. If no conversion was
made, 0 is returned.

   strtoll returns 'LONG_LONG_MAX' or 'LONG_LONG_MIN' if the
magnitude of the converted value is too large, and sets errno to
'ERANGE'.

Portability:
strtoll is nonstandard.

   No supporting OS subroutines are required.

 





Synopsys:
     #include <stdlib.h>
     unsigned long strtoul(const char *S, char **PTR,
         int BASE);

     unsigned long _strtoul_r(void *REENT, const char *S,
         char **PTR, int BASE);
   
Description:
The function 'strtoul' converts the string *S to an unsigned long.
First, it breaks down the string into three parts: leading whitespace,
which is ignored; a subject string consisting of the digits meaningful
in the radix specified by BASE (for example, 0 through 7 if the
value of BASE is 8); and a trailing portion consisting of one or more
unparseable characters, which always includes the terminating null
character. Then, it attempts to convert the subject string into an
unsigned long integer, and returns the result.

   If the value of BASE is zero, the subject string is expected to look
like a normal C integer constant (save that no optional sign is
permitted): a possible 0x indicating hexadecimal radix, and a number.
If BASE is between 2 and 36, the expected form of the subject is a
sequence of digits (which may include letters, depending on the base)
representing an integer in the radix specified by BASE.  The letters
a-z (or A-Z) are used as digits valued from 10 to 35. If BASE
is 16, a leading 0x is permitted.

   The subject sequence is the longest initial sequence of the input
string that has the expected form, starting with the first
non-whitespace character.  If the string is empty or consists entirely
of whitespace, or if the first non-whitespace character is not a
permissible digit, the subject string is empty.

   If the subject string is acceptable, and the value of BASE is zero,
strtoul attempts to determine the radix from the input string. A
string with a leading 0x is treated as a hexadecimal value; a string
with a leading 0 and no x is treated as octal; all other strings are
treated as decimal. If BASE is between 2 and 36, it is used as the
conversion radix, as described above. Finally, a pointer to the first
character past the converted subject string is stored in PTR, if PTR is
not NULL.

   If the subject string is empty (that is, if *S does not start with
a substring in acceptable form), no conversion is performed and the
value of S is stored in PTR (if PTR is not NULL).

   The alternate function '_strtoul_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
strtoul returns the converted value, if any. If no conversion was
made, 0 is returned.

   strtoul returns 'ULONG_MAX' if the magnitude of the converted
value is too large, and sets errno to 'ERANGE'.

Portability:
strtoul is ANSI.

   strtoul requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     unsigned long long strtoull(const char *S, char **PTR,
         int BASE);

     unsigned long long _strtoull_r(void *REENT, const char *S,
         char **PTR, int BASE);
   
Description:
The function 'strtoull' converts the string *S to an unsigned long
long. First, it breaks down the string into three parts: leading
whitespace, which is ignored; a subject string consisting of the digits
meaningful in the radix specified by BASE (for example, 0 through 7
if the value of BASE is 8); and a trailing portion consisting of one or
more unparseable characters, which always includes the terminating null
character. Then, it attempts to convert the subject string into an
unsigned long long integer, and returns the result.

   If the value of BASE is zero, the subject string is expected to look
like a normal C integer constant (save that no optional sign is
permitted): a possible 0x indicating hexadecimal radix, and a number.
If BASE is between 2 and 36, the expected form of the subject is a
sequence of digits (which may include letters, depending on the base)
representing an integer in the radix specified by BASE.  The letters
a-z (or A-Z) are used as digits valued from 10 to 35. If BASE
is 16, a leading 0x is permitted.

   The subject sequence is the longest initial sequence of the input
string that has the expected form, starting with the first
non-whitespace character.  If the string is empty or consists entirely
of whitespace, or if the first non-whitespace character is not a
permissible digit, the subject string is empty.

   If the subject string is acceptable, and the value of BASE is zero,
strtoull attempts to determine the radix from the input string. A
string with a leading 0x is treated as a hexadecimal value; a string
with a leading 0 and no x is treated as octal; all other strings are
treated as decimal. If BASE is between 2 and 36, it is used as the
conversion radix, as described above. Finally, a pointer to the first
character past the converted subject string is stored in PTR, if PTR is
not NULL.

   If the subject string is empty (that is, if *S does not start with
a substring in acceptable form), no conversion is performed and the
value of S is stored in PTR (if PTR is not NULL).

   The alternate function '_strtoull_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
strtoull returns the converted value, if any. If no conversion was
made, 0 is returned.

   strtoull returns ULONG_LONG_MAX if the magnitude of the converted
value is too large, and sets errno to ERANGE.

Portability:
strtoull is nonstandard.

   strtoull requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     int system(char *S);

     int _system_r(void *REENT, char *S);
   
Description:
Use 'system' to pass a command string *S to /bin/sh on your system,
and wait for it to finish executing.

   Use "system(NULL)" to test whether your system has /bin/sh
available.

   The alternate function '_system_r' is a reentrant version.  The
extra argument REENT is a pointer to a reentrancy structure.

Returns:
system(NULL) returns a non-zero value if /bin/sh is available, and
0 if it is not.

   With a command argument, the result of system is the exit status
returned by /bin/sh.

Portability:
ANSI C requires system, but leaves the nature and effects of a
command processor undefined.  ANSI C does, however, specify that
system(NULL) return zero or nonzero to report on the existence of a
command processor.

   POSIX.2 requires system, and requires that it invoke a sh.
Where sh is found is left unspecified.

   Supporting OS subroutines required: _exit, _execve, _fork_r,
_wait_r.

 





Synopsys:
     #include <stdlib.h>
     int wcstombs(const char *S, wchar_t *PWC, size_t N);
   
Description:
When '_MB_CAPABLE' is not defined, this is a minimal ANSI-conforming
implementation of 'wcstombs'.  In this case, all wide-characters are
expected to represent single bytes and so are converted simply by
casting to char.

   When _MB_CAPABLE is defined, this routine calls _wcstombs_r to
perform the conversion, passing a state variable to allow state
dependent decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

Returns:
This implementation of wcstombs returns 0 if S is NULL or is the
empty string; it returns -1 if _MB_CAPABLE and one of the wide-char
characters does not represent a valid multi-byte character; otherwise
it returns the minimum of: n or the number of bytes that are
transferred to s, not including the nul terminator.

   If the return value is -1, the state of the pwc string is
indeterminate.  If the input has a length of 0, the output string will
be modified to contain a wchar_t nul terminator if n > 0.

Portability:
wcstombs is required in the ANSI C standard.  However, the precise
effects vary with the locale.

   wcstombs requires no supporting OS subroutines.

 





Synopsys:
     #include <stdlib.h>
     int wctomb(char *S, wchar_t WCHAR);
   
Description:
When '_MB_CAPABLE' is not defined, this is a minimal ANSI-conforming
implementation of 'wctomb'.  The only "wide characters" recognized are
single bytes, and they are "converted" to themselves.

   When _MB_CAPABLE is defined, this routine calls _wctomb_r to
perform the conversion, passing a state variable to allow state
dependent decoding.  The result is based on the locale setting which may
be restricted to a defined set of locales.

   Each call to wctomb modifies *S unless S is a null pointer or
_MB_CAPABLE is defined and WCHAR is invalid.

Returns:
This implementation of wctomb returns 0 if S is NULL; it returns
-1 if _MB_CAPABLE is enabled and the wchar is not a valid multi-byte
character, it returns 1 if _MB_CAPABLE is not defined or the wchar is
in reality a single byte character, otherwise it returns the number of
bytes in the multi-byte character.

Portability:
wctomb is required in the ANSI C standard.  However, the precise
effects vary with the locale.

   wctomb requires no supporting OS subroutines.

