diff options
author | aaron <> | 2000-04-20 13:50:03 +0000 |
---|---|---|
committer | aaron <> | 2000-04-20 13:50:03 +0000 |
commit | a4336f357f9e30dffdfad4909b24bd2e82c096a2 (patch) | |
tree | c79a224a41eb2c48668c4b4eda84163d7daadf64 | |
parent | 92b3e44bedaf5a5f85880565a47206cdbf9bfa2a (diff) | |
download | openbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.tar.gz openbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.tar.bz2 openbsd-a4336f357f9e30dffdfad4909b24bd2e82c096a2.zip |
Flesh out stdlib function man pages.
28 files changed, 195 insertions, 246 deletions
diff --git a/src/lib/libc/stdlib/a64l.3 b/src/lib/libc/stdlib/a64l.3 index 1074dbff2e..787634303c 100644 --- a/src/lib/libc/stdlib/a64l.3 +++ b/src/lib/libc/stdlib/a64l.3 | |||
@@ -1,4 +1,3 @@ | |||
1 | .\" | ||
2 | .\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> | 1 | .\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> |
3 | .\" All rights reserved. | 2 | .\" All rights reserved. |
4 | .\" | 3 | .\" |
@@ -24,7 +23,7 @@ | |||
24 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 23 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | .\" | 25 | .\" |
27 | .\" $OpenBSD: a64l.3,v 1.4 1999/06/29 18:36:15 aaron Exp $ | 26 | .\" $OpenBSD: a64l.3,v 1.5 2000/04/20 13:50:01 aaron Exp $ |
28 | .\" | 27 | .\" |
29 | .Dd August 17, 1997 | 28 | .Dd August 17, 1997 |
30 | .Dt A64L 3 | 29 | .Dt A64L 3 |
@@ -46,9 +45,9 @@ and | |||
46 | .Fn l64a | 45 | .Fn l64a |
47 | functions are used to maintain numbers stored in radix-64 | 46 | functions are used to maintain numbers stored in radix-64 |
48 | .Tn ASCII | 47 | .Tn ASCII |
49 | characters. This is a notation by which 32-bit integers | 48 | characters. |
50 | can be represented by up to six characters; each character | 49 | This is a notation by which 32-bit integers |
51 | represents a | 50 | can be represented by up to six characters; each character represents a |
52 | .Dq digit | 51 | .Dq digit |
53 | in a radix-64 notation. | 52 | in a radix-64 notation. |
54 | .Pp | 53 | .Pp |
@@ -73,14 +72,16 @@ for 38-63. | |||
73 | The | 72 | The |
74 | .Fn a64l | 73 | .Fn a64l |
75 | function takes a pointer to a null-terminated radix-64 representation | 74 | function takes a pointer to a null-terminated radix-64 representation |
76 | and returns a corresponding 32-bit value. If the string pointed to by | 75 | and returns a corresponding 32-bit value. |
76 | If the string pointed to by | ||
77 | .Fa s | 77 | .Fa s |
78 | contains more than six characters, | 78 | contains more than six characters, |
79 | .Fn a64l | 79 | .Fn a64l |
80 | will use the first six. | 80 | will use the first six. |
81 | .Fn a64l | 81 | .Fn a64l |
82 | scans the character string from left to right, decoding | 82 | scans the character string from left to right, decoding |
83 | each character as a 6-bit radix-64 number. If a long integer is | 83 | each character as a 6-bit radix-64 number. |
84 | If a long integer is | ||
84 | larger than 32 bits, the return value will be sign-extended. | 85 | larger than 32 bits, the return value will be sign-extended. |
85 | .Pp | 86 | .Pp |
86 | .Fn l64a | 87 | .Fn l64a |
diff --git a/src/lib/libc/stdlib/abort.3 b/src/lib/libc/stdlib/abort.3 index a0dfba7e80..743d42dd8a 100644 --- a/src/lib/libc/stdlib/abort.3 +++ b/src/lib/libc/stdlib/abort.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: abort.3,v 1.5 1999/06/29 18:36:17 aaron Exp $ | 36 | .\" $OpenBSD: abort.3,v 1.6 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ABORT 3 | 39 | .Dt ABORT 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn abort | 50 | .Fn abort |
51 | function causes abnormal program termination to occur, unless the | 51 | function causes abnormal program termination to occur, unless the signal |
52 | signal | ||
53 | .Dv SIGABRT | 52 | .Dv SIGABRT |
54 | is being caught and the signal handler does not return. | 53 | is being caught and the signal handler does not return. |
55 | .Pp | 54 | .Pp |
@@ -57,14 +56,12 @@ Any open streams are flushed and closed. | |||
57 | .Sh RETURN VALUES | 56 | .Sh RETURN VALUES |
58 | The | 57 | The |
59 | .Fn abort | 58 | .Fn abort |
60 | function | 59 | function never returns. |
61 | never returns. | ||
62 | .Sh SEE ALSO | 60 | .Sh SEE ALSO |
63 | .Xr sigaction 2 , | 61 | .Xr sigaction 2 , |
64 | .Xr exit 3 | 62 | .Xr exit 3 |
65 | .Sh STANDARDS | 63 | .Sh STANDARDS |
66 | The | 64 | The |
67 | .Fn abort | 65 | .Fn abort |
68 | function | 66 | function conforms to |
69 | conforms to | ||
70 | .St -p1003.1-90 . | 67 | .St -p1003.1-90 . |
diff --git a/src/lib/libc/stdlib/abs.3 b/src/lib/libc/stdlib/abs.3 index 1e3675d7b5..0f7c097ade 100644 --- a/src/lib/libc/stdlib/abs.3 +++ b/src/lib/libc/stdlib/abs.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: abs.3,v 1.4 1999/06/29 18:36:17 aaron Exp $ | 36 | .\" $OpenBSD: abs.3,v 1.5 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ABS 3 | 39 | .Dt ABS 3 |
@@ -48,16 +48,12 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn abs | 50 | .Fn abs |
51 | function | 51 | function computes the absolute value of the integer |
52 | computes | ||
53 | the absolute value of the integer | ||
54 | .Fa j . | 52 | .Fa j . |
55 | .Sh RETURN VALUES | 53 | .Sh RETURN VALUES |
56 | The | 54 | The |
57 | .Fn abs | 55 | .Fn abs |
58 | function | 56 | function returns the absolute value. |
59 | returns | ||
60 | the absolute value. | ||
61 | .Sh SEE ALSO | 57 | .Sh SEE ALSO |
62 | .Xr cabs 3 , | 58 | .Xr cabs 3 , |
63 | .Xr floor 3 , | 59 | .Xr floor 3 , |
diff --git a/src/lib/libc/stdlib/alloca.3 b/src/lib/libc/stdlib/alloca.3 index 56d52ebe1b..e9e0b67ee3 100644 --- a/src/lib/libc/stdlib/alloca.3 +++ b/src/lib/libc/stdlib/alloca.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: alloca.3,v 1.7 1999/06/29 18:36:18 aaron Exp $ | 32 | .\" $OpenBSD: alloca.3,v 1.8 2000/04/20 13:50:01 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd May 2, 1991 | 34 | .Dd May 2, 1991 |
35 | .Dt ALLOCA 3 | 35 | .Dt ALLOCA 3 |
@@ -44,12 +44,10 @@ | |||
44 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
45 | The | 45 | The |
46 | .Fn alloca | 46 | .Fn alloca |
47 | function | 47 | function allocates |
48 | allocates | ||
49 | .Fa size | 48 | .Fa size |
50 | bytes of space in the stack frame of the caller. | 49 | bytes of space in the stack frame of the caller. |
51 | This temporary space is automatically freed on | 50 | This temporary space is automatically freed on return. |
52 | return. | ||
53 | .Sh RETURN VALUES | 51 | .Sh RETURN VALUES |
54 | The | 52 | The |
55 | .Fn alloca | 53 | .Fn alloca |
@@ -63,8 +61,7 @@ function returns a pointer to the beginning of the allocated space. | |||
63 | .Sh BUGS | 61 | .Sh BUGS |
64 | The | 62 | The |
65 | .Fn alloca | 63 | .Fn alloca |
66 | function | 64 | function is machine dependent; its use is discouraged. |
67 | is machine dependent; its use is discouraged. | ||
68 | .\" .Sh HISTORY | 65 | .\" .Sh HISTORY |
69 | .\" The | 66 | .\" The |
70 | .\" .Fn alloca | 67 | .\" .Fn alloca |
diff --git a/src/lib/libc/stdlib/atexit.3 b/src/lib/libc/stdlib/atexit.3 index cc37d08b00..5d79ede649 100644 --- a/src/lib/libc/stdlib/atexit.3 +++ b/src/lib/libc/stdlib/atexit.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: atexit.3,v 1.3 1999/06/29 18:36:18 aaron Exp $ | 36 | .\" $OpenBSD: atexit.3,v 1.4 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ATEXIT 3 | 39 | .Dt ATEXIT 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn atexit | 50 | .Fn atexit |
51 | function | 51 | function registers the given |
52 | registers the given | ||
53 | .Fa function | 52 | .Fa function |
54 | to be called at program exit, whether via | 53 | to be called at program exit, whether via |
55 | .Xr exit 3 | 54 | .Xr exit 3 |
@@ -72,6 +71,5 @@ The existing list of functions is unmodified. | |||
72 | .Sh STANDARDS | 71 | .Sh STANDARDS |
73 | The | 72 | The |
74 | .Fn atexit | 73 | .Fn atexit |
75 | function | 74 | function conforms to |
76 | conforms to | ||
77 | .St -ansiC . | 75 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/atoi.3 b/src/lib/libc/stdlib/atoi.3 index 80831bdd2f..69b94be70c 100644 --- a/src/lib/libc/stdlib/atoi.3 +++ b/src/lib/libc/stdlib/atoi.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: atoi.3,v 1.4 1999/09/13 07:14:13 deraadt Exp $ | 36 | .\" $OpenBSD: atoi.3,v 1.5 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 4, 1993 | 38 | .Dd June 4, 1993 |
39 | .Dt ATOI 3 | 39 | .Dt ATOI 3 |
@@ -66,7 +66,8 @@ does no overflow checking, handles unsigned numbers poorly, | |||
66 | and handles strings containing trailing extra characters | 66 | and handles strings containing trailing extra characters |
67 | (like | 67 | (like |
68 | .Dq "123abc" Ns ) | 68 | .Dq "123abc" Ns ) |
69 | poorly. Careful use of | 69 | poorly. |
70 | Careful use of | ||
70 | .Xr strtol 3 | 71 | .Xr strtol 3 |
71 | and | 72 | and |
72 | .Xr strtoul 3 | 73 | .Xr strtoul 3 |
diff --git a/src/lib/libc/stdlib/atol.3 b/src/lib/libc/stdlib/atol.3 index c7b4ff30da..53a518997f 100644 --- a/src/lib/libc/stdlib/atol.3 +++ b/src/lib/libc/stdlib/atol.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: atol.3,v 1.3 1999/06/29 18:36:19 aaron Exp $ | 36 | .\" $OpenBSD: atol.3,v 1.4 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt ATOL 3 | 39 | .Dt ATOL 3 |
@@ -69,6 +69,5 @@ strtol(nptr, (char **)NULL, 10); | |||
69 | .Sh STANDARDS | 69 | .Sh STANDARDS |
70 | The | 70 | The |
71 | .Fn atol | 71 | .Fn atol |
72 | function | 72 | function conforms to |
73 | conforms to | ||
74 | .St -ansiC . | 73 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/bsearch.3 b/src/lib/libc/stdlib/bsearch.3 index 63d4e6af69..9bb9d4ece4 100644 --- a/src/lib/libc/stdlib/bsearch.3 +++ b/src/lib/libc/stdlib/bsearch.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: bsearch.3,v 1.4 1999/06/29 18:36:19 aaron Exp $ | 36 | .\" $OpenBSD: bsearch.3,v 1.5 2000/04/20 13:50:01 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd April 19, 1994 | 38 | .Dd April 19, 1994 |
39 | .Dt BSEARCH 3 | 39 | .Dt BSEARCH 3 |
@@ -63,9 +63,7 @@ to the comparison function referenced by | |||
63 | .Fa compar . | 63 | .Fa compar . |
64 | The | 64 | The |
65 | .Fa compar | 65 | .Fa compar |
66 | routine | 66 | routine is expected to have two arguments which point to the |
67 | is expected to have | ||
68 | two arguments which point to the | ||
69 | .Fa key | 67 | .Fa key |
70 | object and to an array member, in that order, and should return an integer | 68 | object and to an array member, in that order, and should return an integer |
71 | less than, equal to, or greater than zero if the | 69 | less than, equal to, or greater than zero if the |
diff --git a/src/lib/libc/stdlib/div.3 b/src/lib/libc/stdlib/div.3 index 5cc3b8757c..1f651d7fd3 100644 --- a/src/lib/libc/stdlib/div.3 +++ b/src/lib/libc/stdlib/div.3 | |||
@@ -31,7 +31,7 @@ | |||
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
33 | .\" | 33 | .\" |
34 | .\" $OpenBSD: div.3,v 1.4 1999/06/29 18:36:19 aaron Exp $ | 34 | .\" $OpenBSD: div.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
35 | .\" | 35 | .\" |
36 | .Dd April 19, 1991 | 36 | .Dd April 19, 1991 |
37 | .Dt DIV 3 | 37 | .Dt DIV 3 |
@@ -46,8 +46,7 @@ | |||
46 | .Sh DESCRIPTION | 46 | .Sh DESCRIPTION |
47 | The | 47 | The |
48 | .Fn div | 48 | .Fn div |
49 | function | 49 | function computes the value |
50 | computes the value | ||
51 | .Fa num Ns No / Ns Fa denom | 50 | .Fa num Ns No / Ns Fa denom |
52 | and returns the quotient and remainder in a structure named | 51 | and returns the quotient and remainder in a structure named |
53 | .Fa div_t | 52 | .Fa div_t |
@@ -64,6 +63,5 @@ and | |||
64 | .Sh STANDARDS | 63 | .Sh STANDARDS |
65 | The | 64 | The |
66 | .Fn div | 65 | .Fn div |
67 | function | 66 | function conforms to |
68 | conforms to | ||
69 | .St -ansiC . | 67 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/exit.3 b/src/lib/libc/stdlib/exit.3 index 326c5539a8..a17c1805f2 100644 --- a/src/lib/libc/stdlib/exit.3 +++ b/src/lib/libc/stdlib/exit.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: exit.3,v 1.3 1999/02/27 21:55:55 deraadt Exp $ | 36 | .\" $OpenBSD: exit.3,v 1.4 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt EXIT 3 | 39 | .Dt EXIT 3 |
@@ -46,8 +46,9 @@ | |||
46 | .Ft void | 46 | .Ft void |
47 | .Fn exit "int status" | 47 | .Fn exit "int status" |
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | ||
49 | .Fn exit | 50 | .Fn exit |
50 | terminates a process. | 51 | function terminates a process. |
51 | .Pp | 52 | .Pp |
52 | Before termination it performs the following functions in the | 53 | Before termination it performs the following functions in the |
53 | order listed: | 54 | order listed: |
@@ -68,8 +69,7 @@ function. | |||
68 | .Sh RETURN VALUES | 69 | .Sh RETURN VALUES |
69 | The | 70 | The |
70 | .Fn exit | 71 | .Fn exit |
71 | function | 72 | function never returns. |
72 | never returns. | ||
73 | .Sh SEE ALSO | 73 | .Sh SEE ALSO |
74 | .Xr _exit 2 , | 74 | .Xr _exit 2 , |
75 | .Xr atexit 3 , | 75 | .Xr atexit 3 , |
@@ -78,6 +78,5 @@ never returns. | |||
78 | .Sh STANDARDS | 78 | .Sh STANDARDS |
79 | The | 79 | The |
80 | .Fn exit | 80 | .Fn exit |
81 | function | 81 | function conforms to |
82 | conforms to | ||
83 | .St -ansiC . | 82 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/getenv.3 b/src/lib/libc/stdlib/getenv.3 index d6ffc8b1dd..b2aa0080d6 100644 --- a/src/lib/libc/stdlib/getenv.3 +++ b/src/lib/libc/stdlib/getenv.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: getenv.3,v 1.6 1999/09/06 23:26:30 aaron Exp $ | 36 | .\" $OpenBSD: getenv.3,v 1.7 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd December 11, 1993 | 38 | .Dd December 11, 1993 |
39 | .Dt GETENV 3 | 39 | .Dt GETENV 3 |
@@ -55,17 +55,13 @@ | |||
55 | .Ft void | 55 | .Ft void |
56 | .Fn unsetenv "const char *name" | 56 | .Fn unsetenv "const char *name" |
57 | .Sh DESCRIPTION | 57 | .Sh DESCRIPTION |
58 | These functions set, unset and fetch environment variables from the | 58 | These functions set, unset, and fetch environment variables from the host |
59 | host | ||
60 | .Em environment list . | 59 | .Em environment list . |
61 | For compatibility with differing environment conventions, | 60 | For compatibility with differing environment conventions, the given arguments |
62 | the given arguments | ||
63 | .Fa name | 61 | .Fa name |
64 | and | 62 | and |
65 | .Fa value | 63 | .Fa value |
66 | may be appended and prepended, | 64 | may be appended and prepended, respectively, with an equal sign |
67 | respectively, | ||
68 | with an equal sign | ||
69 | .Dq Li \&= . | 65 | .Dq Li \&= . |
70 | .Pp | 66 | .Pp |
71 | The | 67 | The |
@@ -74,8 +70,7 @@ function obtains the current value of the environment variable, | |||
74 | .Fa name . | 70 | .Fa name . |
75 | If the variable | 71 | If the variable |
76 | .Fa name | 72 | .Fa name |
77 | is not in the current environment, | 73 | is not in the current environment, a null pointer is returned. |
78 | a null pointer is returned. | ||
79 | .Pp | 74 | .Pp |
80 | The | 75 | The |
81 | .Fn setenv | 76 | .Fn setenv |
@@ -84,30 +79,27 @@ function inserts or resets the environment variable | |||
84 | in the current environment list. | 79 | in the current environment list. |
85 | If the variable | 80 | If the variable |
86 | .Fa name | 81 | .Fa name |
87 | does not exist in the list, | 82 | does not exist in the list, it is inserted with the given |
88 | it is inserted with the given | ||
89 | .Fa value . | 83 | .Fa value . |
90 | If the variable does exist, the argument | 84 | If the variable does exist, the argument |
91 | .Fa overwrite | 85 | .Fa overwrite |
92 | is tested; if | 86 | is tested; if |
93 | .Fa overwrite | 87 | .Fa overwrite |
94 | is zero, | 88 | is zero, the variable is not reset, otherwise it is reset to the given |
95 | the variable is not reset, otherwise it is reset | ||
96 | to the given | ||
97 | .Fa value . | 89 | .Fa value . |
98 | .Pp | 90 | .Pp |
99 | The | 91 | The |
100 | .Fn putenv | 92 | .Fn putenv |
101 | function takes an argument of the form ``name=value'' and is | 93 | function takes an argument of the form |
102 | equivalent to: | 94 | .Ar name Ns No = Ns Ar value |
95 | and is equivalent to: | ||
103 | .Bd -literal -offset indent | 96 | .Bd -literal -offset indent |
104 | setenv(name, value, 1); | 97 | setenv(name, value, 1); |
105 | .Ed | 98 | .Ed |
106 | .Pp | 99 | .Pp |
107 | The | 100 | The |
108 | .Fn unsetenv | 101 | .Fn unsetenv |
109 | function | 102 | function deletes all instances of the variable name pointed to by |
110 | deletes all instances of the variable name pointed to by | ||
111 | .Fa name | 103 | .Fa name |
112 | from the list. | 104 | from the list. |
113 | .Sh RETURN VALUES | 105 | .Sh RETURN VALUES |
@@ -117,8 +109,7 @@ and | |||
117 | .Fn putenv | 109 | .Fn putenv |
118 | return zero if successful; otherwise the global variable | 110 | return zero if successful; otherwise the global variable |
119 | .Va errno | 111 | .Va errno |
120 | is set to indicate the error and a | 112 | is set to indicate the error and \-1 is returned. |
121 | \-1 is returned. | ||
122 | .Pp | 113 | .Pp |
123 | If | 114 | If |
124 | .Fn getenv | 115 | .Fn getenv |
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index 637a81f1f0..ef132cafc5 100644 --- a/src/lib/libc/stdlib/getopt.3 +++ b/src/lib/libc/stdlib/getopt.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: getopt.3,v 1.12 2000/03/04 22:19:31 aaron Exp $ | 32 | .\" $OpenBSD: getopt.3,v 1.13 2000/04/20 13:50:02 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1994 | 34 | .Dd April 19, 1994 |
35 | .Dt GETOPT 3 | 35 | .Dt GETOPT 3 |
@@ -51,27 +51,25 @@ The | |||
51 | .Fn getopt | 51 | .Fn getopt |
52 | function incrementally parses a command line argument list | 52 | function incrementally parses a command line argument list |
53 | .Fa argv | 53 | .Fa argv |
54 | and returns the next | 54 | and returns the next known option character. |
55 | .Em known | ||
56 | option character. | ||
57 | An option character is | 55 | An option character is |
58 | .Em known | 56 | .Dq known |
59 | if it has been specified in the string of accepted option characters, | 57 | if it has been specified in the string of accepted option characters, |
60 | .Fa optstring . | 58 | .Fa optstring . |
61 | .Pp | 59 | .Pp |
62 | The option string | 60 | The option string |
63 | .Fa optstring | 61 | .Fa optstring |
64 | may contain the following elements: individual characters, and | 62 | may contain the following elements: individual characters and |
65 | characters followed by a colon to indicate an option argument | 63 | characters followed by a colon to indicate an option argument |
66 | is to follow. | 64 | is to follow. |
67 | For example, an option string | 65 | For example, an option string |
68 | .Li "\&""x"" | 66 | .Qq x |
69 | recognizes an option | 67 | recognizes an option |
70 | .Dq Fl x , | 68 | .Fl x , |
71 | and an option string | 69 | and an option string |
72 | .Li "\&""x:"" | 70 | .Qq Li x: |
73 | recognizes an option and argument | 71 | recognizes an option and argument |
74 | .Dq Fl x Ar argument . | 72 | .Fl x Ar argument . |
75 | It does not matter to | 73 | It does not matter to |
76 | .Fn getopt | 74 | .Fn getopt |
77 | if a following argument has leading whitespace. | 75 | if a following argument has leading whitespace. |
@@ -89,12 +87,10 @@ to | |||
89 | .Fn getopt . | 87 | .Fn getopt . |
90 | The variable | 88 | The variable |
91 | .Va optopt | 89 | .Va optopt |
92 | saves the last | 90 | saves the last known option character returned by |
93 | .Em known | ||
94 | option character returned by | ||
95 | .Fn getopt . | 91 | .Fn getopt . |
96 | .Pp | 92 | .Pp |
97 | The variable | 93 | The variables |
98 | .Va opterr | 94 | .Va opterr |
99 | and | 95 | and |
100 | .Va optind | 96 | .Va optind |
@@ -119,9 +115,7 @@ must be reinitialized. | |||
119 | .Pp | 115 | .Pp |
120 | The | 116 | The |
121 | .Fn getopt | 117 | .Fn getopt |
122 | function | 118 | function returns \-1 when the argument list is exhausted. |
123 | returns \-1 | ||
124 | when the argument list is exhausted. | ||
125 | The interpretation of options in the argument list may be cancelled | 119 | The interpretation of options in the argument list may be cancelled |
126 | by the option | 120 | by the option |
127 | .Ql -- | 121 | .Ql -- |
@@ -157,9 +151,8 @@ then a missing option argument causes a | |||
157 | to be returned in addition to suppressing any error messages. | 151 | to be returned in addition to suppressing any error messages. |
158 | .Pp | 152 | .Pp |
159 | Option arguments are allowed to begin with | 153 | Option arguments are allowed to begin with |
160 | .Dq Li \- ; | 154 | .Ql - ; |
161 | this is reasonable but | 155 | this is reasonable but reduces the amount of error checking possible. |
162 | reduces the amount of error checking possible. | ||
163 | .Sh EXTENSIONS | 156 | .Sh EXTENSIONS |
164 | The | 157 | The |
165 | .Va optreset | 158 | .Va optreset |
diff --git a/src/lib/libc/stdlib/getsubopt.3 b/src/lib/libc/stdlib/getsubopt.3 index 0ea48864c3..a5f98e5d96 100644 --- a/src/lib/libc/stdlib/getsubopt.3 +++ b/src/lib/libc/stdlib/getsubopt.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: getsubopt.3,v 1.3 1999/06/29 18:36:20 aaron Exp $ | 1 | .\" $OpenBSD: getsubopt.3,v 1.4 2000/04/20 13:50:02 aaron Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. |
@@ -41,15 +41,14 @@ | |||
41 | .Nd get sub options from an argument | 41 | .Nd get sub options from an argument |
42 | .Sh SYNOPSIS | 42 | .Sh SYNOPSIS |
43 | .Fd #include <stdlib.h> | 43 | .Fd #include <stdlib.h> |
44 | .Vt extern char *suboptarg | 44 | .Vt extern char *suboptarg; |
45 | .Ft int | 45 | .Ft int |
46 | .Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep" | 46 | .Fn getsubopt "char **optionp" "char * const *tokens" "char **valuep" |
47 | .Sh DESCRIPTION | 47 | .Sh DESCRIPTION |
48 | The | 48 | The |
49 | .Fn getsubopt | 49 | .Fn getsubopt |
50 | function | 50 | function parses a string containing tokens delimited by one or more |
51 | parses a string containing tokens delimited by one or more tab, space or | 51 | tab, space or comma |
52 | comma | ||
53 | .Pq Ql \&, | 52 | .Pq Ql \&, |
54 | characters. | 53 | characters. |
55 | It is intended for use in parsing groups of option arguments provided | 54 | It is intended for use in parsing groups of option arguments provided |
@@ -60,22 +59,24 @@ The argument | |||
60 | is a pointer to a pointer to the string. | 59 | is a pointer to a pointer to the string. |
61 | The argument | 60 | The argument |
62 | .Fa tokens | 61 | .Fa tokens |
63 | is a pointer to a null-terminated | 62 | is a pointer to a null-terminated array of pointers to strings. |
64 | array of pointers to strings. | ||
65 | .Pp | 63 | .Pp |
66 | The | 64 | The |
67 | .Fn getsubopt | 65 | .Fn getsubopt |
68 | function | 66 | function returns the zero-based offset of the pointer in the |
69 | returns the zero-based offset of the pointer in the | ||
70 | .Fa tokens | 67 | .Fa tokens |
71 | array referencing a string which matches the first token | 68 | array referencing a string which matches the first token |
72 | in the string, or, \-1 if the string contains no tokens or | 69 | in the string, or, \-1 if the string contains no tokens or |
73 | .Fa tokens | 70 | .Fa tokens |
74 | does not contain a matching string. | 71 | does not contain a matching string. |
75 | .Pp | 72 | .Pp |
76 | If the token is of the form ``name=value'', the location referenced by | 73 | If the token is of the form |
74 | .Ar name Ns No = Ns Ar value , | ||
75 | the location referenced by | ||
77 | .Fa valuep | 76 | .Fa valuep |
78 | will be set to point to the start of the ``value'' portion of the token. | 77 | will be set to point to the start of the |
78 | .Dq value | ||
79 | portion of the token. | ||
79 | .Pp | 80 | .Pp |
80 | On return from | 81 | On return from |
81 | .Fn getsubopt , | 82 | .Fn getsubopt , |
@@ -86,13 +87,12 @@ The external variable | |||
86 | .Fa suboptarg | 87 | .Fa suboptarg |
87 | will be set to point to the start of the current token, or | 88 | will be set to point to the start of the current token, or |
88 | .Dv NULL | 89 | .Dv NULL |
89 | if no | 90 | if no tokens were present. |
90 | tokens were present. | ||
91 | The argument | 91 | The argument |
92 | .Fa valuep | 92 | .Fa valuep |
93 | will be set to point to the ``value'' portion of the token, or | 93 | will be set to point to the value portion of the token, or |
94 | .Dv NULL | 94 | .Dv NULL |
95 | if no ``value'' portion was present. | 95 | if no value portion was present. |
96 | .Sh EXAMPLE | 96 | .Sh EXAMPLE |
97 | .Bd -literal -compact | 97 | .Bd -literal -compact |
98 | char *tokens[] = { | 98 | char *tokens[] = { |
diff --git a/src/lib/libc/stdlib/labs.3 b/src/lib/libc/stdlib/labs.3 index de0b76ba1f..fe39ca24dc 100644 --- a/src/lib/libc/stdlib/labs.3 +++ b/src/lib/libc/stdlib/labs.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: labs.3,v 1.4 1999/06/29 18:36:20 aaron Exp $ | 36 | .\" $OpenBSD: labs.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt LABS 3 | 39 | .Dt LABS 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn labs | 50 | .Fn labs |
51 | function | 51 | function returns the absolute value of the long integer |
52 | returns the absolute value of the long integer | ||
53 | .Fa j . | 52 | .Fa j . |
54 | .Sh SEE ALSO | 53 | .Sh SEE ALSO |
55 | .Xr abs 3 , | 54 | .Xr abs 3 , |
@@ -59,8 +58,7 @@ returns the absolute value of the long integer | |||
59 | .Sh STANDARDS | 58 | .Sh STANDARDS |
60 | The | 59 | The |
61 | .Fn labs | 60 | .Fn labs |
62 | function | 61 | function conforms to |
63 | conforms to | ||
64 | .St -ansiC . | 62 | .St -ansiC . |
65 | .Sh BUGS | 63 | .Sh BUGS |
66 | The absolute value of the most negative integer remains negative. | 64 | The absolute value of the most negative integer remains negative. |
diff --git a/src/lib/libc/stdlib/ldiv.3 b/src/lib/libc/stdlib/ldiv.3 index 60b35dc98f..b5301b1b21 100644 --- a/src/lib/libc/stdlib/ldiv.3 +++ b/src/lib/libc/stdlib/ldiv.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: ldiv.3,v 1.4 1999/06/29 18:36:21 aaron Exp $ | 36 | .\" $OpenBSD: ldiv.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt LDIV 3 | 39 | .Dt LDIV 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn ldiv | 50 | .Fn ldiv |
51 | function | 51 | function computes the value |
52 | computes the value | ||
53 | .Fa num Ns No / Ns Fa denom | 52 | .Fa num Ns No / Ns Fa denom |
54 | and returns the quotient and remainder in a structure named | 53 | and returns the quotient and remainder in a structure named |
55 | .Li ldiv_t | 54 | .Li ldiv_t |
@@ -66,6 +65,5 @@ and | |||
66 | .Sh STANDARDS | 65 | .Sh STANDARDS |
67 | The | 66 | The |
68 | .Fn ldiv | 67 | .Fn ldiv |
69 | function | 68 | function conforms to |
70 | conforms to | ||
71 | .St -ansiC . | 69 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/memory.3 b/src/lib/libc/stdlib/memory.3 index 61bae4cc3c..959a173a03 100644 --- a/src/lib/libc/stdlib/memory.3 +++ b/src/lib/libc/stdlib/memory.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: memory.3,v 1.4 1999/05/23 14:11:03 aaron Exp $ | 32 | .\" $OpenBSD: memory.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd May 2, 1991 | 34 | .Dd May 2, 1991 |
35 | .Dt MEMORY 3 | 35 | .Dt MEMORY 3 |
@@ -55,8 +55,7 @@ | |||
55 | .Fn alloca "size_t size" | 55 | .Fn alloca "size_t size" |
56 | .Sh DESCRIPTION | 56 | .Sh DESCRIPTION |
57 | These functions allocate and free memory for the calling process. | 57 | These functions allocate and free memory for the calling process. |
58 | They are described in the | 58 | They are described in the individual man pages. |
59 | individual manual pages. | ||
60 | .Sh SEE ALSO | 59 | .Sh SEE ALSO |
61 | .Xr alloca 3 , | 60 | .Xr alloca 3 , |
62 | .Xr calloc 3 , | 61 | .Xr calloc 3 , |
@@ -65,6 +64,6 @@ individual manual pages. | |||
65 | .Xr realloc 3 | 64 | .Xr realloc 3 |
66 | .Sh STANDARDS | 65 | .Sh STANDARDS |
67 | These functions, with the exception of | 66 | These functions, with the exception of |
68 | .Fn alloca | 67 | .Fn alloca , |
69 | conform to | 68 | conform to |
70 | .St -ansiC . | 69 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/qabs.3 b/src/lib/libc/stdlib/qabs.3 index 0f7ccdc78f..ef0307ab25 100644 --- a/src/lib/libc/stdlib/qabs.3 +++ b/src/lib/libc/stdlib/qabs.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: qabs.3,v 1.4 1999/06/29 18:36:21 aaron Exp $ | 36 | .\" $OpenBSD: qabs.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt QABS 3 | 39 | .Dt QABS 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn qabs | 50 | .Fn qabs |
51 | function | 51 | function returns the absolute value of the quad integer |
52 | returns the absolute value of the quad integer | ||
53 | .Fa j . | 52 | .Fa j . |
54 | .Sh SEE ALSO | 53 | .Sh SEE ALSO |
55 | .Xr abs 3 , | 54 | .Xr abs 3 , |
diff --git a/src/lib/libc/stdlib/qsort.3 b/src/lib/libc/stdlib/qsort.3 index 8d665187bf..632909dd3c 100644 --- a/src/lib/libc/stdlib/qsort.3 +++ b/src/lib/libc/stdlib/qsort.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: qsort.3,v 1.4 1999/06/29 18:36:22 aaron Exp $ | 36 | .\" $OpenBSD: qsort.3,v 1.5 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 4, 1993 | 38 | .Dd June 4, 1993 |
39 | .Dt QSORT 3 | 39 | .Dt QSORT 3 |
@@ -105,7 +105,9 @@ is stable. | |||
105 | .Pp | 105 | .Pp |
106 | The | 106 | The |
107 | .Fn qsort | 107 | .Fn qsort |
108 | function is an implementation of C.A.R. Hoare's ``quicksort'' algorithm, | 108 | function is an implementation of C.A.R. Hoare's |
109 | .Dq quicksort | ||
110 | algorithm, | ||
109 | a variant of partition-exchange sorting; in particular, see D.E. Knuth's | 111 | a variant of partition-exchange sorting; in particular, see D.E. Knuth's |
110 | Algorithm Q. | 112 | Algorithm Q. |
111 | .Fn qsort | 113 | .Fn qsort |
@@ -115,7 +117,9 @@ O N**2 worst-case behavior. | |||
115 | .Pp | 117 | .Pp |
116 | The | 118 | The |
117 | .Fn heapsort | 119 | .Fn heapsort |
118 | function is an implementation of J.W.J. William's ``heapsort'' algorithm, | 120 | function is an implementation of J.W.J. William's |
121 | .Dq heapsort | ||
122 | algorithm, | ||
119 | a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H. | 123 | a variant of selection sorting; in particular, see D.E. Knuth's Algorithm H. |
120 | .Fn heapsort | 124 | .Fn heapsort |
121 | takes O N lg N worst-case time. | 125 | takes O N lg N worst-case time. |
@@ -143,13 +147,11 @@ is faster than | |||
143 | .Fn mergesort | 147 | .Fn mergesort |
144 | is faster than | 148 | is faster than |
145 | .Fn heapsort . | 149 | .Fn heapsort . |
146 | Memory availability and pre-existing order in the data can make this | 150 | Memory availability and pre-existing order in the data can make this untrue. |
147 | untrue. | ||
148 | .Sh RETURN VALUES | 151 | .Sh RETURN VALUES |
149 | The | 152 | The |
150 | .Fn qsort | 153 | .Fn qsort |
151 | function | 154 | function returns no value. |
152 | returns no value. | ||
153 | .Pp | 155 | .Pp |
154 | Upon successful completion, | 156 | Upon successful completion, |
155 | .Fn heapsort | 157 | .Fn heapsort |
@@ -167,8 +169,7 @@ function succeeds unless: | |||
167 | .It Bq Er EINVAL | 169 | .It Bq Er EINVAL |
168 | The | 170 | The |
169 | .Fa size | 171 | .Fa size |
170 | argument is zero, or, | 172 | argument is zero, or, the |
171 | the | ||
172 | .Fa size | 173 | .Fa size |
173 | argument to | 174 | argument to |
174 | .Fn mergesort | 175 | .Fn mergesort |
@@ -228,6 +229,5 @@ This is no longer true. | |||
228 | .Sh STANDARDS | 229 | .Sh STANDARDS |
229 | The | 230 | The |
230 | .Fn qsort | 231 | .Fn qsort |
231 | function | 232 | function conforms to |
232 | conforms to | ||
233 | .St -ansiC . | 233 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/radixsort.3 b/src/lib/libc/stdlib/radixsort.3 index a1a4ee4eab..64cc841a49 100644 --- a/src/lib/libc/stdlib/radixsort.3 +++ b/src/lib/libc/stdlib/radixsort.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: radixsort.3,v 1.5 1999/06/29 18:36:22 aaron Exp $ | 32 | .\" $OpenBSD: radixsort.3,v 1.6 2000/04/20 13:50:02 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd January 27, 1994 | 34 | .Dd January 27, 1994 |
35 | .Dt RADIXSORT 3 | 35 | .Dt RADIXSORT 3 |
@@ -49,8 +49,7 @@ The | |||
49 | .Fn radixsort | 49 | .Fn radixsort |
50 | and | 50 | and |
51 | .Fn sradixsort | 51 | .Fn sradixsort |
52 | functions | 52 | functions are implementations of radix sort. |
53 | are implementations of radix sort. | ||
54 | .Pp | 53 | .Pp |
55 | These functions sort an array of pointers to byte strings, the initial | 54 | These functions sort an array of pointers to byte strings, the initial |
56 | member of which is referenced by | 55 | member of which is referenced by |
@@ -66,23 +65,20 @@ If non-null, | |||
66 | .Fa table | 65 | .Fa table |
67 | must reference an array of | 66 | must reference an array of |
68 | .Dv UCHAR_MAX | 67 | .Dv UCHAR_MAX |
69 | + 1 bytes which contains the sort | 68 | + 1 bytes which contains the sort weight of each possible byte value. |
70 | weight of each possible byte value. | ||
71 | The end-of-string byte must have a sort weight of 0 or 255 | 69 | The end-of-string byte must have a sort weight of 0 or 255 |
72 | (for sorting in reverse order). | 70 | (for sorting in reverse order). |
73 | More than one byte may have the same sort weight. | 71 | More than one byte may have the same sort weight. |
74 | The | 72 | The |
75 | .Fa table | 73 | .Fa table |
76 | argument | 74 | argument is useful for applications which wish to sort different characters |
77 | is useful for applications which wish to sort different characters | ||
78 | equally, for example, providing a table with the same weights | 75 | equally, for example, providing a table with the same weights |
79 | for A-Z as for a-z will result in a case-insensitive sort. | 76 | for A-Z as for a-z will result in a case-insensitive sort. |
80 | If | 77 | If |
81 | .Fa table | 78 | .Fa table |
82 | is | 79 | is |
83 | .Dv NULL , | 80 | .Dv NULL , |
84 | the contents of the array are sorted in ascending order | 81 | the contents of the array are sorted in ascending order according to the |
85 | according to the | ||
86 | .Tn ASCII | 82 | .Tn ASCII |
87 | order of the byte strings they reference and | 83 | order of the byte strings they reference and |
88 | .Fa endbyte | 84 | .Fa endbyte |
@@ -122,8 +118,7 @@ is not 0 or 255. | |||
122 | .Pp | 118 | .Pp |
123 | Additionally, the | 119 | Additionally, the |
124 | .Fn sradixsort | 120 | .Fn sradixsort |
125 | function | 121 | function may fail and set |
126 | may fail and set | ||
127 | .Va errno | 122 | .Va errno |
128 | for any of the errors specified for the library routine | 123 | for any of the errors specified for the library routine |
129 | .Xr malloc 3 . | 124 | .Xr malloc 3 . |
diff --git a/src/lib/libc/stdlib/rand.3 b/src/lib/libc/stdlib/rand.3 index d5686e5f4c..4d4e91efe4 100644 --- a/src/lib/libc/stdlib/rand.3 +++ b/src/lib/libc/stdlib/rand.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: rand.3,v 1.6 1999/06/29 18:36:22 aaron Exp $ | 36 | .\" $OpenBSD: rand.3,v 1.7 2000/04/20 13:50:02 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt RAND 3 | 39 | .Dt RAND 3 |
@@ -92,13 +92,11 @@ The | |||
92 | .Fn rand | 92 | .Fn rand |
93 | and | 93 | and |
94 | .Fn srand | 94 | .Fn srand |
95 | functions | 95 | functions conform to |
96 | conform to | ||
97 | .St -ansiC . | 96 | .St -ansiC . |
98 | .Pp | 97 | .Pp |
99 | The | 98 | The |
100 | .Fn rand_r | 99 | .Fn rand_r |
101 | function | 100 | function conforms to ISO/IEC 9945-1 ANSI/IEEE |
102 | conforms to ISO/IEC 9945-1 ANSI/IEEE | ||
103 | .Pq Dq Tn POSIX | 101 | .Pq Dq Tn POSIX |
104 | Std 1003.1c Draft 10. | 102 | Std 1003.1c Draft 10. |
diff --git a/src/lib/libc/stdlib/rand48.3 b/src/lib/libc/stdlib/rand48.3 index 3d8d53862d..886e5273d9 100644 --- a/src/lib/libc/stdlib/rand48.3 +++ b/src/lib/libc/stdlib/rand48.3 | |||
@@ -9,7 +9,7 @@ | |||
9 | .\" of any kind. I shall in no event be liable for anything that happens | 9 | .\" of any kind. I shall in no event be liable for anything that happens |
10 | .\" to anyone/anything when using this software. | 10 | .\" to anyone/anything when using this software. |
11 | .\" | 11 | .\" |
12 | .\" $OpenBSD: rand48.3,v 1.6 1999/09/27 02:00:13 aaron Exp $ | 12 | .\" $OpenBSD: rand48.3,v 1.7 2000/04/20 13:50:02 aaron Exp $ |
13 | .\" | 13 | .\" |
14 | .Dd October 8, 1993 | 14 | .Dd October 8, 1993 |
15 | .Dt RAND48 3 | 15 | .Dt RAND48 3 |
@@ -49,12 +49,13 @@ | |||
49 | The | 49 | The |
50 | .Fn rand48 | 50 | .Fn rand48 |
51 | family of functions generates pseudo-random numbers using a linear | 51 | family of functions generates pseudo-random numbers using a linear |
52 | congruential algorithm working on integers 48 bits in size. The | 52 | congruential algorithm working on integers 48 bits in size. |
53 | particular formula employed is | 53 | The particular formula employed is |
54 | r(n+1) = (a * r(n) + c) mod m | 54 | r(n+1) = (a * r(n) + c) mod m |
55 | where the default values are | 55 | where the default values are |
56 | for the multiplicand a = 0xfdeece66d = 25214903917 and | 56 | for the multiplicand a = 0xfdeece66d = 25214903917 and |
57 | the addend c = 0xb = 11. The modulus is always fixed at m = 2 ** 48. | 57 | the addend c = 0xb = 11. |
58 | The modulus is always fixed at m = 2 ** 48. | ||
58 | r(n) is called the seed of the random number generator. | 59 | r(n) is called the seed of the random number generator. |
59 | .Pp | 60 | .Pp |
60 | For all the six generator routines described next, the first | 61 | For all the six generator routines described next, the first |
@@ -63,7 +64,8 @@ computational step is to perform a single iteration of the algorithm. | |||
63 | .Fn drand48 | 64 | .Fn drand48 |
64 | and | 65 | and |
65 | .Fn erand48 | 66 | .Fn erand48 |
66 | return values of type double. The full 48 bits of r(n+1) are | 67 | return values of type double. |
68 | The full 48 bits of r(n+1) are | ||
67 | loaded into the mantissa of the returned value, with the exponent set | 69 | loaded into the mantissa of the returned value, with the exponent set |
68 | such that the values produced lie in the interval [0.0, 1.0). | 70 | such that the values produced lie in the interval [0.0, 1.0). |
69 | .Pp | 71 | .Pp |
@@ -71,7 +73,8 @@ such that the values produced lie in the interval [0.0, 1.0). | |||
71 | and | 73 | and |
72 | .Fn nrand48 | 74 | .Fn nrand48 |
73 | return values of type long in the range | 75 | return values of type long in the range |
74 | [0, 2**31-1]. The high-order (31) bits of | 76 | [0, 2**31-1]. |
77 | The high-order (31) bits of | ||
75 | r(n+1) are loaded into the lower bits of the returned value, with | 78 | r(n+1) are loaded into the lower bits of the returned value, with |
76 | the topmost (sign) bit set to zero. | 79 | the topmost (sign) bit set to zero. |
77 | .Pp | 80 | .Pp |
@@ -79,14 +82,15 @@ the topmost (sign) bit set to zero. | |||
79 | and | 82 | and |
80 | .Fn jrand48 | 83 | .Fn jrand48 |
81 | return values of type long in the range | 84 | return values of type long in the range |
82 | [-2**31, 2**31-1]. The high-order (32) bits of | 85 | [-2**31, 2**31-1]. |
83 | r(n+1) are loaded into the returned value. | 86 | The high-order (32) bits of r(n+1) are loaded into the returned value. |
84 | .Pp | 87 | .Pp |
85 | .Fn drand48 , | 88 | .Fn drand48 , |
86 | .Fn lrand48 , | 89 | .Fn lrand48 , |
87 | and | 90 | and |
88 | .Fn mrand48 | 91 | .Fn mrand48 |
89 | use an internal buffer to store r(n). For these functions | 92 | use an internal buffer to store r(n). |
93 | For these functions | ||
90 | the initial value of r(0) = 0x1234abcd330e = 20017429951246. | 94 | the initial value of r(0) = 0x1234abcd330e = 20017429951246. |
91 | .Pp | 95 | .Pp |
92 | On the other hand, | 96 | On the other hand, |
@@ -118,8 +122,8 @@ also initializes the internal buffer r(n) of | |||
118 | and | 122 | and |
119 | .Fn mrand48 , | 123 | .Fn mrand48 , |
120 | but here all 48 bits of the seed can be specified in an array of 3 shorts, | 124 | but here all 48 bits of the seed can be specified in an array of 3 shorts, |
121 | where the zeroth member specifies the lowest bits. Again, | 125 | where the zeroth member specifies the lowest bits. |
122 | the constant multiplicand and addend of the algorithm are | 126 | Again, the constant multiplicand and addend of the algorithm are |
123 | reset to the default values given above. | 127 | reset to the default values given above. |
124 | .Fn seed48 | 128 | .Fn seed48 |
125 | returns a pointer to an array of 3 shorts which contains the old seed. | 129 | returns a pointer to an array of 3 shorts which contains the old seed. |
diff --git a/src/lib/libc/stdlib/random.3 b/src/lib/libc/stdlib/random.3 index 260c239816..d3a3198ebf 100644 --- a/src/lib/libc/stdlib/random.3 +++ b/src/lib/libc/stdlib/random.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" $OpenBSD: random.3,v 1.11 2000/04/03 23:23:48 millert Exp $ | 32 | .\" $OpenBSD: random.3,v 1.12 2000/04/20 13:50:02 aaron Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1991 | 34 | .Dd April 19, 1991 |
35 | .Dt RANDOM 3 | 35 | .Dt RANDOM 3 |
@@ -56,23 +56,27 @@ | |||
56 | .Sh DESCRIPTION | 56 | .Sh DESCRIPTION |
57 | The | 57 | The |
58 | .Fn random | 58 | .Fn random |
59 | function | 59 | function uses a non-linear additive feedback random number generator employing |
60 | uses a non-linear additive feedback random number generator employing a | 60 | a default table of size 31 long integers to return successive pseudo-random |
61 | default table of size 31 long integers to return successive pseudo-random | ||
62 | numbers in the range from 0 to (2**31)\-1. | 61 | numbers in the range from 0 to (2**31)\-1. |
63 | The period of this random number generator is very large, approximately | 62 | The period of this random number generator is very large, approximately |
64 | 16*((2**31)\-1. | 63 | 16*((2**31)\-1. |
65 | .Pp | 64 | .Pp |
66 | The | 65 | The |
67 | .Fn random Ns / Fn srandom | 66 | .Fn random |
68 | have (almost) the same calling sequence and initialization properties as | 67 | and |
68 | .Fn srandom | ||
69 | functions have (almost) the same calling sequence and initialization | ||
70 | properties as | ||
69 | .Xr rand 3 Ns / Xr srand 3 . | 71 | .Xr rand 3 Ns / Xr srand 3 . |
70 | The difference is that | 72 | The difference is that |
71 | .Xr rand | 73 | .Xr rand |
72 | produces a much less random sequence \(em in fact, the low dozen bits | 74 | produces a much less random sequence \(em in fact, the low dozen bits |
73 | generated by rand go through a cyclic pattern. All the bits generated by | 75 | generated by rand go through a cyclic pattern. |
76 | All the bits generated by | ||
74 | .Fn random | 77 | .Fn random |
75 | are usable. For example, | 78 | are usable. |
79 | For example, | ||
76 | .Sq Li random()&01 | 80 | .Sq Li random()&01 |
77 | will produce a random binary | 81 | will produce a random binary |
78 | value. | 82 | value. |
@@ -81,9 +85,10 @@ Unlike | |||
81 | .Xr srand , | 85 | .Xr srand , |
82 | .Fn srandom | 86 | .Fn srandom |
83 | does not return the old seed; the reason for this is that the amount of | 87 | does not return the old seed; the reason for this is that the amount of |
84 | state information used is much more than a single word. (Two other | 88 | state information used is much more than a single word. |
85 | routines are provided to deal with restarting/changing random | 89 | (Two other routines are provided to deal with restarting/changing random |
86 | number generators). Like | 90 | number generators). |
91 | Like | ||
87 | .Xr rand 3 , | 92 | .Xr rand 3 , |
88 | however, | 93 | however, |
89 | .Fn random | 94 | .Fn random |
@@ -110,28 +115,28 @@ a fixed seed. | |||
110 | The | 115 | The |
111 | .Fn initstate | 116 | .Fn initstate |
112 | routine allows a state array, passed in as an argument, to be initialized | 117 | routine allows a state array, passed in as an argument, to be initialized |
113 | for future use. The size of the state array (in bytes) is used by | 118 | for future use. |
119 | The size of the state array (in bytes) is used by | ||
114 | .Fn initstate | 120 | .Fn initstate |
115 | to decide how sophisticated a random number generator it should use \(em the | 121 | to decide how sophisticated a random number generator it should use \(em the |
116 | more state, the better the random numbers will be. | 122 | more state, the better the random numbers will be. |
117 | (Current "optimal" values for the amount of state information are | 123 | (Current "optimal" values for the amount of state information are |
118 | 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to | 124 | 8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to |
119 | the nearest known amount. Using less than 8 bytes will cause an error.) | 125 | the nearest known amount. |
126 | Using less than 8 bytes will cause an error.) | ||
120 | The seed for the initialization (which specifies a starting point for | 127 | The seed for the initialization (which specifies a starting point for |
121 | the random number sequence, and provides for restarting at the same | 128 | the random number sequence, and provides for restarting at the same |
122 | point) is also an argument. | 129 | point) is also an argument. |
123 | The | 130 | The |
124 | .Fn initstate | 131 | .Fn initstate |
125 | function | 132 | function returns a pointer to the previous state information array. |
126 | returns a pointer to the previous state information array. | ||
127 | .Pp | 133 | .Pp |
128 | Once a state has been initialized, the | 134 | Once a state has been initialized, the |
129 | .Fn setstate | 135 | .Fn setstate |
130 | routine provides for rapid switching between states. | 136 | routine provides for rapid switching between states. |
131 | The | 137 | The |
132 | .Fn setstate | 138 | .Fn setstate |
133 | function | 139 | function returns a pointer to the previous state array; its |
134 | returns a pointer to the previous state array; its | ||
135 | argument state array is used for further random number generation | 140 | argument state array is used for further random number generation |
136 | until the next call to | 141 | until the next call to |
137 | .Fn initstate | 142 | .Fn initstate |
diff --git a/src/lib/libc/stdlib/realpath.3 b/src/lib/libc/stdlib/realpath.3 index 95c57b2e51..ffb763d475 100644 --- a/src/lib/libc/stdlib/realpath.3 +++ b/src/lib/libc/stdlib/realpath.3 | |||
@@ -32,7 +32,7 @@ | |||
32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 32 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
33 | .\" SUCH DAMAGE. | 33 | .\" SUCH DAMAGE. |
34 | .\" | 34 | .\" |
35 | .\" $OpenBSD: realpath.3,v 1.6 1999/07/02 16:57:49 aaron Exp $ | 35 | .\" $OpenBSD: realpath.3,v 1.7 2000/04/20 13:50:02 aaron Exp $ |
36 | .\" | 36 | .\" |
37 | .Dd February 16, 1994 | 37 | .Dd February 16, 1994 |
38 | .Dt REALPATH 3 | 38 | .Dt REALPATH 3 |
@@ -56,8 +56,7 @@ and | |||
56 | .Pa /../ | 56 | .Pa /../ |
57 | in | 57 | in |
58 | .Fa pathname , | 58 | .Fa pathname , |
59 | and copies the resulting absolute pathname into | 59 | and copies the resulting absolute pathname into the memory referenced by |
60 | the memory referenced by | ||
61 | .Fa resolvedname . | 60 | .Fa resolvedname . |
62 | The | 61 | The |
63 | .Fa resolvedname | 62 | .Fa resolvedname |
@@ -101,7 +100,7 @@ for any of the errors specified for the library functions | |||
101 | .Xr fchdir 2 , | 100 | .Xr fchdir 2 , |
102 | .Xr lstat 2 , | 101 | .Xr lstat 2 , |
103 | .Xr open 2 , | 102 | .Xr open 2 , |
104 | .Xr readlink 2 | 103 | .Xr readlink 2 , |
105 | and | 104 | and |
106 | .Xr getcwd 3 . | 105 | .Xr getcwd 3 . |
107 | .Sh CAVEATS | 106 | .Sh CAVEATS |
diff --git a/src/lib/libc/stdlib/strtod.3 b/src/lib/libc/stdlib/strtod.3 index 143fea34dc..4e04f6738e 100644 --- a/src/lib/libc/stdlib/strtod.3 +++ b/src/lib/libc/stdlib/strtod.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: strtod.3,v 1.6 2000/03/04 22:19:31 aaron Exp $ | 36 | .\" $OpenBSD: strtod.3,v 1.7 2000/04/20 13:50:03 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt STRTOD 3 | 39 | .Dt STRTOD 3 |
@@ -50,18 +50,23 @@ string to double | |||
50 | .Sh DESCRIPTION | 50 | .Sh DESCRIPTION |
51 | The | 51 | The |
52 | .Fn strtod | 52 | .Fn strtod |
53 | function converts the initial portion of the string | 53 | function converts the initial portion of the string pointed to by |
54 | pointed to by | ||
55 | .Fa nptr | 54 | .Fa nptr |
56 | to | 55 | to |
57 | .Li double | 56 | .Li double |
58 | representation. | 57 | representation. |
59 | .Pp | 58 | .Pp |
60 | The expected form of the string is an optional plus (``+'') or minus | 59 | The expected form of the string is an optional plus |
61 | sign (``-'') followed by a sequence of digits optionally containing | 60 | .Pq Ql + |
61 | or minus sign | ||
62 | .Pq Ql - | ||
63 | followed by a sequence of digits optionally containing | ||
62 | a decimal-point character, optionally followed by an exponent. | 64 | a decimal-point character, optionally followed by an exponent. |
63 | An exponent consists of an ``E'' or ``e'', followed by an optional plus | 65 | An exponent consists of an |
64 | or minus sign, followed by a sequence of digits. | 66 | .Sq E |
67 | or | ||
68 | .Sq e , | ||
69 | followed by an optional plus or minus sign, followed by a sequence of digits. | ||
65 | .Pp | 70 | .Pp |
66 | Leading whitespace characters in the string (as defined by the | 71 | Leading whitespace characters in the string (as defined by the |
67 | .Xr isspace 3 | 72 | .Xr isspace 3 |
@@ -90,8 +95,7 @@ is returned (according to the sign of the value), and | |||
90 | .Er ERANGE | 95 | .Er ERANGE |
91 | is stored in | 96 | is stored in |
92 | .Va errno . | 97 | .Va errno . |
93 | If the correct value would cause underflow, zero is | 98 | If the correct value would cause underflow, zero is returned and |
94 | returned and | ||
95 | .Er ERANGE | 99 | .Er ERANGE |
96 | is stored in | 100 | is stored in |
97 | .Va errno . | 101 | .Va errno . |
@@ -109,6 +113,5 @@ Overflow or underflow occurred. | |||
109 | .Sh STANDARDS | 113 | .Sh STANDARDS |
110 | The | 114 | The |
111 | .Fn strtod | 115 | .Fn strtod |
112 | function | 116 | function conforms to |
113 | conforms to | ||
114 | .St -ansiC . | 117 | .St -ansiC . |
diff --git a/src/lib/libc/stdlib/strtol.3 b/src/lib/libc/stdlib/strtol.3 index df696b7b85..fdc02b20b8 100644 --- a/src/lib/libc/stdlib/strtol.3 +++ b/src/lib/libc/stdlib/strtol.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: strtol.3,v 1.7 2000/03/04 22:19:31 aaron Exp $ | 36 | .\" $OpenBSD: strtol.3,v 1.8 2000/04/20 13:50:03 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 25, 1992 | 38 | .Dd June 25, 1992 |
39 | .Dt STRTOL 3 | 39 | .Dt STRTOL 3 |
@@ -46,7 +46,7 @@ | |||
46 | .Fd #include <limits.h> | 46 | .Fd #include <limits.h> |
47 | .Ft long | 47 | .Ft long |
48 | .Fn strtol "const char *nptr" "char **endptr" "int base" | 48 | .Fn strtol "const char *nptr" "char **endptr" "int base" |
49 | 49 | .Pp | |
50 | .Fd #include <sys/types.h> | 50 | .Fd #include <sys/types.h> |
51 | .Fd #include <stdlib.h> | 51 | .Fd #include <stdlib.h> |
52 | .Fd #include <limits.h> | 52 | .Fd #include <limits.h> |
@@ -55,24 +55,21 @@ | |||
55 | .Sh DESCRIPTION | 55 | .Sh DESCRIPTION |
56 | The | 56 | The |
57 | .Fn strtol | 57 | .Fn strtol |
58 | function | 58 | function converts the string in |
59 | converts the string in | ||
60 | .Fa nptr | 59 | .Fa nptr |
61 | to a | 60 | to a |
62 | .Li long | 61 | .Li long |
63 | value. | 62 | value. |
64 | The | 63 | The |
65 | .Fn strtoq | 64 | .Fn strtoq |
66 | function | 65 | function converts the string in |
67 | converts the string in | ||
68 | .Fa nptr | 66 | .Fa nptr |
69 | to a | 67 | to a |
70 | .Li quad_t | 68 | .Li quad_t |
71 | value. | 69 | value. |
72 | The conversion is done according to the given | 70 | The conversion is done according to the given |
73 | .Fa base , | 71 | .Fa base , |
74 | which must be a number between 2 and 36 inclusive | 72 | which must be a number between 2 and 36 inclusive or the special value 0. |
75 | or the special value 0. | ||
76 | .Pp | 73 | .Pp |
77 | The string may begin with an arbitrary amount of whitespace | 74 | The string may begin with an arbitrary amount of whitespace |
78 | (as determined by | 75 | (as determined by |
@@ -84,11 +81,9 @@ or | |||
84 | sign. | 81 | sign. |
85 | If | 82 | If |
86 | .Fa base | 83 | .Fa base |
87 | is zero or 16, | 84 | is zero or 16, the string may then include a |
88 | the string may then include a | ||
89 | .Ql 0x | 85 | .Ql 0x |
90 | prefix, | 86 | prefix, and the number will be read in base 16; otherwise, a zero |
91 | and the number will be read in base 16; otherwise, a zero | ||
92 | .Fa base | 87 | .Fa base |
93 | is taken as 10 (decimal) unless the next character is | 88 | is taken as 10 (decimal) unless the next character is |
94 | .Ql 0 , | 89 | .Ql 0 , |
@@ -101,8 +96,7 @@ stopping at the first character which is not a valid digit | |||
101 | in the given base. | 96 | in the given base. |
102 | (In bases above 10, the letter | 97 | (In bases above 10, the letter |
103 | .Ql A | 98 | .Ql A |
104 | in either upper or lower case | 99 | in either upper or lower case represents 10, |
105 | represents 10, | ||
106 | .Ql B | 100 | .Ql B |
107 | represents 11, and so forth, with | 101 | represents 11, and so forth, with |
108 | .Ql Z | 102 | .Ql Z |
@@ -110,7 +104,7 @@ representing 35.) | |||
110 | .Pp | 104 | .Pp |
111 | If | 105 | If |
112 | .Fa endptr | 106 | .Fa endptr |
113 | is non nil, | 107 | is non-null, |
114 | .Fn strtol | 108 | .Fn strtol |
115 | stores the address of the first invalid character in | 109 | stores the address of the first invalid character in |
116 | .Fa *endptr . | 110 | .Fa *endptr . |
@@ -132,8 +126,7 @@ on return, the entire string was valid.) | |||
132 | .Sh RETURN VALUES | 126 | .Sh RETURN VALUES |
133 | The | 127 | The |
134 | .Fn strtol | 128 | .Fn strtol |
135 | function | 129 | function returns the result of the conversion, |
136 | returns the result of the conversion, | ||
137 | unless the value would underflow or overflow. | 130 | unless the value would underflow or overflow. |
138 | If an underflow occurs, | 131 | If an underflow occurs, |
139 | .Fn strtol | 132 | .Fn strtol |
@@ -191,8 +184,8 @@ error checking is further complicated because the desired return value is an | |||
191 | .Li int | 184 | .Li int |
192 | rather than a | 185 | rather than a |
193 | .Li long ; | 186 | .Li long ; |
194 | however, on some architectures integers and long integers are the same | 187 | however, on some architectures integers and long integers are the same size. |
195 | size. Thus the following is necessary: | 188 | Thus the following is necessary: |
196 | .Bd -literal -offset indent | 189 | .Bd -literal -offset indent |
197 | char *ep; | 190 | char *ep; |
198 | int ival; | 191 | int ival; |
@@ -224,8 +217,7 @@ The given string was out of range; the value converted has been clamped. | |||
224 | .Sh STANDARDS | 217 | .Sh STANDARDS |
225 | The | 218 | The |
226 | .Fn strtol | 219 | .Fn strtol |
227 | function | 220 | function conforms to |
228 | conforms to | ||
229 | .St -ansiC . | 221 | .St -ansiC . |
230 | .Sh BUGS | 222 | .Sh BUGS |
231 | Ignores the current locale. | 223 | Ignores the current locale. |
diff --git a/src/lib/libc/stdlib/strtoul.3 b/src/lib/libc/stdlib/strtoul.3 index 572658bf7f..e090253566 100644 --- a/src/lib/libc/stdlib/strtoul.3 +++ b/src/lib/libc/stdlib/strtoul.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: strtoul.3,v 1.6 2000/03/04 22:19:31 aaron Exp $ | 36 | .\" $OpenBSD: strtoul.3,v 1.7 2000/04/20 13:50:03 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 25, 1992 | 38 | .Dd June 25, 1992 |
39 | .Dt STRTOUL 3 | 39 | .Dt STRTOUL 3 |
@@ -55,16 +55,14 @@ | |||
55 | .Sh DESCRIPTION | 55 | .Sh DESCRIPTION |
56 | The | 56 | The |
57 | .Fn strtoul | 57 | .Fn strtoul |
58 | function | 58 | function converts the string in |
59 | converts the string in | ||
60 | .Fa nptr | 59 | .Fa nptr |
61 | to an | 60 | to an |
62 | .Li unsigned long | 61 | .Li unsigned long |
63 | value. | 62 | value. |
64 | The | 63 | The |
65 | .Fn strtouq | 64 | .Fn strtouq |
66 | function | 65 | function converts the string in |
67 | converts the string in | ||
68 | .Fa nptr | 66 | .Fa nptr |
69 | to a | 67 | to a |
70 | .Li u_quad_t | 68 | .Li u_quad_t |
@@ -84,11 +82,9 @@ or | |||
84 | sign. | 82 | sign. |
85 | If | 83 | If |
86 | .Fa base | 84 | .Fa base |
87 | is zero or 16, | 85 | is zero or 16, the string may then include a |
88 | the string may then include a | ||
89 | .Ql 0x | 86 | .Ql 0x |
90 | prefix, | 87 | prefix, and the number will be read in base 16; otherwise, a zero |
91 | and the number will be read in base 16; otherwise, a zero | ||
92 | .Fa base | 88 | .Fa base |
93 | is taken as 10 (decimal) unless the next character is | 89 | is taken as 10 (decimal) unless the next character is |
94 | .Ql 0 , | 90 | .Ql 0 , |
@@ -96,14 +92,12 @@ in which case it is taken as 8 (octal). | |||
96 | .Pp | 92 | .Pp |
97 | The remainder of the string is converted to an | 93 | The remainder of the string is converted to an |
98 | .Li unsigned long | 94 | .Li unsigned long |
99 | value in the obvious manner, | 95 | value in the obvious manner, stopping at the end of the string |
100 | stopping at the end of the string | ||
101 | or at the first character that does not produce a valid digit | 96 | or at the first character that does not produce a valid digit |
102 | in the given base. | 97 | in the given base. |
103 | (In bases above 10, the letter | 98 | (In bases above 10, the letter |
104 | .Ql A | 99 | .Ql A |
105 | in either upper or lower case | 100 | in either upper or lower case represents 10, |
106 | represents 10, | ||
107 | .Ql B | 101 | .Ql B |
108 | represents 11, and so forth, with | 102 | represents 11, and so forth, with |
109 | .Ql Z | 103 | .Ql Z |
@@ -111,7 +105,7 @@ representing 35.) | |||
111 | .Pp | 105 | .Pp |
112 | If | 106 | If |
113 | .Fa endptr | 107 | .Fa endptr |
114 | is non nil, | 108 | is non-null, |
115 | .Fn strtoul | 109 | .Fn strtoul |
116 | stores the address of the first invalid character in | 110 | stores the address of the first invalid character in |
117 | .Fa *endptr . | 111 | .Fa *endptr . |
@@ -133,8 +127,7 @@ on return, the entire string was valid.) | |||
133 | .Sh RETURN VALUES | 127 | .Sh RETURN VALUES |
134 | The | 128 | The |
135 | .Fn strtoul | 129 | .Fn strtoul |
136 | function | 130 | function returns the result of the conversion, |
137 | returns the result of the conversion, | ||
138 | unless the value would overflow, in which case | 131 | unless the value would overflow, in which case |
139 | .Dv ULONG_MAX | 132 | .Dv ULONG_MAX |
140 | is returned and | 133 | is returned and |
@@ -206,8 +199,7 @@ The given string was out of range; the value converted has been clamped. | |||
206 | .Sh STANDARDS | 199 | .Sh STANDARDS |
207 | The | 200 | The |
208 | .Fn strtoul | 201 | .Fn strtoul |
209 | function | 202 | function conforms to |
210 | conforms to | ||
211 | .St -ansiC . | 203 | .St -ansiC . |
212 | .Sh BUGS | 204 | .Sh BUGS |
213 | Ignores the current locale. | 205 | Ignores the current locale. |
diff --git a/src/lib/libc/stdlib/system.3 b/src/lib/libc/stdlib/system.3 index f2d2693677..2db413934e 100644 --- a/src/lib/libc/stdlib/system.3 +++ b/src/lib/libc/stdlib/system.3 | |||
@@ -33,7 +33,7 @@ | |||
33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 33 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | .\" SUCH DAMAGE. | 34 | .\" SUCH DAMAGE. |
35 | .\" | 35 | .\" |
36 | .\" $OpenBSD: system.3,v 1.6 1999/06/29 18:36:24 aaron Exp $ | 36 | .\" $OpenBSD: system.3,v 1.7 2000/04/20 13:50:03 aaron Exp $ |
37 | .\" | 37 | .\" |
38 | .Dd June 29, 1991 | 38 | .Dd June 29, 1991 |
39 | .Dt SYSTEM 3 | 39 | .Dt SYSTEM 3 |
@@ -48,8 +48,7 @@ | |||
48 | .Sh DESCRIPTION | 48 | .Sh DESCRIPTION |
49 | The | 49 | The |
50 | .Fn system | 50 | .Fn system |
51 | function | 51 | function hands the argument |
52 | hands the argument | ||
53 | .Fa string | 52 | .Fa string |
54 | to the command interpreter | 53 | to the command interpreter |
55 | .Xr sh 1 . | 54 | .Xr sh 1 . |
@@ -63,9 +62,8 @@ and blocking | |||
63 | .Pp | 62 | .Pp |
64 | If | 63 | If |
65 | .Fa string | 64 | .Fa string |
66 | is a | 65 | is |
67 | .Dv NULL | 66 | .Dv NULL , |
68 | pointer, | ||
69 | .Fn system | 67 | .Fn system |
70 | will return non-zero. | 68 | will return non-zero. |
71 | Otherwise, | 69 | Otherwise, |
@@ -91,8 +89,7 @@ returns the termination status for a program that terminates with a call of | |||
91 | .Sh STANDARDS | 89 | .Sh STANDARDS |
92 | The | 90 | The |
93 | .Fn system | 91 | .Fn system |
94 | function | 92 | function conforms to |
95 | conforms to | ||
96 | .St -ansiC | 93 | .St -ansiC |
97 | and | 94 | and |
98 | .St -p1003.2-92 . | 95 | .St -p1003.2-92 . |
diff --git a/src/lib/libc/stdlib/tsearch.3 b/src/lib/libc/stdlib/tsearch.3 index fa1d34afbb..72048a19fb 100644 --- a/src/lib/libc/stdlib/tsearch.3 +++ b/src/lib/libc/stdlib/tsearch.3 | |||
@@ -23,7 +23,7 @@ | |||
23 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 23 | .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
24 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 | .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 | .\" | 25 | .\" |
26 | .\" $OpenBSD: tsearch.3,v 1.7 2000/02/25 07:53:09 deraadt Exp $ | 26 | .\" $OpenBSD: tsearch.3,v 1.8 2000/04/20 13:50:03 aaron Exp $ |
27 | .\" | 27 | .\" |
28 | .Dd June 15, 1997 | 28 | .Dd June 15, 1997 |
29 | .Dt TSEARCH 3 | 29 | .Dt TSEARCH 3 |
@@ -49,7 +49,8 @@ The | |||
49 | and | 49 | and |
50 | .Fn twalk | 50 | .Fn twalk |
51 | functions manage binary search trees based on algorithms T and D | 51 | functions manage binary search trees based on algorithms T and D |
52 | from Knuth (6.2.2). The comparison function passed in by | 52 | from Knuth (6.2.2). |
53 | The comparison function passed in by | ||
53 | the user has the same style of return values as | 54 | the user has the same style of return values as |
54 | .Xr strcmp 3 . | 55 | .Xr strcmp 3 . |
55 | .Pp | 56 | .Pp |
@@ -67,7 +68,8 @@ is identical to | |||
67 | .Fn tfind | 68 | .Fn tfind |
68 | except that if no match is found, | 69 | except that if no match is found, |
69 | .Fa key | 70 | .Fa key |
70 | is inserted into the tree and a pointer to it is returned. If | 71 | is inserted into the tree and a pointer to it is returned. |
72 | If | ||
71 | .Fa rootp | 73 | .Fa rootp |
72 | points to a null value a new binary search tree is created. | 74 | points to a null value a new binary search tree is created. |
73 | .Pp | 75 | .Pp |