summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/getenv.322
-rw-r--r--lib/libc/stdlib/getopt_long.324
-rw-r--r--lib/libc/stdlib/hcreate.320
-rw-r--r--lib/libc/stdlib/lsearch.314
-rw-r--r--lib/libc/stdlib/malloc.346
-rw-r--r--lib/libc/stdlib/qsort.312
-rw-r--r--lib/libc/stdlib/random.34
-rw-r--r--lib/libc/stdlib/strtod.34
-rw-r--r--lib/libc/stdlib/tsearch.38
9 files changed, 77 insertions, 77 deletions
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index c5ed228..a75e49f 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -142,6 +142,17 @@ The
.Fn getenv
function conforms to
.St -isoC .
+.Sh HISTORY
+The functions
+.Fn setenv
+and
+.Fn unsetenv
+appeared in
+.At v7 .
+The
+.Fn putenv
+function appeared in
+.Bx 4.3 Reno .
.Sh BUGS
Successive calls to
.Fn setenv
@@ -161,14 +172,3 @@ are copied and that old values remain accessible indefinitely) make this
bug unavoidable.
Future versions may eliminate one or both of these
semantic guarantees in order to fix the bug.
-.Sh HISTORY
-The functions
-.Fn setenv
-and
-.Fn unsetenv
-appeared in
-.At v7 .
-The
-.Fn putenv
-function appeared in
-.Bx 4.3 Reno .
diff --git a/lib/libc/stdlib/getopt_long.3 b/lib/libc/stdlib/getopt_long.3
index e36ff84..352af08 100644
--- a/lib/libc/stdlib/getopt_long.3
+++ b/lib/libc/stdlib/getopt_long.3
@@ -213,6 +213,18 @@ if there was a missing option argument,
.Ql \&?
if the user specified an unknown or ambiguous option, and
\-1 when the argument list has been exhausted.
+.Sh ENVIRONMENT
+.Bl -tag -width ".Ev POSIXLY_CORRECT"
+.It Ev POSIXLY_CORRECT
+If set, option processing stops when the first non-option is found and
+a leading
+.Ql -
+or
+.Ql +
+in the
+.Fa optstring
+is ignored.
+.El
.Sh EXAMPLES
.Bd -literal -compact
int bflag, ch, fd;
@@ -450,18 +462,6 @@ relative
to current positions) are the same, though.
(We do fewer variable swaps.)
.El
-.Sh ENVIRONMENT
-.Bl -tag -width ".Ev POSIXLY_CORRECT"
-.It Ev POSIXLY_CORRECT
-If set, option processing stops when the first non-option is found and
-a leading
-.Ql -
-or
-.Ql +
-in the
-.Fa optstring
-is ignored.
-.El
.Sh SEE ALSO
.Xr getopt 3
.Sh HISTORY
diff --git a/lib/libc/stdlib/hcreate.3 b/lib/libc/stdlib/hcreate.3
index 88943c1..38743af 100644
--- a/lib/libc/stdlib/hcreate.3
+++ b/lib/libc/stdlib/hcreate.3
@@ -133,16 +133,6 @@ could not be found or the
is
.Dv ENTER
and the table is full.
-.Sh ERRORS
-The
-.Fn hcreate
-and
-.Fn hsearch
-functions may fail if:
-.Bl -tag -width Er
-.It Bq Er ENOMEM
-Insufficient storage space is available.
-.El
.Sh EXAMPLES
The following example reads in strings followed by two numbers
and stores them in a hash table, discarding duplicates.
@@ -200,6 +190,16 @@ main(void)
return 0;
}
.Ed
+.Sh ERRORS
+The
+.Fn hcreate
+and
+.Fn hsearch
+functions may fail if:
+.Bl -tag -width Er
+.It Bq Er ENOMEM
+Insufficient storage space is available.
+.El
.Sh SEE ALSO
.Xr bsearch 3 ,
.Xr lsearch 3 ,
diff --git a/lib/libc/stdlib/lsearch.3 b/lib/libc/stdlib/lsearch.3
index e3a324c..5e76724 100644
--- a/lib/libc/stdlib/lsearch.3
+++ b/lib/libc/stdlib/lsearch.3
@@ -85,6 +85,13 @@ if an error occurs.
.Xr bsearch 3 ,
.Xr hsearch 3 ,
.Xr tsearch 3
+.Sh STANDARDS
+The
+.Fn lsearch
+and
+.Fn lfind
+functions conform to
+.St -p1003.1-2001 .
.Sh HISTORY
The
.Fn lsearch
@@ -96,10 +103,3 @@ In
.Fx 5.0 ,
they reappeared conforming to
.St -p1003.1-2001 .
-.Sh STANDARDS
-The
-.Fn lsearch
-and
-.Fn lfind
-functions conform to
-.St -p1003.1-2001 .
diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3
index d2916da..8974f7c 100644
--- a/lib/libc/stdlib/malloc.3
+++ b/lib/libc/stdlib/malloc.3
@@ -262,29 +262,6 @@ and
options are intended for testing and debugging.
An application which changes its behavior when these options are used
is flawed.
-.Sh EXAMPLES
-To set a systemwide reduction of cache size, and to dump core whenever
-a problem occurs:
-.Pp
-.Bd -literal -offset indent
-ln -s 'A<' /etc/malloc.conf
-.Ed
-.Pp
-To specify in the source that a program does no return value checking
-on calls to these functions:
-.Bd -literal -offset indent
-_malloc_options = "X";
-.Ed
-.Sh ENVIRONMENT
-The following environment variables affect the execution of the allocation
-functions:
-.Bl -tag -width ".Ev MALLOC_OPTIONS"
-.It Ev MALLOC_OPTIONS
-If the environment variable
-.Ev MALLOC_OPTIONS
-is set, the characters it contains will be interpreted as flags to the
-allocation functions.
-.El
.Sh RETURN VALUES
The
.Fn malloc
@@ -464,6 +441,29 @@ Even with the
.Dq A
option set, this warning is still only a warning.
.El
+.Sh ENVIRONMENT
+The following environment variables affect the execution of the allocation
+functions:
+.Bl -tag -width ".Ev MALLOC_OPTIONS"
+.It Ev MALLOC_OPTIONS
+If the environment variable
+.Ev MALLOC_OPTIONS
+is set, the characters it contains will be interpreted as flags to the
+allocation functions.
+.El
+.Sh EXAMPLES
+To set a systemwide reduction of cache size, and to dump core whenever
+a problem occurs:
+.Pp
+.Bd -literal -offset indent
+ln -s 'A<' /etc/malloc.conf
+.Ed
+.Pp
+To specify in the source that a program does no return value checking
+on calls to these functions:
+.Bd -literal -offset indent
+_malloc_options = "X";
+.Ed
.Sh SEE ALSO
.Xr brk 2 ,
.Xr mmap 2 ,
diff --git a/lib/libc/stdlib/qsort.3 b/lib/libc/stdlib/qsort.3
index 07777db..a55b2e3 100644
--- a/lib/libc/stdlib/qsort.3
+++ b/lib/libc/stdlib/qsort.3
@@ -209,6 +209,12 @@ functions
return no value.
.Pp
.Rv -std heapsort mergesort
+.Sh COMPATIBILITY
+Previous versions of
+.Fn qsort
+did not permit the comparison routine itself to call
+.Fn qsort 3 .
+This is no longer true.
.Sh ERRORS
The
.Fn heapsort
@@ -234,12 +240,6 @@ or
functions
were unable to allocate memory.
.El
-.Sh COMPATIBILITY
-Previous versions of
-.Fn qsort
-did not permit the comparison routine itself to call
-.Fn qsort 3 .
-This is no longer true.
.Sh SEE ALSO
.Xr sort 1 ,
.Xr radixsort 3
diff --git a/lib/libc/stdlib/random.3 b/lib/libc/stdlib/random.3
index a1dbf8a..70709ca 100644
--- a/lib/libc/stdlib/random.3
+++ b/lib/libc/stdlib/random.3
@@ -168,8 +168,6 @@ generator is greater than
.if t 2\u\s769\s10\d,
.if n 2**69
which should be sufficient for most purposes.
-.Sh AUTHORS
-.An Earl T. Cohen
.Sh DIAGNOSTICS
If
.Fn initstate
@@ -186,6 +184,8 @@ messages are printed on the standard error output.
These
functions appeared in
.Bx 4.2 .
+.Sh AUTHORS
+.An Earl T. Cohen
.Sh BUGS
About 2/3 the speed of
.Xr rand 3 .
diff --git a/lib/libc/stdlib/strtod.3 b/lib/libc/stdlib/strtod.3
index 0fd7003..37092bf 100644
--- a/lib/libc/stdlib/strtod.3
+++ b/lib/libc/stdlib/strtod.3
@@ -154,8 +154,6 @@ function
conforms to
.St -isoC-99 ,
with the exception of the bug noted below.
-.Sh BUGS
-These routines do not recognize the C99 ``NaN(...)'' syntax.
.Sh AUTHORS
The author of this software is
.An David M. Gay .
@@ -183,3 +181,5 @@ IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
.Ed
+.Sh BUGS
+These routines do not recognize the C99 ``NaN(...)'' syntax.
diff --git a/lib/libc/stdlib/tsearch.3 b/lib/libc/stdlib/tsearch.3
index ea0a9da..c0af27f 100644
--- a/lib/libc/stdlib/tsearch.3
+++ b/lib/libc/stdlib/tsearch.3
@@ -107,10 +107,6 @@ a value from the enum
.Sy "typedef enum { preorder, postorder, endorder, leaf } VISIT;"
specifying the traversal type, and a node level (where level
zero is the root of the tree).
-.Sh SEE ALSO
-.Xr bsearch 3 ,
-.Xr hsearch 3 ,
-.Xr lsearch 3
.Sh RETURN VALUES
The
.Fn tsearch
@@ -130,3 +126,7 @@ is NULL or the datum cannot be found.
The
.Fn twalk
function returns no value.
+.Sh SEE ALSO
+.Xr bsearch 3 ,
+.Xr hsearch 3 ,
+.Xr lsearch 3
OpenPOWER on IntegriCloud