xref: /netbsd-src/share/man/man3/stdlib.3 (revision 76c7fc5f6b13ed0b1508e6b313e88e59977ed78e)
1.\" $NetBSD: stdlib.3,v 1.3 2011/04/10 10:02:34 jruoho Exp $
2.\"
3.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jukka Ruohonen.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd April 10, 2011
31.Dt STDLIB 3
32.Os
33.Sh NAME
34.Nm stdlib
35.Nd standard library definitions
36.Sh SYNOPSIS
37.In stdlib.h
38.Sh DESCRIPTION
39The
40.In stdlib.h
41header defines the following types and macros:
42.Bl -enum -offset 4n
43.It
44.Dv NULL
45- an implementation-defined null pointer constant;
46.It
47.Vt size_t
48and
49.Vt wchar_t
50- integer types described in
51.Xr stddef 3 ;
52.It
53.Vt div_t ,
54.Vt ldiv_t ,
55and
56.Vt lldiv_t
57- structures that are returned by the
58.Xr div 3 ,
59.Xr ldiv 3 ,
60and
61.Xr lldiv 3
62functions, respectively;
63.It
64.Dv RAND_MAX
65- a macro which expands to an integer constant
66that is the maximum value returned by the
67.Xr rand 3
68function;
69.It
70.Dv MB_CUR_MAX
71- an integer expression of type
72.Vt size_t
73whose value is the maximum number of bytes in a
74character specified by the current locale; and
75.It
76.Dv EXIT_SUCCESS
77and
78.Dv EXIT_FAILURE
79- macros which expand to integer constants
80suitable for use as an argument to the
81.Xr exit 3
82function.
83.El
84.Pp
85The
86.In stdlib.h
87header also prototypes several important functions such as
88.Xr abort 3 ,
89.Xr atoi 3 ,
90.Xr bsearch 3 ,
91.Xr free 3 ,
92.Xr malloc 3 ,
93and
94.Xr strtol 3 .
95.Sh SEE ALSO
96.Xr stddef 3 ,
97.Xr types 3 ,
98.Xr unistd 3
99.Sh STANDARDS
100As described here, the
101.In stdlib.h
102header conforms to
103.St -isoC-99
104and
105.St -p1003.1-2001 .
106.Sh HISTORY
107In the current form the
108.In stdlib.h
109header was introduced in
110.Nx 0.8 .
111