stdlib.h(3)                POSIX Programmer's Manual               stdlib.h(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       stdlib.h -- standard library definitions

SSYYNNOOPPSSIISS
       #include <stdlib.h>

DDEESSCCRRIIPPTTIIOONN
       Some of the functionality described on this reference page extends the
       ISO C standard. Applications shall define the appropriate feature test
       macro (see the System Interfaces volume of POSIX.1-2017, _S_e_c_t_i_o_n _2_._2,
       _T_h_e _C_o_m_p_i_l_a_t_i_o_n _E_n_v_i_r_o_n_m_e_n_t) to enable the visibility of these symbols
       in this header.

       The _<_s_t_d_l_i_b_._h_> header shall define the following macros which shall
       expand to integer constant expressions:

       EXIT_FAILURE
                   Unsuccessful termination for _e_x_i_t(); evaluates to a non-
                   zero value.

       EXIT_SUCCESS
                   Successful termination for _e_x_i_t(); evaluates to 0.

       {RAND_MAX}  Maximum value returned by _r_a_n_d(); at least 32767.

       The _<_s_t_d_l_i_b_._h_> header shall define the following macro which shall
       expand to a positive integer expression with type ssiizzee__tt:

       {MB_CUR_MAX}
                   Maximum number of bytes in a character specified by the
                   current locale (category _L_C___C_T_Y_P_E).

       In the POSIX locale the value of {MB_CUR_MAX} shall be 1.

       The _<_s_t_d_l_i_b_._h_> header shall define NULL as described in _<_s_t_d_d_e_f_._h_>.

       The _<_s_t_d_l_i_b_._h_> header shall define the following data types through
       ttyyppeeddeeff:

       ddiivv__tt       Structure type returned by the _d_i_v() function.

       llddiivv__tt      Structure type returned by the _l_d_i_v() function.

       llllddiivv__tt     Structure type returned by the _l_l_d_i_v() function.

       ssiizzee__tt      As described in _<_s_t_d_d_e_f_._h_>.

       wwcchhaarr__tt     As described in _<_s_t_d_d_e_f_._h_>.

       In addition, the _<_s_t_d_l_i_b_._h_> header shall define the following symbolic
       constants and macros as described in _<_s_y_s_/_w_a_i_t_._h_>:

       WEXITSTATUS
       WIFEXITED
       WIFSIGNALED
       WIFSTOPPED
       WNOHANG
       WSTOPSIG
       WTERMSIG
       WUNTRACED

       The following shall be declared as functions and may also be defined as
       macros. Function prototypes shall be provided.


           void          _Exit(int);
           long          a64l(const char *);
           void          abort(void);
           int           abs(int);
           int           atexit(void (*)(void));
           double        atof(const char *);
           int           atoi(const char *);
           long          atol(const char *);
           long long     atoll(const char *);
           void         *bsearch(const void *, const void *, size_t, size_t,
                             int (*)(const void *, const void *));
           void         *calloc(size_t, size_t);
           div_t         div(int, int);
           double        drand48(void);
           double        erand48(unsigned short [3]);
           void          exit(int);
           void          free(void *);
           char         *getenv(const char *);
           int           getsubopt(char **, char *const *, char **);
           int           grantpt(int);
           char         *initstate(unsigned, char *, size_t);
           long          jrand48(unsigned short [3]);
           char         *l64a(long);
           long          labs(long);
           void          lcong48(unsigned short [7]);
           ldiv_t        ldiv(long, long);
           long long     llabs(long long);
           lldiv_t       lldiv(long long, long long);
           long          lrand48(void);
           void         *malloc(size_t);
           int           mblen(const char *, size_t);
           size_t        mbstowcs(wchar_t *restrict, const char *restrict, size_t);
           int           mbtowc(wchar_t *restrict, const char *restrict, size_t);
           char         *mkdtemp(char *);
           int           mkstemp(char *);
           long          mrand48(void);
           long          nrand48(unsigned short [3]);
           int           posix_memalign(void **, size_t, size_t);
           int           posix_openpt(int);
           char         *ptsname(int);
           int           putenv(char *);
           void          qsort(void *, size_t, size_t, int (*)(const void *,
                             const void *));
           int           rand(void);
           int           rand_r(unsigned *);
           long          random(void);
           void         *realloc(void *, size_t);
           char         *realpath(const char *restrict, char *restrict);
           unsigned short *seed48(unsigned short [3]);
           int           setenv(const char *, const char *, int);
           void          setkey(const char *);
           char         *setstate(char *);
           void          srand(unsigned);
           void          srand48(long);
           void          srandom(unsigned);
           double        strtod(const char *restrict, char **restrict);
           float         strtof(const char *restrict, char **restrict);
           long          strtol(const char *restrict, char **restrict, int);
           long double   strtold(const char *restrict, char **restrict);
           long long     strtoll(const char *restrict, char **restrict, int);
           unsigned long strtoul(const char *restrict, char **restrict, int);
           unsigned long long
                         strtoull(const char *restrict, char **restrict, int);
           int           system(const char *);
           int           unlockpt(int);
           int           unsetenv(const char *);
           size_t        wcstombs(char *restrict, const wchar_t *restrict, size_t);
           int           wctomb(char *, wchar_t);

       Inclusion of the _<_s_t_d_l_i_b_._h_> header may also make visible all symbols
       from _<_s_t_d_d_e_f_._h_>, _<_l_i_m_i_t_s_._h_>, _<_m_a_t_h_._h_>, and _<_s_y_s_/_w_a_i_t_._h_>.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

RRAATTIIOONNAALLEE
       None.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       <<lliimmiittss..hh>>, <<mmaatthh..hh>>, <<ssttddddeeff..hh>>, <<ssyyss__ttyyppeess..hh>>, <<ssyyss__wwaaiitt..hh>>

       The System Interfaces volume of POSIX.1-2017, _S_e_c_t_i_o_n _2_._2, _T_h_e
       _C_o_m_p_i_l_a_t_i_o_n _E_n_v_i_r_o_n_m_e_n_t, ___E_x_i_t(), _a_6_4_l(), _a_b_o_r_t(), _a_b_s(), _a_t_e_x_i_t(),
       _a_t_o_f(), _a_t_o_i(), _a_t_o_l(), _b_s_e_a_r_c_h(), _c_a_l_l_o_c(), _d_i_v(), _d_r_a_n_d_4_8(), _e_x_i_t(),
       _f_r_e_e(), _g_e_t_e_n_v(), _g_e_t_s_u_b_o_p_t(), _g_r_a_n_t_p_t(), _i_n_i_t_s_t_a_t_e(), _l_a_b_s(), _l_d_i_v(),
       _m_a_l_l_o_c(), _m_b_l_e_n(), _m_b_s_t_o_w_c_s(), _m_b_t_o_w_c(), _m_k_d_t_e_m_p(), _p_o_s_i_x___m_e_m_a_l_i_g_n(),
       _p_o_s_i_x___o_p_e_n_p_t(), _p_t_s_n_a_m_e(), _p_u_t_e_n_v(), _q_s_o_r_t(), _r_a_n_d(), _r_e_a_l_l_o_c(),
       _r_e_a_l_p_a_t_h(), _s_e_t_e_n_v(), _s_e_t_k_e_y(), _s_t_r_t_o_d(), _s_t_r_t_o_l(), _s_t_r_t_o_u_l(),
       _s_y_s_t_e_m(), _u_n_l_o_c_k_p_t(), _u_n_s_e_t_e_n_v(), _w_c_s_t_o_m_b_s(), _w_c_t_o_m_b()

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                          stdlib.h(3)
