NetBSD/share/man/man3/stdlib.3

109 lines
2.8 KiB
Groff

.\" $NetBSD: stdlib.3,v 1.1 2010/03/25 06:56:20 jruoho Exp $
.\"
.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Jukka Ruohonen.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 25, 2010
.Os
.Dt STDLIB 3
.Sh NAME
.Nm stdlib
.Nd standard library definitions
.Sh SYNOPSIS
.In stdlib.h
.Sh DESCRIPTION
The
.In stdlib.h
header defines the following types and macros:
.Bl -enum -offset 4n
.It
.Dv NULL
- an implementation-defined null pointer constant;
.It
.Vt size_t
and
.Vt wchar_t
- integer types described in
.Xr stddef 3 ;
.It
.Vt div_t ,
.Vt ldiv_t ,
and
.Vt lldiv_t
- structures that are returned by the
.Xr div 3 ,
.Xr ldiv 3 ,
and
.Xr lldiv 3
functions, respectively;
.It
.Dv RAND_MAX
- a macro which expands to an integer constant
that is the maximum value returned by the
.Xr rand 3
function;
.It
.Dv MB_CUR_MAX
- an integer expression of type
.Vt size_t
whose value is the maximum number of bytes in a
character specified by the current locale; and
.It
.Dv EXIT_SUCCESS
and
.Dv EXIT_FAILURE
- macros which expand to integer constants
suitable for use as an argument to the
.Xr exit 3
function.
.El
.Pp
The
.In stdlib.h
header also prototypes several important functions such as
.Xr abort 3 ,
.Xr atoi 3 ,
.Xr bsearch 3 ,
.Xr free 3 ,
.Xr malloc 3 ,
and
.Xr strtol 3 .
.Sh SEE ALSO
.Xr stddef 3
.Sh STANDARDS
As described here, the
.In stdlib.h
header conforms to
.St -isoC-99
and
.St -p1003.1-2001 .
.Sh HISTORY
In the current form the
.In stdlib.h
header was introduced in
.Nx 0.8 .