aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-05-19 04:30:20 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-05-19 04:30:20 +0000
commit2b2581ee37f080c0a95d20aedecd5cb04e81ef4a (patch)
tree4ce1a3bcc3cd8793e50f48abba8eab04c8e7ea07 /man3
parent2dd578fd5b80cbfe5892b200633aa1442c4ac674 (diff)
downloadman-pages-2b2581ee37f080c0a95d20aedecd5cb04e81ef4a.tar.gz
Fix inconsistencies in order of .SH sections
Diffstat (limited to 'man3')
-rw-r--r--man3/INFINITY.34
-rw-r--r--man3/__setfpucw.320
-rw-r--r--man3/a64l.34
-rw-r--r--man3/addseverity.36
-rw-r--r--man3/adjtime.340
-rw-r--r--man3/aio_read.34
-rw-r--r--man3/aio_suspend.34
-rw-r--r--man3/aio_write.34
-rw-r--r--man3/argz_add.35
-rw-r--r--man3/atexit.333
-rw-r--r--man3/basename.330
-rw-r--r--man3/bsd_signal.34
-rw-r--r--man3/bsearch.34
-rw-r--r--man3/cabs.34
-rw-r--r--man3/catgets.34
-rw-r--r--man3/catopen.314
-rw-r--r--man3/ceil.310
-rw-r--r--man3/cimag.34
-rw-r--r--man3/clock_getres.334
-rw-r--r--man3/cmsg.342
-rw-r--r--man3/confstr.34
-rw-r--r--man3/copysign.38
-rw-r--r--man3/creal.34
-rw-r--r--man3/crypt.34
-rw-r--r--man3/ctime.318
-rw-r--r--man3/daemon.312
-rw-r--r--man3/dirfd.312
-rw-r--r--man3/div.312
-rw-r--r--man3/dl_iterate_phdr.318
-rw-r--r--man3/dlopen.362
-rw-r--r--man3/dprintf.34
-rw-r--r--man3/ecvt.36
-rw-r--r--man3/ecvt_r.34
-rw-r--r--man3/encrypt.326
-rw-r--r--man3/envz_add.36
-rw-r--r--man3/ether_aton.34
-rw-r--r--man3/exec.39
-rw-r--r--man3/fclose.34
-rw-r--r--man3/fenv.311
-rw-r--r--man3/fflush.34
-rw-r--r--man3/flockfile.34
-rw-r--r--man3/floor.310
-rw-r--r--man3/fmemopen.38
-rw-r--r--man3/fmtmsg.330
-rw-r--r--man3/fpclassify.34
-rw-r--r--man3/fseeko.34
-rw-r--r--man3/ftime.34
-rw-r--r--man3/fts.34
-rw-r--r--man3/ftw.34
-rw-r--r--man3/gamma.36
-rw-r--r--man3/gcvt.310
-rw-r--r--man3/getcwd.314
-rw-r--r--man3/getdate.320
-rw-r--r--man3/getgrent_r.354
-rw-r--r--man3/getgrouplist.38
-rw-r--r--man3/getipnodebyname.36
-rw-r--r--man3/getline.314
-rw-r--r--man3/getnameinfo.34
-rw-r--r--man3/getopt.360
-rw-r--r--man3/getpass.318
-rw-r--r--man3/getpwent_r.354
-rw-r--r--man3/getrpcent.316
-rw-r--r--man3/getttyent.36
-rw-r--r--man3/getumask.34
-rw-r--r--man3/getutent.392
-rw-r--r--man3/getw.34
-rw-r--r--man3/glob.344
-rw-r--r--man3/inet.314
-rw-r--r--man3/infnan.314
-rw-r--r--man3/isgreater.34
-rw-r--r--man3/key_setsecret.34
-rw-r--r--man3/login.324
-rw-r--r--man3/makecontext.34
-rw-r--r--man3/malloc_hook.34
-rw-r--r--man3/mempcpy.34
-rw-r--r--man3/mkdtemp.34
-rw-r--r--man3/mkfifoat.316
-rw-r--r--man3/mkstemp.34
-rw-r--r--man3/mq_close.38
-rw-r--r--man3/mtrace.34
-rw-r--r--man3/offsetof.34
-rw-r--r--man3/opendir.34
-rw-r--r--man3/openpty.34
-rw-r--r--man3/posix_memalign.380
-rw-r--r--man3/printf.3206
-rw-r--r--man3/profil.34
-rw-r--r--man3/program_invocation_name.36
-rw-r--r--man3/putenv.34
-rw-r--r--man3/qecvt.310
-rw-r--r--man3/rand.350
-rw-r--r--man3/random.34
-rw-r--r--man3/realpath.378
-rw-r--r--man3/remove.36
-rw-r--r--man3/rint.34
-rw-r--r--man3/round.34
-rw-r--r--man3/rtime.342
-rw-r--r--man3/rtnetlink.34
-rw-r--r--man3/sem_close.38
-rw-r--r--man3/sem_getvalue.34
-rw-r--r--man3/sem_wait.34
-rw-r--r--man3/setaliasent.336
-rw-r--r--man3/setnetgrent.34
-rw-r--r--man3/shm_open.312
-rw-r--r--man3/sigset.36
-rw-r--r--man3/sigvec.312
-rw-r--r--man3/sockatmark.310
-rw-r--r--man3/stdarg.380
-rw-r--r--man3/stpcpy.328
-rw-r--r--man3/strcpy.34
-rw-r--r--man3/strfmon.36
-rw-r--r--man3/strptime.344
-rw-r--r--man3/strsep.34
-rw-r--r--man3/strstr.312
-rw-r--r--man3/strtok.364
-rw-r--r--man3/strtol.310
-rw-r--r--man3/strtoul.310
-rw-r--r--man3/sysv_signal.34
-rw-r--r--man3/tcgetpgrp.34
-rw-r--r--man3/tcgetsid.34
-rw-r--r--man3/tempnam.34
-rw-r--r--man3/timegm.36
-rw-r--r--man3/tmpnam.34
-rw-r--r--man3/tsearch.310
-rw-r--r--man3/ttyslot.36
-rw-r--r--man3/updwtmp.314
-rw-r--r--man3/wcstok.34
126 files changed, 1029 insertions, 1023 deletions
diff --git a/man3/INFINITY.3 b/man3/INFINITY.3
index 2d7cb62a79..4abfff72f1 100644
--- a/man3/INFINITY.3
+++ b/man3/INFINITY.3
@@ -63,6 +63,8 @@ The macros
.BR HUGE_VALL
expand to constants of types double, float and long double, respectively,
that represent a large positive value, possibly plus infinity.
+.SH "CONFORMING TO"
+C99
.SH AVAILABILITY
On a glibc system, the macro HUGE_VAL is always available.
Availability of the NAN macro can be tested using
@@ -72,8 +74,6 @@ They will be defined by
.I <math.h>
if _ISOC99_SOURCE or _GNU_SOURCE is defined, or __STDC_VERSION__ is defined
and has a value not less than 199901L.
-.SH "CONFORMING TO"
-C99
.SH "SEE ALSO"
.BR fpclassify (3),
.BR feature_test_macros (7)
diff --git a/man3/__setfpucw.3 b/man3/__setfpucw.3
index 3119e8d8ba..8d7244416a 100644
--- a/man3/__setfpucw.3
+++ b/man3/__setfpucw.3
@@ -15,16 +15,6 @@ transfers
to the registers of the fpu (floating point unit) on i386 architecture.
This was used to control floating point precision,
rounding and floating point exceptions.
-.SH EXAMPLE
-.BR __setfpucw(0x1372)
-
-Set fpu control word on i386 architecture to
-.br
- \- extended precision
-.br
- \- rounding to nearest
-.br
- \- exceptions on overflow, zero divide and NaN
.SH AVAILABILITY
As of glibc 2.1 this function does not exist anymore.
There are new functions from C99, with prototypes in
@@ -48,6 +38,16 @@ If direct access to the FPU control word is still needed, the _FPU_GETCW
and _FPU_SETCW macros from
.I /usr/include/fpu_control.h
can be used.
+.SH EXAMPLE
+.BR __setfpucw(0x1372)
+
+Set fpu control word on i386 architecture to
+.br
+ \- extended precision
+.br
+ \- rounding to nearest
+.br
+ \- exceptions on overflow, zero divide and NaN
.SH "SEE ALSO"
.BR feclearexcept (3)
.br
diff --git a/man3/a64l.3 b/man3/a64l.3
index 3058de9be5..07ed38f9e2 100644
--- a/man3/a64l.3
+++ b/man3/a64l.3
@@ -39,6 +39,8 @@ a-z represent 38-63
.fi
.RE
So 123 = 59*64^0 + 1*64^1 = "v/".
+.SH "CONFORMING TO"
+POSIX.1-2001.
.SH NOTES
The value returned by
.BR a64l ()
@@ -59,8 +61,6 @@ These functions are broken in glibc before 2.2.5
.LP
This is not the encoding used by
.BR uuencode (1).
-.SH "CONFORMING TO"
-POSIX.1-2001.
.SH "SEE ALSO"
.BR uuencode (1),
.BR itoa (3),
diff --git a/man3/addseverity.3 b/man3/addseverity.3
index 8abd0bb6e6..482310a859 100644
--- a/man3/addseverity.3
+++ b/man3/addseverity.3
@@ -45,9 +45,6 @@ Upon error, the return value is
.BR MM_NOTOK .
Possible errors include: out of memory, attempt to remove a
nonexistent or default severity class.
-.SH NOTES
-New severity classes can also be added by setting the environment variable
-.BR SEV_LEVEL .
.SH "CONFORMING TO"
This function is not specified in the X/Open Portability Guide
although the
@@ -55,6 +52,9 @@ although the
function is.
It is available on System V
systems.
+.SH NOTES
+New severity classes can also be added by setting the environment variable
+.BR SEV_LEVEL .
.SH "SEE ALSO"
.BR fmtmsg (3),
.BR feature_test_macros (7)
diff --git a/man3/adjtime.3 b/man3/adjtime.3
index 82d9ad5aef..57d0136b33 100644
--- a/man3/adjtime.3
+++ b/man3/adjtime.3
@@ -70,6 +70,26 @@ If
is not NULL, then the buffer that it points to is used to return
the amount of time remaining from any previous adjustment that
has not yet been completed.
+.SH "RETURN VALUE"
+On success,
+.BR adjtime ()
+returns 0. On failure, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH ERRORS
+.TP
+.B EINVAL
+The adjustment in
+.I delta
+is outside the permitted range.
+.TP
+.B EPERM
+The caller does not have sufficient privilege to adjust the time.
+Under Linux the
+.B CAP_SYS_TIME
+capability is required.
+.SH CONFORMING TO
+4.3BSD, System V.
.SH NOTES
The adjustment that
.BR adjtime ()
@@ -91,26 +111,6 @@ In the glibc implementation,
must be less than or equal to (INT_MAX / 1000000 \- 2)
and greater than or equal to (INT_MIN / 1000000 + 2)
(respectively 2145 and \-2145 seconds on x86).
-.SH "RETURN VALUE"
-On success,
-.BR adjtime ()
-returns 0. On failure, \-1 is returned, and
-.I errno
-is set to indicate the error.
-.SH ERRORS
-.TP
-.B EINVAL
-The adjustment in
-.I delta
-is outside the permitted range.
-.TP
-.B EPERM
-The caller does not have sufficient privilege to adjust the time.
-Under Linux the
-.B CAP_SYS_TIME
-capability is required.
-.SH CONFORMING TO
-4.3BSD, System V.
.SH BUGS
Currently, if
.I delta
diff --git a/man3/aio_read.3 b/man3/aio_read.3
index 81372327d8..4ca419a487 100644
--- a/man3/aio_read.3
+++ b/man3/aio_read.3
@@ -99,6 +99,8 @@ This function is not supported.
The file is a regular file, we start reading before end-of-file
and want at least one byte, but the starting position is past
the maximum offset for this file.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
It is a good idea to zero out the control block before use.
This control block must not be changed while the read operation
@@ -108,8 +110,6 @@ The buffer area being read into
must not be accessed during the operation or undefined results may
occur.
The memory areas involved must remain valid.
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR aio_cancel (3),
.BR aio_error (3),
diff --git a/man3/aio_suspend.3 b/man3/aio_suspend.3
index dd52289065..d05c2eb2ae 100644
--- a/man3/aio_suspend.3
+++ b/man3/aio_suspend.3
@@ -67,12 +67,12 @@ had completed.
.B EINTR
The call was ended by signal.
(Possibly the completion signal of one of the operations we were waiting for.)
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
One can achieve polling by using a non-NULL
.I timeout
that specifies a zero time interval.
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR aio_cancel (3),
.BR aio_error (3),
diff --git a/man3/aio_write.3 b/man3/aio_write.3
index 828dfab6cf..df794eb52a 100644
--- a/man3/aio_write.3
+++ b/man3/aio_write.3
@@ -99,6 +99,8 @@ are invalid.
.TP
.B ENOSYS
This function is not supported.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
It is a good idea to zero out the control block before use.
This control block must not be changed while the write operation
@@ -108,8 +110,6 @@ The buffer area being written out
must not be accessed during the operation or undefined results may
occur.
The memory areas involved must remain valid.
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR aio_cancel (3),
.BR aio_error (3),
diff --git a/man3/argz_add.3 b/man3/argz_add.3
index 1c67bf16ef..3d51b6ee14 100644
--- a/man3/argz_add.3
+++ b/man3/argz_add.3
@@ -203,10 +203,11 @@ all null bytes ('\\0') except the last by
All argz functions that do memory allocation have a return type of
\fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP
if an allocation error occurs.
-.SH BUGS
-Argz vectors without a terminating null byte may lead to Segmentation Faults.
.SH CONFORMING TO
These functions are a GNU extension.
Handle with care.
+.SH BUGS
+Argz vectors without a terminating null byte may lead to
+Segmentation Faults.
.SH "SEE ALSO"
.BR envz (3)
diff --git a/man3/atexit.3 b/man3/atexit.3
index 7e269553dc..6e5f0a1a1d 100644
--- a/man3/atexit.3
+++ b/man3/atexit.3
@@ -64,6 +64,23 @@ The
.BR atexit ()
function returns the value 0 if successful; otherwise
it returns a non-zero value.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
+.SH NOTES
+.\" FIXME .SS Linux Notes here, and grammar in this sentence
+Since glibc 2.2.3,
+.BR atexit ()
+(and
+.BR on_exit (3))
+can be used to within a shared library to establish functions
+that are called when the shared library is unloaded.
+.PP
+Functions registered using
+.BR atexit ()
+(and
+.BR on_exit (3))
+are not called if a process terminates abnormally because
+of the delivery of a signal.
.SH EXAMPLE
.nf
#include <stdio.h>
@@ -93,22 +110,6 @@ main(void)
return EXIT_SUCCESS;
}
.fi
-.SH NOTES
-Since glibc 2.2.3,
-.BR atexit ()
-(and
-.BR on_exit (3))
-can be used to within a shared library to establish functions
-that are called when the shared library is unloaded.
-.PP
-Functions registered using
-.BR atexit ()
-(and
-.BR on_exit (3))
-are not called if a process terminates abnormally because
-of the delivery of a signal.
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
.SH "SEE ALSO"
.BR _exit (3),
.BR exit (3),
diff --git a/man3/basename.3 b/man3/basename.3
index 2e1ec79643..84e1e8ecd4 100644
--- a/man3/basename.3
+++ b/man3/basename.3
@@ -112,25 +112,14 @@ path dirname basename
"." "." "."
".." "." ".."
.fi
-.SH EXAMPLE
-.RS
-.nf
-char *dirc, *basec, *bname, *dname;
-char *path = "/etc/passwd";
-
-dirc = strdup(path);
-basec = strdup(path);
-dname = dirname(dirc);
-bname = basename(basec);
-printf("dirname=%s, basename=%s\\n", dname, bname);
-.fi
-.RE
.SH "RETURN VALUE"
Both
.BR dirname ()
and
.BR basename ()
return pointers to null-terminated strings.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
There are two different versions of
.BR basename ()
@@ -162,8 +151,19 @@ Before glibc 2.2.1, the glibc version of
.BR dirname ()
did not correctly handle pathnames with trailing '/' characters,
and generated a segfault if given a NULL argument.
-.SH "CONFORMING TO"
-POSIX.1-2001
+.SH EXAMPLE
+.RS
+.nf
+char *dirc, *basec, *bname, *dname;
+char *path = "/etc/passwd";
+
+dirc = strdup(path);
+basec = strdup(path);
+dname = dirname(dirc);
+bname = basename(basec);
+printf("dirname=%s, basename=%s\\n", dname, bname);
+.fi
+.RE
.SH "SEE ALSO"
.BR basename (1),
.BR dirname (1),
diff --git a/man3/bsd_signal.3 b/man3/bsd_signal.3
index 30df1b9eec..072cbb15b8 100644
--- a/man3/bsd_signal.3
+++ b/man3/bsd_signal.3
@@ -58,6 +58,8 @@ on error.
.SH ERRORS
As for
.BR signal (2).
+.SH "CONFORMING TO"
+4.2BSD, POSIX.1-2001.
.SH NOTES
Use of
.BR bsd_signal ()
@@ -81,8 +83,6 @@ The use of
is a GNU extension;
this type is only defined if
the _GNU_SOURCE feature test macro is defined.
-.SH "CONFORMING TO"
-4.2BSD, POSIX.1-2001.
.SH "SEE ALSO"
.BR sigaction (2),
.BR signal (2),
diff --git a/man3/bsearch.3 b/man3/bsearch.3
index 9742ba56f4..d3b24aa785 100644
--- a/man3/bsearch.3
+++ b/man3/bsearch.3
@@ -62,6 +62,8 @@ function returns a pointer to a matching member of the
array, or NULL if no match is found.
If there are multiple elements that
match the key, the element returned is unspecified.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, POSIX.1-2001, C89, C99
.SH EXAMPLE
The example below first sorts an array of structures using
.BR qsort (3),
@@ -112,8 +114,6 @@ main(int argc, char **argv)
}
.fi
.\" this example referred to in qsort.3
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, POSIX.1-2001, C89, C99
.SH "SEE ALSO"
.BR hsearch (3),
.BR lsearch (3),
diff --git a/man3/cabs.3 b/man3/cabs.3
index 8141af9a50..564bd1b30f 100644
--- a/man3/cabs.3
+++ b/man3/cabs.3
@@ -19,10 +19,10 @@ The
.BR cabs ()
function returns the absolute value of the complex number z. The
result is a real number.
-.SH NOTES
-The function is actually an alias for hypot(a,b) = sqrt(a*a+b*b).
.SH "CONFORMING TO"
C99
+.SH NOTES
+The function is actually an alias for hypot(a,b) = sqrt(a*a+b*b).
.SH "SEE ALSO"
.BR abs (3),
.BR cimag (3),
diff --git a/man3/catgets.3 b/man3/catgets.3
index 13dd4ba3ed..84fb0cce18 100644
--- a/man3/catgets.3
+++ b/man3/catgets.3
@@ -64,6 +64,8 @@ On failure,
.BR catgets ()
returns the value
.IR message .
+.SH "CONFORMING TO"
+POSIX.1-2001.
.SH NOTES
These functions are only available in libc.so.4.4.4c and above.
The Jan 1987 X/Open Portability Guide specifies a more subtle
@@ -77,8 +79,6 @@ the specified message.
These two possible error returns seem to be discarded in SUSv2
in favour of always returning
.IR message .
-.SH "CONFORMING TO"
-POSIX.1-2001.
.SH "SEE ALSO"
.BR catopen (3),
.BR setlocale (3)
diff --git a/man3/catopen.3 b/man3/catopen.3
index 27898dbb13..ef691c4cfd 100644
--- a/man3/catopen.3
+++ b/man3/catopen.3
@@ -134,6 +134,13 @@ is set to
The language to use if
.I flag
is 0.
+.SH "CONFORMING TO"
+POSIX.1-2001.
+.\" In XPG 1987, Vol. 3 it says:
+.\" .I "The flag argument of catopen is reserved for future use"
+.\" .IR "and should be set to 0" .
+It is unclear what the source was for the constants MCLoadBySet
+and MCLoadAll (see below).
.SH NOTES
The above is the POSIX.1-2001 description.
The glibc value for NL_CAT_LOCALE is 1.
@@ -164,13 +171,6 @@ The default search path varies, but usually looks at a number of places below
.I /etc/locale
and
.IR /usr/lib/locale .
-.SH "CONFORMING TO"
-POSIX.1-2001.
-.\" In XPG 1987, Vol. 3 it says:
-.\" .I "The flag argument of catopen is reserved for future use"
-.\" .IR "and should be set to 0" .
-It is unclear what the source was for the constants MCLoadBySet
-and MCLoadAll.
.SH "SEE ALSO"
.BR catgets (3),
.BR setlocale (3)
diff --git a/man3/ceil.3 b/man3/ceil.3
index 75ff0e3c54..3a5fd8052e 100644
--- a/man3/ceil.3
+++ b/man3/ceil.3
@@ -47,6 +47,11 @@ No errors other than EDOM and ERANGE can occur.
If \fIx\fP is NaN, then NaN is returned and
.I errno
may be set to EDOM.
+.SH "CONFORMING TO"
+The
+.BR ceil ()
+function conforms to SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
+The other functions are from C99.
.SH NOTES
SUSv2 and POSIX.1-2001 contain text about overflow (which might set
.I errno
@@ -58,11 +63,6 @@ of the exponent is smaller than the number of mantissa bits.
For the IEEE-754 standard 32-bit and 64-bit floating point numbers
the maximum value of the exponent is 128 (resp. 1024), and the number
of mantissa bits is 24 (resp. 53).)
-.SH "CONFORMING TO"
-The
-.BR ceil ()
-function conforms to SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
-The other functions are from C99.
.SH "SEE ALSO"
.BR floor (3),
.BR lrint (3),
diff --git a/man3/cimag.3 b/man3/cimag.3
index 1ee279abb2..0c0569b3e4 100644
--- a/man3/cimag.3
+++ b/man3/cimag.3
@@ -20,11 +20,11 @@ The
function returns the imaginary part of the complex number z.
.LP
One has z = creal(z) + I * cimag(z).
+.SH "CONFORMING TO"
+C99
.SH NOTES
gcc also supports __imag__.
That is a GNU extension.
-.SH "CONFORMING TO"
-C99
.SH "SEE ALSO"
.BR cabs (3),
.BR creal (3),
diff --git a/man3/clock_getres.3 b/man3/clock_getres.3
index 9c4547eca9..2240541c93 100644
--- a/man3/clock_getres.3
+++ b/man3/clock_getres.3
@@ -138,6 +138,23 @@ specified is not supported on this system.
.B EPERM
.BR clock_settime ()
does not have permission to set the clock indicated.
+.SH "CONFORMING TO"
+SUSv2, POSIX.1-2001.
+.SH AVAILABILITY
+On POSIX systems on which these functions are available, the symbol
+.B _POSIX_TIMERS
+is defined in <unistd.h> to a value greater than 0.
+The symbols
+.BR _POSIX_MONOTONIC_CLOCK ,
+.BR _POSIX_CPUTIME ,
+.B _POSIX_THREAD_CPUTIME
+indicate that
+.BR CLOCK_MONOTONIC ,
+.BR CLOCK_PROCESS_CPUTIME_ID ,
+.B CLOCK_THREAD_CPUTIME_ID
+are available.
+(See also
+.BR sysconf (3).)
.SH NOTES
Most systems require the program be linked with the librt
library to use these functions.
@@ -172,23 +189,6 @@ Glibc contains no provisions to deal with these offsets (unlike the Linux
Kernel).
Typically these offsets are small and therefore the effects may be
negligible in most cases.
-.SH AVAILABILITY
-On POSIX systems on which these functions are available, the symbol
-.B _POSIX_TIMERS
-is defined in <unistd.h> to a value greater than 0.
-The symbols
-.BR _POSIX_MONOTONIC_CLOCK ,
-.BR _POSIX_CPUTIME ,
-.B _POSIX_THREAD_CPUTIME
-indicate that
-.BR CLOCK_MONOTONIC ,
-.BR CLOCK_PROCESS_CPUTIME_ID ,
-.B CLOCK_THREAD_CPUTIME_ID
-are available.
-(See also
-.BR sysconf (3).)
-.SH "CONFORMING TO"
-SUSv2, POSIX.1-2001.
.SH "SEE ALSO"
.BR date (1),
.BR adjtimex (2),
diff --git a/man3/cmsg.3 b/man3/cmsg.3
index 4f17ea6698..cc8f3dff6f 100644
--- a/man3/cmsg.3
+++ b/man3/cmsg.3
@@ -134,6 +134,27 @@ flag is set in the
.I msg_flags
member of the
.BR msghdr .
+.SH "CONFORMING TO"
+This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-Lite,
+the IPv6 advanced API described in RFC\ 2292 and the SUSv2.
+.B
+CMSG_ALIGN
+is a Linux extension.
+.SH NOTES
+For portability, ancillary data should be accessed only using the macros
+described here.
+.BR CMSG_ALIGN ()
+is a Linux extension and should be not used in portable programs.
+.PP
+In Linux,
+.BR CMSG_LEN ,
+.BR CMSG_DATA ,
+and
+.BR CMSG_ALIGN ()
+are constant expressions (assuming their argument is constant);
+this could be used to declare the size of global
+variables.
+This may be not portable, however.
.SH EXAMPLE
This code looks for the
.B IP_TTL
@@ -192,27 +213,6 @@ msg.msg_controllen = cmsg->cmsg_len;
.ta
.fi
.RE
-.SH NOTES
-For portability, ancillary data should be accessed only using the macros
-described here.
-.BR CMSG_ALIGN ()
-is a Linux extension and should be not used in portable programs.
-.PP
-In Linux,
-.BR CMSG_LEN ,
-.BR CMSG_DATA ,
-and
-.BR CMSG_ALIGN ()
-are constant expressions (assuming their argument is constant);
-this could be used to declare the size of global
-variables.
-This may be not portable, however.
-.SH "CONFORMING TO"
-This ancillary data model conforms to the POSIX.1g draft, 4.4BSD-Lite,
-the IPv6 advanced API described in RFC\ 2292 and the SUSv2.
-.B
-CMSG_ALIGN
-is a Linux extension.
.SH "SEE ALSO"
.BR recvmsg (2),
.BR sendmsg (2)
diff --git a/man3/confstr.3 b/man3/confstr.3
index d35547bfa1..c0870770f8 100644
--- a/man3/confstr.3
+++ b/man3/confstr.3
@@ -118,6 +118,8 @@ is set to
If the value of
.I name
is invalid.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH EXAMPLE
The following code fragment determines the path where to find
the POSIX.2 system utilities:
@@ -130,8 +132,6 @@ char *pathbuf; size_t n;
n = confstr(_CS_PATH,NULL,(size_t)0);
if ((pathbuf = malloc(n)) == NULL) abort();
confstr(_CS_PATH, pathbuf, n);
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR sh (1),
.BR exec (3),
diff --git a/man3/copysign.3 b/man3/copysign.3
index 48adc7430b..ef3ff7af29 100644
--- a/man3/copysign.3
+++ b/man3/copysign.3
@@ -47,14 +47,14 @@ The
functions return a value whose absolute value matches
that of \fIx\fP, but whose sign matches that of \fIy\fP.
If \fIx\fP is a NaN, then a NaN with the sign of \fIy\fP is returned.
+.SH "CONFORMING TO"
+C99, 4.3BSD.
+This function is defined in IEC 559 (and the appendix with
+recommended functions in IEEE 754/IEEE 854).
.SH NOTES
On architectures where the floating-point formats are not IEEE 754 compliant,
the
.BR copysign ()
functions may treat a negative zero as positive.
-.SH "CONFORMING TO"
-C99, 4.3BSD.
-This function is defined in IEC 559 (and the appendix with
-recommended functions in IEEE 754/IEEE 854).
.SH "SEE ALSO"
.BR signbit (3)
diff --git a/man3/creal.3 b/man3/creal.3
index dbc774be6a..77cdf7497f 100644
--- a/man3/creal.3
+++ b/man3/creal.3
@@ -20,11 +20,11 @@ The
function returns the real part of the complex number z.
.LP
One has z = creal(z) + I * cimag(z).
+.SH "CONFORMING TO"
+C99
.SH NOTES
The gcc supports also __real__.
That is a GNU extension.
-.SH "CONFORMING TO"
-C99
.SH "SEE ALSO"
.BR cabs (3),
.BR cimag (3),
diff --git a/man3/crypt.3 b/man3/crypt.3
index 31d943c79d..73559129d0 100644
--- a/man3/crypt.3
+++ b/man3/crypt.3
@@ -135,6 +135,8 @@ function was not implemented, probably because of U.S.A. export restrictions.
.\" .PP
.\" Making encrypted data computed using crypt() publicly available has
.\" to be considered insecure for the given reasons.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, POSIX.1-2001
.SH NOTES
.SS Glibc Notes
The glibc2 version of this function has the following additional features.
@@ -155,8 +157,6 @@ is significant here (instead of only the first
8 bytes).
.LP
Programs using this function must be linked with \-lcrypt.
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, POSIX.1-2001
.SH "SEE ALSO"
.BR login (1),
.BR passwd (1),
diff --git a/man3/ctime.3 b/man3/ctime.3
index 635166d00d..3f33c42c84 100644
--- a/man3/ctime.3
+++ b/man3/ctime.3
@@ -226,6 +226,15 @@ Each of these functions returns the value described, or NULL
(\-1 in case of
.BR mktime ())
in case an error was detected.
+.SH "CONFORMING TO"
+POSIX.1-2001.
+C89 and C99 specify
+.BR asctime (),
+.BR ctime (),
+.BR gmtime (),
+.BR localtime (),
+and
+.BR mktime ()
.SH NOTES
The four functions
.BR asctime (),
@@ -260,15 +269,6 @@ const char *tm_zone; /* Timezone abbreviation */
defined when _BSD_SOURCE was set before including
.IR <time.h> .
This is a BSD extension, present in 4.3BSD-Reno.
-.SH "CONFORMING TO"
-POSIX.1-2001.
-C89 and C99 specify
-.BR asctime (),
-.BR ctime (),
-.BR gmtime (),
-.BR localtime (),
-and
-.BR mktime ()
.SH "SEE ALSO"
.BR date (1),
.BR gettimeofday (2),
diff --git a/man3/daemon.3 b/man3/daemon.3
index 18b7e7950c..ab2f9e875a 100644
--- a/man3/daemon.3
+++ b/man3/daemon.3
@@ -72,6 +72,12 @@ to any of the errors specified for the
.BR fork (2)
and
.BR setsid (2).
+.SH CONFORMING TO
+Not in POSIX.1-2001.
+A similar function appears on the BSDs.
+The
+.BR daemon ()
+function first appeared in 4.4BSD.
.SH NOTES
The glibc implementation can also return \-1 when
.I /dev/null
@@ -80,12 +86,6 @@ major and minor numbers.
In this case
.I errno
need not be set.
-.SH CONFORMING TO
-Not in POSIX.1-2001.
-A similar function appears on the BSDs.
-The
-.BR daemon ()
-function first appeared in 4.4BSD.
.SH "SEE ALSO"
.BR fork (2),
.BR setsid (2)
diff --git a/man3/dirfd.3 b/man3/dirfd.3
index 0141e61fa2..e023b095a4 100644
--- a/man3/dirfd.3
+++ b/man3/dirfd.3
@@ -46,6 +46,12 @@ It will be automatically closed when
is called.
.SH ERRORS
On error \-1 is returned.
+.SH "CONFORMING TO"
+This is a BSD extension, present in 4.3BSD-Reno, not in 4.2BSD.
+It is present in libc5 (since 5.1.2) and in glibc2.
+.\" As at 2006:
+This function is under consideration for inclusion in
+a future version of POSIX.1.
.SH NOTES
The prototype for
.BR dirfd ()
@@ -54,12 +60,6 @@ is only available if
or
.B _SVID_SOURCE
is defined.
-.SH "CONFORMING TO"
-This is a BSD extension, present in 4.3BSD-Reno, not in 4.2BSD.
-It is present in libc5 (since 5.1.2) and in glibc2.
-.\" As at 2006:
-This function is under consideration for inclusion in
-a future version of POSIX.1.
.SH "SEE ALSO"
.BR open (2),
.BR closedir (3),
diff --git a/man3/div.3 b/man3/div.3
index cdd878d2b6..0cca8cfbfd 100644
--- a/man3/div.3
+++ b/man3/div.3
@@ -70,12 +70,6 @@ of the indicated name, in all cases with fields \fIquot\fP and \fIrem\fP
of the same type as the function arguments.
.SH "RETURN VALUE"
The \fIdiv_t\fP (etc.) structure.
-.SH EXAMPLE
-After
-.nf
- div_t q = div(\-5, 3);
-.fi
-the values \fIq.quot\fP and \fIq.rem\fP are \-1 and \-2, respectively.
.SH "CONFORMING TO"
SVr4, 4.3BSD, C89.
The functions
@@ -83,6 +77,12 @@ The functions
and
.BR imaxdiv ()
were added in C99.
+.SH EXAMPLE
+After
+.nf
+ div_t q = div(\-5, 3);
+.fi
+the values \fIq.quot\fP and \fIq.rem\fP are \-1 and \-2, respectively.
.SH "SEE ALSO"
.BR abs (3),
.BR remainder (3)
diff --git a/man3/dl_iterate_phdr.3 b/man3/dl_iterate_phdr.3
index 199336b721..f3f3838684 100644
--- a/man3/dl_iterate_phdr.3
+++ b/man3/dl_iterate_phdr.3
@@ -140,6 +140,15 @@ in virtual memory using the formula:
.nf
addr == info->dlpi_addr + info->dlpi_phdr[x].p_vaddr;
.fi
+.SH RETURN VALUE
+The
+.BR dl_iterate_phdr ()
+function returns whatever value was returned by the last call to
+.IR callback .
+.SH "CONFORMING TO"
+The
+.BR dl_iterate_phdr ()
+function is Linux specific and should be avoided in portable applications.
.SH EXAMPLE
The following program displays a list of pathnames of the
shared objects it has loaded.
@@ -174,15 +183,6 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
-.SH RETURN VALUE
-The
-.BR dl_iterate_phdr ()
-function returns whatever value was returned by the last call to
-.IR callback .
-.SH "CONFORMING TO"
-The
-.BR dl_iterate_phdr ()
-function is Linux specific and should be avoided in portable applications.
.SH "SEE ALSO"
.BR ldd (1),
.BR objdump (1),
diff --git a/man3/dlopen.3 b/man3/dlopen.3
index 38f29a2d79..410a29fa49 100644
--- a/man3/dlopen.3
+++ b/man3/dlopen.3
@@ -357,6 +357,37 @@ The function
does the same as
.BR dlsym ()
but takes a version string as an additional argument.
+.SH "CONFORMING TO"
+POSIX.1-2001 describes
+.BR dlclose (),
+.BR dlerror (),
+.BR dlopen (),
+and
+.BR dlsym ().
+.SH NOTES
+The symbols RTLD_DEFAULT and RTLD_NEXT are defined by
+.I <dlfcn.h>
+only when _GNU_SOURCE was defined before including it.
+.\" .LP
+.\" The string returned by
+.\" .BR dlerror ()
+.\" should not be modified.
+.\" Some systems give the prototype as
+.\" .sp
+.\" .in +5
+.\" .B "const char *dlerror(void);"
+.\" .in
+
+Since glibc 2.2.3,
+.BR atexit (3)
+can be used to register an exit handler that is automatically
+called when a library is unloaded.
+.SS History
+The dlopen interface standard comes from SunOS.
+That system also has
+.BR dladdr (),
+but not
+.BR dlvsym ().
.SH EXAMPLE
Load the math library, and print the cosine of 2.0:
.RS
@@ -410,37 +441,6 @@ follows, using bar.c as the example name:
.LP
gcc \-shared \-nostartfiles \-o bar bar.c
.RE
-.SH NOTES
-The symbols RTLD_DEFAULT and RTLD_NEXT are defined by
-.I <dlfcn.h>
-only when _GNU_SOURCE was defined before including it.
-.\" .LP
-.\" The string returned by
-.\" .BR dlerror ()
-.\" should not be modified.
-.\" Some systems give the prototype as
-.\" .sp
-.\" .in +5
-.\" .B "const char *dlerror(void);"
-.\" .in
-
-Since glibc 2.2.3,
-.BR atexit (3)
-can be used to register an exit handler that is automatically
-called when a library is unloaded.
-.SS History
-The dlopen interface standard comes from SunOS.
-That system also has
-.BR dladdr (),
-but not
-.BR dlvsym ().
-.SH "CONFORMING TO"
-POSIX.1-2001 describes
-.BR dlclose (),
-.BR dlerror (),
-.BR dlopen (),
-and
-.BR dlsym ().
.SH "SEE ALSO"
.BR ld (1),
.BR ldd (1),
diff --git a/man3/dprintf.3 b/man3/dprintf.3
index 83e4e98d7a..157403551c 100644
--- a/man3/dprintf.3
+++ b/man3/dprintf.3
@@ -45,6 +45,8 @@ and
except that they output to a file descriptor
.I fd
instead of to a given stream.
+.SH "CONFORMING TO"
+These functions are GNU extensions.
.SH NOTES
These functions are GNU extensions, not in C or POSIX.
Clearly, the names were badly chosen.
@@ -68,8 +70,6 @@ intended to be portable.
A better name would have been
.BR fdprintf (3).
-.SH "CONFORMING TO"
-These functions are GNU extensions.
.SH "SEE ALSO"
.BR printf (3),
.BR feature_test_macros (7)
diff --git a/man3/ecvt.3 b/man3/ecvt.3
index f5555a3c9d..fce837c712 100644
--- a/man3/ecvt.3
+++ b/man3/ecvt.3
@@ -78,6 +78,9 @@ The static string is overwritten by each call to
.BR ecvt ()
or
.BR fcvt ().
+.SH "CONFORMING TO"
+SVr2;
+marked as LEGACY in POSIX.1-2001.
.SH NOTES
These functions are obsolete.
Instead,
@@ -88,9 +91,6 @@ Linux libc4 and libc5 specified the type of
as
.BR size_t .
Not all locales use a point as the radix character (`decimal point').
-.SH "CONFORMING TO"
-SVr2;
-marked as LEGACY in POSIX.1-2001.
.SH "SEE ALSO"
.BR ecvt_r (3),
.BR gcvt (3),
diff --git a/man3/ecvt_r.3 b/man3/ecvt_r.3
index 501c76b197..be943c2157 100644
--- a/man3/ecvt_r.3
+++ b/man3/ecvt_r.3
@@ -68,13 +68,13 @@ and
.BR qecvt (3).
.SH "RETURN VALUE"
These functions return 0 on success, and \-1 otherwise.
+.SH "CONFORMING TO"
+These functions are GNU extensions.
.SH NOTES
These functions are obsolete.
Instead,
.BR sprintf (3)
is recommended.
-.SH "CONFORMING TO"
-These functions are GNU extensions.
.SH "SEE ALSO"
.BR ecvt (3),
.BR qecvt (3),
diff --git a/man3/encrypt.3 b/man3/encrypt.3
index 0cf48f4f51..7c975e44a8 100644
--- a/man3/encrypt.3
+++ b/man3/encrypt.3
@@ -112,6 +112,19 @@ On success, it is unchanged.
.BR ENOSYS
The function is not provided.
(For example because of former USA export restrictions.)
+.SH "CONFORMING TO"
+The functions
+.BR encrypt ()
+and
+.BR setkey ()
+conform to SVr4, SUSv2, and POSIX.1-2001.
+The functions
+.BR encrypt_r ()
+and
+.BR setkey_r ()
+are GNU extensions.
+.SH NOTES
+In glibc 2.2 these functions use the DES algorithm.
.SH EXAMPLE
You need to link with libcrypt to compile this example with glibc 2.2.
To do useful work the key[] and txt[] arrays must be filled with a
@@ -133,19 +146,6 @@ main(void)
encrypt(txt, 1); /* decode */
}
.fi
-.SH NOTES
-In glibc 2.2 these functions use the DES algorithm.
-.SH "CONFORMING TO"
-The functions
-.BR encrypt ()
-and
-.BR setkey ()
-conform to SVr4, SUSv2, and POSIX.1-2001.
-The functions
-.BR encrypt_r ()
-and
-.BR setkey_r ()
-are GNU extensions.
.SH "SEE ALSO"
.BR cbc_crypt (3),
.BR crypt (3),
diff --git a/man3/envz_add.3 b/man3/envz_add.3
index 80ce4633c9..c7cf739057 100644
--- a/man3/envz_add.3
+++ b/man3/envz_add.3
@@ -113,6 +113,9 @@ removes all entries with value NULL.
All envz functions that do memory allocation have a return type of
\fIerror_t\fP, and return 0 for success, and \fBENOMEM\fP
if an allocation error occurs.
+.SH "CONFORMING TO"
+These functions are a GNU extension.
+Handle with care.
.SH EXAMPLE
.sp
.nf
@@ -135,8 +138,5 @@ main(int argc, char *argv[], char *envp[])
exit(EXIT_SUCCESS);
}
.fi
-.SH "CONFORMING TO"
-These functions are a GNU extension.
-Handle with care.
.SH "SEE ALSO"
.BR argz (3)
diff --git a/man3/ether_aton.3 b/man3/ether_aton.3
index 083ed039ce..7960e8e846 100644
--- a/man3/ether_aton.3
+++ b/man3/ether_aton.3
@@ -118,9 +118,9 @@ struct ether_addr {
}
.fi
.in -0.5i
-.SH BUGS
-The glibc 2.2.5 implementation of ether_line() is broken.
.SH "CONFORMING TO"
4.3BSD, SunOS
+.SH BUGS
+The glibc 2.2.5 implementation of ether_line() is broken.
.SH "SEE ALSO"
.BR ethers (5)
diff --git a/man3/exec.3 b/man3/exec.3
index 7dad2c7b7c..b71609e011 100644
--- a/man3/exec.3
+++ b/man3/exec.3
@@ -161,13 +161,16 @@ The return value is \-1,
and the global variable
.I errno
will be set to indicate the error.
-.SH FILES
-.I /bin/sh
.SH ERRORS
All of these functions may fail and set
.I errno
for any of the errors specified for the library function
.BR execve (2).
+.SH FILES
+.\" FIXME remove this section?
+.I /bin/sh
+.SH "CONFORMING TO"
+POSIX.1-2001.
.SH NOTES
On some other systems the default path (used when the environment
does not contain the variable \fBPATH\fR) has the current working
@@ -202,8 +205,6 @@ and
upon which they returned.
They now return if any error other than the ones
described above occurs.
-.SH "CONFORMING TO"
-POSIX.1-2001.
.SH "SEE ALSO"
.BR sh (1),
.BR execve (2),
diff --git a/man3/fclose.3 b/man3/fclose.3
index 876a365669..04aec840c9 100644
--- a/man3/fclose.3
+++ b/man3/fclose.3
@@ -85,6 +85,8 @@ for any of the errors specified for the routines
.BR write (2)
or
.BR fflush (3).
+.SH "CONFORMING TO"
+C89, C99.
.SH NOTES
Note that
.BR fclose ()
@@ -95,8 +97,6 @@ on disk the kernel buffers must be flushed too, e.g. with
.BR sync (2)
or
.BR fsync (2).
-.SH "CONFORMING TO"
-C89, C99.
.SH "SEE ALSO"
.BR close (2),
.BR fcloseall (3),
diff --git a/man3/fenv.3 b/man3/fenv.3
index 2d5ac479d2..03f7772f3e 100644
--- a/man3/fenv.3
+++ b/man3/fenv.3
@@ -207,7 +207,13 @@ These functions return zero on success and non-zero if an error occurred.
.\" Earlier seven of these functions were listed as returning void.
.\" This was corrected in Corrigendum 1 (ISO/IEC 9899:1999/Cor.1:2001(E))
.\" of the C99 Standard.
+.SH "CONFORMING TO"
+IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99.
.SH NOTES
+.\" FIXME notes of the following form are not consistent across pages
+Link with
+.BR \-lm .
+.PP
.SS Glibc Notes
If possible, the GNU C Library defines a macro
.B FE_NOMASK_ENV
@@ -252,10 +258,5 @@ and \-1 otherwise.
The
.BR fegetexcept ()
function returns the set of all currently enabled exceptions.
-.SH NOTES
-Link with
-.BR \-lm .
-.SH "CONFORMING TO"
-IEC 60559 (IEC 559:1989), ANSI/IEEE 854, C99.
.SH "SEE ALSO"
.BR feature_test_macros (7)
diff --git a/man3/fflush.3 b/man3/fflush.3
index 419ce8e517..2d401868a4 100644
--- a/man3/fflush.3
+++ b/man3/fflush.3
@@ -84,6 +84,8 @@ may also fail and set
.I errno
for any of the errors specified for the routine
.BR write (2).
+.SH "CONFORMING TO"
+C89, C99.
.SH NOTES
Note that
.BR fflush ()
@@ -93,8 +95,6 @@ the kernel buffers must be flushed too, e.g. with
.BR sync (2)
or
.BR fsync (2).
-.SH "CONFORMING TO"
-C89, C99.
.SH "SEE ALSO"
.BR fsync (2),
.BR sync (2),
diff --git a/man3/flockfile.3 b/man3/flockfile.3
index cda59aed4e..e9fe8cb9bb 100644
--- a/man3/flockfile.3
+++ b/man3/flockfile.3
@@ -97,12 +97,12 @@ function returns zero for success
(the lock was obtained), and non-zero for failure.
.SH ERRORS
None.
+.SH "CONFORMING TO"
+POSIX.1-2001.
.SH AVAILABILITY
These functions are available when _POSIX_THREAD_SAFE_FUNCTIONS
is defined.
They are in libc since libc 5.1.1 and in glibc
since glibc 2.0.
-.SH "CONFORMING TO"
-POSIX.1-2001.
.SH "SEE ALSO"
.BR unlocked_stdio (3)
diff --git a/man3/floor.3 b/man3/floor.3
index 9b9fefac2e..9d4d0afc49 100644
--- a/man3/floor.3
+++ b/man3/floor.3
@@ -46,6 +46,11 @@ No errors other than EDOM and ERANGE can occur.
If \fIx\fP is NaN, then NaN is returned and
.I errno
may be set to EDOM.
+.SH "CONFORMING TO"
+The
+.BR floor ()
+function conforms to SVr4, 4.3BSD, C89.
+The other functions are from C99.
.SH NOTES
SUSv2 and POSIX.1-2001 contain text about overflow (which might set
.I errno
@@ -57,11 +62,6 @@ of the exponent is smaller than the number of mantissa bits.
For the IEEE-754 standard 32-bit and 64-bit floating point numbers
the maximum value of the exponent is 128 (resp. 1024), and the number
of mantissa bits is 24 (resp. 53).)
-.SH "CONFORMING TO"
-The
-.BR floor ()
-function conforms to SVr4, 4.3BSD, C89.
-The other functions are from C99.
.SH "SEE ALSO"
.BR ceil (3),
.BR lrint (3),
diff --git a/man3/fmemopen.3 b/man3/fmemopen.3
index 50e6df09d0..e004457b0b 100644
--- a/man3/fmemopen.3
+++ b/man3/fmemopen.3
@@ -141,6 +141,10 @@ pointer.
Otherwise, NULL is returned and the global variable
.I errno
is set to indicate the error.
+.SH "CONFORMING TO"
+These functions are GNU extensions.
+.\" Jan 06: But they appear to be going up for standardization by
+.\" POSIX/PASC/IEEE.
.SH "EXAMPLE"
The program below uses
.BR fmemopen ()
@@ -193,10 +197,6 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
-.SH "CONFORMING TO"
-These functions are GNU extensions.
-.\" Jan 06: But they appear to be going up for standardization by
-.\" POSIX/PASC/IEEE.
.SH "SEE ALSO"
.BR open (3),
.BR feature_test_macros (7)
diff --git a/man3/fmtmsg.3 b/man3/fmtmsg.3
index 0623a0b3f5..1d99b2623f 100644
--- a/man3/fmtmsg.3
+++ b/man3/fmtmsg.3
@@ -143,6 +143,21 @@ Using
or the environment variable
.B SEV_LEVEL
you can add more levels and strings to print.
+.SH "RETURN VALUE"
+The function can return 4 values:
+.TP 12n
+.B MM_OK
+Everything went smooth.
+.TP
+.B MM_NOTOK
+Complete failure.
+.TP
+.B MM_NOMSG
+Error writing to
+.IR stderr .
+.TP
+.B MM_NOCON
+Error writing to the console.
.SH ENVIRONMENT
The environment variable
.B MSGVERB
@@ -198,21 +213,6 @@ any of the predefined classes.
The printstring
is the string printed when a message of this class is processed by
.BR fmtmsg ().
-.SH "RETURN VALUE"
-The function can return 4 values:
-.TP 12n
-.B MM_OK
-Everything went smooth.
-.TP
-.B MM_NOTOK
-Complete failure.
-.TP
-.B MM_NOMSG
-Error writing to
-.IR stderr .
-.TP
-.B MM_NOCON
-Error writing to the console.
.SH "CONFORMING TO"
The functions
.BR fmtmsg ()
diff --git a/man3/fpclassify.3 b/man3/fpclassify.3
index 0cb94ca39c..2bf6991c0a 100644
--- a/man3/fpclassify.3
+++ b/man3/fpclassify.3
@@ -74,6 +74,8 @@ returns 1 if
is positive infinity, and \-1 if
.I x
is negative infinity.
+.SH "CONFORMING TO"
+C99
.SH NOTES
In glibc 2.01 and earlier,
.BR isinf ()
@@ -81,8 +83,6 @@ returns a non-zero value (actually: 1) if
.I x
is an infinity (positive or negative).
(This is all that C99 requires.)
-.SH "CONFORMING TO"
-C99
.SH "SEE ALSO"
.BR finite (3),
.BR INFINITY (3),
diff --git a/man3/fseeko.3 b/man3/fseeko.3
index 1ee12b0d29..ac30feabd0 100644
--- a/man3/fseeko.3
+++ b/man3/fseeko.3
@@ -70,11 +70,11 @@ is set to indicate the error.
.SH ERRORS
See the ERRORS in
.BR fseek (3).
+.SH "CONFORMING TO"
+SUSv2, POSIX.1-2001.
.SH NOTES
These functions are found on System V-like systems.
They are not present in libc4, libc5, glibc 2.0
but are available since glibc 2.1.
-.SH "CONFORMING TO"
-SUSv2, POSIX.1-2001.
.SH "SEE ALSO"
.BR fseek (3)
diff --git a/man3/ftime.3 b/man3/ftime.3
index 46ec2f1dd6..9efb008eb4 100644
--- a/man3/ftime.3
+++ b/man3/ftime.3
@@ -61,6 +61,8 @@ These days the contents of the \fItimezone\fP and \fIdstflag\fP
fields are undefined.
.SH "RETURN VALUE"
This function always returns 0.
+.SH "CONFORMING TO"
+4.2BSD, POSIX.1-2001.
.SH BUGS
This function is obsolete.
Don't use it.
@@ -80,8 +82,6 @@ glibc 2.1.1 is correct again.
.\" The
.\" .BR ftime ()
.\" function appeared in 4.2BSD.
-.SH "CONFORMING TO"
-4.2BSD, POSIX.1-2001.
.SH "SEE ALSO"
.BR gettimeofday (2),
.BR time (2)
diff --git a/man3/fts.3 b/man3/fts.3
index 395e9d73f2..66cf2b21f9 100644
--- a/man3/fts.3
+++ b/man3/fts.3
@@ -742,14 +742,14 @@ as follows:
.It Bq Er EINVAL
The options were invalid.
.El
+.Sh VERSIONS
+These functions are available in Linux since glibc2.
.Sh "CONFORMING TO"
4.4BSD. The
.Nm fts
utility is expected to be included in a future
.St -p1003.1-88
revision.
-.Sh VERSIONS
-These functions are available in Linux since glibc2.
.Sh SEE ALSO
.Xr find 1 ,
.Xr chdir 2 ,
diff --git a/man3/ftw.3 b/man3/ftw.3
index be6a22a617..e79084d40c 100644
--- a/man3/ftw.3
+++ b/man3/ftw.3
@@ -295,6 +295,8 @@ then the only non-zero value that should be used by \fIfn\fP()
to terminate the tree walk is \fBFTW_STOP\fP,
and that value is returned as the result of
.BR nftw ().
+.SH "CONFORMING TO"
+POSIX.1-2001, SVr4, SUSv1.
.SH NOTES
The function
.BR nftw ()
@@ -321,8 +323,6 @@ The function
is available since glibc 2.1.
\fBFTW_ACTIONRETVAL\fP is glibc specific.
-.SH "CONFORMING TO"
-POSIX.1-2001, SVr4, SUSv1.
.SH EXAMPLE
The following program traverses the directory tree under the path named
in its first command-line argument, or under the current directory
diff --git a/man3/gamma.3 b/man3/gamma.3
index 8eec48f500..6bcca3bbc6 100644
--- a/man3/gamma.3
+++ b/man3/gamma.3
@@ -31,6 +31,9 @@ function that is equivalent to
and computes the natural logarithm of the Gamma function.
(This is for compatibility reasons only.
Don't use this function.)
+.SH "CONFORMING TO"
+4.2BSD.
+Compatible with previous mistakes.
.SH NOTES
.SS History
4.2BSD had a
@@ -60,9 +63,6 @@ the "true gamma" function.
.\" The FreeBSD man page says about gamma() that it is like lgamma()
.\" except that is does not set signgam.
.\" Also, that 4.4BSD has a gamma() that computes the true gamma function.
-.SH "CONFORMING TO"
-4.2BSD.
-Compatible with previous mistakes.
.SH "SEE ALSO"
.BR lgamma (3),
.BR signgam (3),
diff --git a/man3/gcvt.3 b/man3/gcvt.3
index dfe31c8e8f..02e0795bcb 100644
--- a/man3/gcvt.3
+++ b/man3/gcvt.3
@@ -42,11 +42,6 @@ terminated ASCII string and stores the result in \fIbuf\fP.
It produces \fIndigit\fP significant digits in either
.BR printf (3)
F format or E format.
-.SH NOTES
-This function is obsolete.
-Instead,
-.BR sprintf (3)
-is recommended.
.SH "RETURN VALUE"
The
.BR gcvt ()
@@ -54,6 +49,11 @@ function returns the address of the string pointed to
by \fIbuf\fP.
.SH "CONFORMING TO"
marked as LEGACY in POSIX.1-2001.
+.SH NOTES
+This function is obsolete.
+Instead,
+.BR sprintf (3)
+is recommended.
.SH "SEE ALSO"
.BR ecvt (3),
.BR fcvt (3),
diff --git a/man3/getcwd.3 b/man3/getcwd.3
index 96fb69b8de..b62f05d222 100644
--- a/man3/getcwd.3
+++ b/man3/getcwd.3
@@ -152,6 +152,13 @@ The
.IR size
argument is less than the length of the working directory name.
You need to allocate a bigger array and try again.
+.SH "CONFORMING TO"
+.BR getcwd ()
+conforms to POSIX.1-2001.
+.BR getwd()
+is present in POSIX.1-2001, but marked LEGACY.
+.BR get_current_dir_name ()
+is a GNU extension.
.SH NOTES
Under Linux, the function
.BR getcwd ()
@@ -171,13 +178,6 @@ directory (".") and calling
.BR fchdir (2)
to return is usually a faster and more reliable alternative when sufficiently
many file descriptors are available, especially on platforms other than Linux.
-.SH "CONFORMING TO"
-.BR getcwd ()
-conforms to POSIX.1-2001.
-.BR getwd()
-is present in POSIX.1-2001, but marked LEGACY.
-.BR get_current_dir_name ()
-is a GNU extension.
.SH "SEE ALSO"
.BR chdir (2),
.BR fchdir (2),
diff --git a/man3/getdate.3 b/man3/getdate.3
index b113ff3efb..54245d0b98 100644
--- a/man3/getdate.3
+++ b/man3/getdate.3
@@ -126,6 +126,16 @@ There is no line in the file that matches the input.
.TP
.B 8
Invalid input specification.
+.SH ENVIRONMENT
+.TP
+.B DATEMSK
+File containing format patterns.
+.TP
+.BR TZ ", " LC_TIME
+Variables used by
+.BR strptime (3).
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
Since
.BR getdate ()
@@ -157,16 +167,6 @@ so that automatically precisely the same conversions are supported by both.
The glibc implementation does not support the
.B %Z
conversion specification.
-.SH ENVIRONMENT
-.TP
-.B DATEMSK
-File containing format patterns.
-.TP
-.BR TZ ", " LC_TIME
-Variables used by
-.BR strptime (3).
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR localtime (3),
.BR setlocale (3),
diff --git a/man3/getgrent_r.3 b/man3/getgrent_r.3
index a7dcad7dd8..e93e1a8ed6 100644
--- a/man3/getgrent_r.3
+++ b/man3/getgrent_r.3
@@ -100,6 +100,33 @@ No more entries.
.B ERANGE
Insufficient buffer space supplied.
Try again with larger buffer.
+.SH "CONFORMING TO"
+These functions are GNU extensions, done in a style resembling
+the POSIX version of functions like
+.BR getpwnam_r (3).
+Other systems use prototype
+.sp
+.nf
+.in +4
+struct group *
+getgrent_r(struct group *grp, char *buf, int buflen);
+.in
+.fi
+.sp
+or, better,
+.sp
+.nf
+.in +4
+int
+getgrent_r(struct group *grp, char *buf, int buflen,
+ FILE **gr_fp);
+.in
+.fi
+.SH NOTES
+The function
+.BR getgrent_r ()
+is not really reentrant since it shares the reading position
+in the stream with all other threads.
.SH EXAMPLE
.nf
#define _GNU_SOURCE
@@ -140,33 +167,6 @@ main(void)
.\" printf("getgrent_r: %s", strerror(i));
.\" exit(EXIT_FAILURE);
.\" }
-.SH "CONFORMING TO"
-These functions are GNU extensions, done in a style resembling
-the POSIX version of functions like
-.BR getpwnam_r (3).
-Other systems use prototype
-.sp
-.nf
-.in +4
-struct group *
-getgrent_r(struct group *grp, char *buf, int buflen);
-.in
-.fi
-.sp
-or, better,
-.sp
-.nf
-.in +4
-int
-getgrent_r(struct group *grp, char *buf, int buflen,
- FILE **gr_fp);
-.in
-.fi
-.SH NOTES
-The function
-.BR getgrent_r ()
-is not really reentrant since it shares the reading position
-in the stream with all other threads.
.SH "SEE ALSO"
.BR fgetgrent (3),
.BR getgrent (3),
diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3
index 0778f60161..3837524f1f 100644
--- a/man3/getgrouplist.3
+++ b/man3/getgrouplist.3
@@ -37,14 +37,14 @@ is smaller than the total number of groups found, then
returns a value of `\-1'.
In all cases the actual number of groups is stored in
.RI * ngroups .
+.SH "VERSIONS"
+This function is present since glibc 2.2.4.
+.SH "CONFORMING TO"
+This function is non-standard; it appears on most BSDs.
.SH BUGS
The glibc 2.3.2 implementation of this function is broken:
it overwrites memory when the actual number of groups is larger than
.RI * ngroups .
-.SH "CONFORMING TO"
-This function is non-standard; it appears on most BSDs.
-.SH "VERSIONS"
-This function is present since glibc 2.2.4.
.SH EXAMPLE
.nf
/* This crashes with glibc 2.3.2 */
diff --git a/man3/getipnodebyname.3 b/man3/getipnodebyname.3
index a094b2f859..b056863a13 100644
--- a/man3/getipnodebyname.3
+++ b/man3/getipnodebyname.3
@@ -251,14 +251,14 @@ is AF_INET6.
This is an array of one or more pointers to network address structures for the
network host.
The array is terminated by a null pointer.
+.SH "CONFORMING TO"
+RFC\ 2553.
+.\" Not in POSIX.1-2001.
.SH NOTES
These functions have been present in glibc 2.1.91-95, but were
removed again.
Several Unix-like systems support them, but all
call them deprecated.
-.SH "CONFORMING TO"
-RFC\ 2553.
-.\" Not in POSIX.1-2001.
.SH "SEE ALSO"
.BR getaddrinfo (3),
.BR getnameinfo (3),
diff --git a/man3/getline.3 b/man3/getline.3
index 0acf8aeedb..acf8be1bd0 100644
--- a/man3/getline.3
+++ b/man3/getline.3
@@ -103,6 +103,13 @@ or
is NULL, or
.I stream
is not valid).
+.SH "CONFORMING TO"
+Both
+.BR getline ()
+and
+.BR getdelim ()
+are GNU extensions.
+They are available since libc 4.6.27.
.SH "EXAMPLE"
.nf
#define _GNU_SOURCE
@@ -128,13 +135,6 @@ main(void)
return EXIT_SUCCESS;
}
.fi
-.SH "CONFORMING TO"
-Both
-.BR getline ()
-and
-.BR getdelim ()
-are GNU extensions.
-They are available since libc 4.6.27.
.SH "SEE ALSO"
.BR read (2),
.BR fgets (3),
diff --git a/man3/getnameinfo.3 b/man3/getnameinfo.3
index 16fe872684..02dfd0b5bc 100644
--- a/man3/getnameinfo.3
+++ b/man3/getnameinfo.3
@@ -174,6 +174,8 @@ suitable for error reporting.
/etc/nsswitch.conf
.br
/etc/resolv.conf
+.SH "CONFORMING TO"
+RFC\ 2553, POSIX.1-2001.
.SH NOTES
In order to assist the programmer in choosing reasonable sizes
for the supplied buffers,
@@ -223,8 +225,6 @@ reverse address mapping.
printf("host=%s\en", hbuf);
.fi
.RE
-.SH "CONFORMING TO"
-RFC\ 2553, POSIX.1-2001.
.SH "SEE ALSO"
.BR getaddrinfo (3),
.BR gethostbyaddr (3),
diff --git a/man3/getopt.3 b/man3/getopt.3
index 657de8da18..03b35ca1f8 100644
--- a/man3/getopt.3
+++ b/man3/getopt.3
@@ -293,6 +293,36 @@ wildcard expansion and so should not be considered as options.
This behaviour was removed in
.B bash
version 2.01, but the support remains in GNU libc.
+.SH "CONFORMING TO"
+.TP
+.BR getopt ():
+POSIX.2 and POSIX.1-2001,
+provided the environment variable POSIXLY_CORRECT is set.
+Otherwise, the elements of \fIargv\fP aren't really const, because we
+permute them.
+We pretend they're const in the prototype to be
+compatible with other systems.
+.sp
+On some older implementations,
+.BR getopt ()
+was declared in
+.IR <stdio.h> .
+SUSv1 permitted the declaration to appear in either
+.I <unistd.h>
+or
+.IR <stdio.h> .
+POSIX.1-2001 marked the use of
+.I <stdio.h>
+for this purpose as LEGACY.
+POSIX.1-2001 does not allow the declaration to appear in
+.IR <stdio.h> .
+.SH BUGS
+The POSIX.2 specification of
+.BR getopt ()
+has a technical error described in POSIX.2 Interpretation 150.
+The GNU
+implementation (and probably all other implementations) implements the
+correct behaviour rather than that specified.
.SH EXAMPLE
The following trivial example program uses
.BR getopt ()
@@ -431,36 +461,6 @@ main(int argc, char **argv)
exit(EXIT_SUCCESS);
}
.fi
-.SH BUGS
-The POSIX.2 specification of
-.BR getopt ()
-has a technical error described in POSIX.2 Interpretation 150.
-The GNU
-implementation (and probably all other implementations) implements the
-correct behaviour rather than that specified.
-.SH "CONFORMING TO"
-.TP
-.BR getopt ():
-POSIX.2 and POSIX.1-2001,
-provided the environment variable POSIXLY_CORRECT is set.
-Otherwise, the elements of \fIargv\fP aren't really const, because we
-permute them.
-We pretend they're const in the prototype to be
-compatible with other systems.
-.sp
-On some older implementations,
-.BR getopt ()
-was declared in
-.IR <stdio.h> .
-SUSv1 permitted the declaration to appear in either
-.I <unistd.h>
-or
-.IR <stdio.h> .
-POSIX.1-2001 marked the use of
-.I <stdio.h>
-for this purpose as LEGACY.
-POSIX.1-2001 does not allow the declaration to appear in
-.IR <stdio.h> .
.SH "SEE ALSO"
.BR getsubopt (3),
.BR feature_test_macros (7)
diff --git a/man3/getpass.3 b/man3/getpass.3
index ab3ba57118..67183941a8 100644
--- a/man3/getpass.3
+++ b/man3/getpass.3
@@ -56,6 +56,15 @@ The function may fail if
.TP
.B ENXIO
The process does not have a controlling terminal.
+.SH FILES
+.I /dev/tty
+.\" .SH HISTORY
+.\" A
+.\" .BR getpass ()
+.\" function appeared in Version 7 AT&T UNIX.
+.SH "CONFORMING TO"
+Present in SUSv2, but marked LEGACY.
+Removed in POSIX.1-2001.
.SH NOTES
For libc4 and libc5, the prompt is not written to
.I /dev/tty
@@ -92,15 +101,6 @@ and _SC_PASS_MAX, and the function
.BR getpass ().
Libc4 and libc5 have never supported PASS_MAX or _SC_PASS_MAX.
Glibc2 accepts _SC_PASS_MAX and returns BUFSIZ (e.g., 8192).
-.SH FILES
-.I /dev/tty
-.\" .SH HISTORY
-.\" A
-.\" .BR getpass ()
-.\" function appeared in Version 7 AT&T UNIX.
-.SH "CONFORMING TO"
-Present in SUSv2, but marked LEGACY.
-Removed in POSIX.1-2001.
.SH BUGS
The calling process should zero the password as soon as possible to avoid
leaving the cleartext password visible in the process's address space.
diff --git a/man3/getpwent_r.3 b/man3/getpwent_r.3
index 6f27c34a66..f16e1d7cd1 100644
--- a/man3/getpwent_r.3
+++ b/man3/getpwent_r.3
@@ -102,6 +102,33 @@ No more entries.
.B ERANGE
Insufficient buffer space supplied.
Try again with larger buffer.
+.SH "CONFORMING TO"
+These functions are GNU extensions, done in a style resembling
+the POSIX version of functions like
+.BR getpwnam_r (3).
+Other systems use prototype
+.sp
+.nf
+.in +4
+struct passwd *
+getpwent_r(struct passwd *pwd, char *buf, int buflen);
+.in
+.fi
+.sp
+or, better,
+.sp
+.nf
+.in +4
+int
+getpwent_r(struct passwd *pwd, char *buf, int buflen,
+ FILE **pw_fp);
+.in
+.fi
+.SH NOTES
+The function
+.BR getpwent_r ()
+is not really reentrant since it shares the reading position
+in the stream with all other threads.
.SH EXAMPLE
.nf
#define _GNU_SOURCE
@@ -137,33 +164,6 @@ main(void)
.\" printf("getpwent_r: %s", strerror(i));
.\" exit(EXIT_SUCCESS);
.\" }
-.SH "CONFORMING TO"
-These functions are GNU extensions, done in a style resembling
-the POSIX version of functions like
-.BR getpwnam_r (3).
-Other systems use prototype
-.sp
-.nf
-.in +4
-struct passwd *
-getpwent_r(struct passwd *pwd, char *buf, int buflen);
-.in
-.fi
-.sp
-or, better,
-.sp
-.nf
-.in +4
-int
-getpwent_r(struct passwd *pwd, char *buf, int buflen,
- FILE **pw_fp);
-.in
-.fi
-.SH NOTES
-The function
-.BR getpwent_r ()
-is not really reentrant since it shares the reading position
-in the stream with all other threads.
.SH "SEE ALSO"
.BR fgetpwent (3),
.BR getpw (3),
diff --git a/man3/getrpcent.3 b/man3/getrpcent.3
index 068407f6a0..78af0567ce 100644
--- a/man3/getrpcent.3
+++ b/man3/getrpcent.3
@@ -88,11 +88,6 @@ and
sequentially search from the beginning
of the file until a matching rpc program name or
program number is found, or until end-of-file is encountered.
-.SH FILES
-.PD 0
-.TP 20
-.I /etc/rpc
-.PD
.SH RETURN VALUE
.LP
A
@@ -100,15 +95,20 @@ A
pointer is returned on
.SM EOF
or error.
+.SH FILES
+.PD 0
+.TP 20
+.I /etc/rpc
+.PD
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on the BSDs, Solaris, and many other systems.
.SH BUGS
.LP
All information
is contained in a static area
so it must be copied if it is
to be saved.
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on the BSDs, Solaris, and many other systems.
.SH "SEE ALSO"
.BR rpc (5),
.BR rpcinfo (8),
diff --git a/man3/getttyent.3 b/man3/getttyent.3
index 3265ab9330..efddeb16c6 100644
--- a/man3/getttyent.3
+++ b/man3/getttyent.3
@@ -58,13 +58,13 @@ can be
#define TTY_ON 0x01 /* enable logins (start ty_getty program) */
#define TTY_SECURE 0x02 /* allow UID 0 to login */
.fi
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on the BSDs, and perhaps other systems.
.SH NOTES
Under Linux the file
.IR /etc/ttys ,
and the functions described above, are not used.
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on the BSDs, and perhaps other systems.
.SH "SEE ALSO"
.BR ttyname (3),
.BR ttyslot (3)
diff --git a/man3/getumask.3 b/man3/getumask.3
index ae9483d053..ee16af1ecd 100644
--- a/man3/getumask.3
+++ b/man3/getumask.3
@@ -51,9 +51,9 @@ except that it is documented to be thread-safe (that is, shares
a lock with the
.BR umask (2)
library call).
-.SH NOTES
-This function is documented but not implemented yet in glibc 2.2.5.
.SH "CONFORMING TO"
This is a vapourware GNU extension.
+.SH NOTES
+This function is documented but not implemented yet in glibc 2.2.5.
.SH "SEE ALSO"
.BR umask (2)
diff --git a/man3/getutent.3 b/man3/getutent.3
index 6f14e969a9..6993299e16 100644
--- a/man3/getutent.3
+++ b/man3/getutent.3
@@ -110,6 +110,52 @@ and
return a pointer to a \fBstruct utmp\fP on success, and NULL on failure.
This \fBstruct utmp\fP is allocated in static storage, and may be
overwritten by subsequent calls.
+.SH FILES
+/var/run/utmp database of currently logged-in users
+.br
+/var/log/wtmp database of past user logins
+.SH "CONFORMING TO"
+XPG2, SVr4.
+.LP
+In XPG2 and SVID 2 the function
+.BR pututline ()
+is documented to return void, and that is what it does on many systems
+(AIX, HP-UX, Linux libc5).
+HP-UX introduces a new function
+.BR _pututline ()
+with the prototype given above for
+.BR pututline ()
+(also found in Linux libc5).
+.LP
+All these functions are obsolete now on non-Linux systems.
+POSIX.1-2001, following SUSv1,
+does not have any of these functions, but instead uses
+.sp
+.B #include <utmpx.h>
+.sp
+.B struct utmpx *getutxent(void);
+.br
+.B struct utmpx *getutxid(const struct utmpx *);
+.br
+.B struct utmpx *getutxline(const struct utmpx *);
+.br
+.B struct utmpx *pututxline(const struct utmpx *);
+.br
+.B void setutxent(void);
+.br
+.B void endutxent(void);
+.sp
+The \fIutmpx\fP structure is a superset of the \fIutmp\fP structure,
+with additional fields, and larger versions of the existing fields.
+The corresponding files are often
+.I /var/*/utmpx
+and
+.IR /var/*/wtmpx .
+.LP
+Linux glibc on the other hand does not use \fIutmpx\fP since its
+\fIutmp\fP structure is already large enough.
+The functions \fIgetutxent\fP
+etc. are aliases for \fIgetutent\fP etc.
.SH NOTES
.SS Glibc Notes
The above functions are not thread-safe.
@@ -186,52 +232,6 @@ main(int argc, char *argv[])
exit(EXIT_SUCCESS);
}
.fi
-.SH FILES
-/var/run/utmp database of currently logged-in users
-.br
-/var/log/wtmp database of past user logins
-.SH "CONFORMING TO"
-XPG2, SVr4.
-.LP
-In XPG2 and SVID 2 the function
-.BR pututline ()
-is documented to return void, and that is what it does on many systems
-(AIX, HP-UX, Linux libc5).
-HP-UX introduces a new function
-.BR _pututline ()
-with the prototype given above for
-.BR pututline ()
-(also found in Linux libc5).
-.LP
-All these functions are obsolete now on non-Linux systems.
-POSIX.1-2001, following SUSv1,
-does not have any of these functions, but instead uses
-.sp
-.B #include <utmpx.h>
-.sp
-.B struct utmpx *getutxent(void);
-.br
-.B struct utmpx *getutxid(const struct utmpx *);
-.br
-.B struct utmpx *getutxline(const struct utmpx *);
-.br
-.B struct utmpx *pututxline(const struct utmpx *);
-.br
-.B void setutxent(void);
-.br
-.B void endutxent(void);
-.sp
-The \fIutmpx\fP structure is a superset of the \fIutmp\fP structure,
-with additional fields, and larger versions of the existing fields.
-The corresponding files are often
-.I /var/*/utmpx
-and
-.IR /var/*/wtmpx .
-.LP
-Linux glibc on the other hand does not use \fIutmpx\fP since its
-\fIutmp\fP structure is already large enough.
-The functions \fIgetutxent\fP
-etc. are aliases for \fIgetutent\fP etc.
.SH "SEE ALSO"
.BR utmp (5),
.BR feature_test_macros (7)
diff --git a/man3/getw.3 b/man3/getw.3
index 6bacf43c28..88f22a4c2a 100644
--- a/man3/getw.3
+++ b/man3/getw.3
@@ -51,12 +51,12 @@ returns the word read, and
.BR putw ()
returns 0.
On error, they return \fBEOF\fP.
+.SH "CONFORMING TO"
+SVr4
.SH BUGS
The value returned on error is also a legitimate data value.
.BR ferror (3)
can be used to distinguish between the two cases.
-.SH "CONFORMING TO"
-SVr4
.SH "SEE ALSO"
.BR ferror (3),
.BR fread (3),
diff --git a/man3/glob.3 b/man3/glob.3
index 1fb0c3129a..d55a33fa46 100644
--- a/man3/glob.3
+++ b/man3/glob.3
@@ -201,6 +201,28 @@ for a read error, and
.TP
.B GLOB_NOMATCH
for no found matches.
+.SH "CONFORMING TO"
+POSIX.2, POSIX.1-2001.
+.SH NOTES
+The structure elements
+.I gl_pathc
+and
+.I gl_offs
+are declared as
+.BR size_t
+in glibc 2.1, as they should according to POSIX.2,
+but are declared as
+.I int
+in libc4, libc5 and glibc 2.0.
+.SH BUGS
+The
+.BR glob ()
+function may fail due to failure of underlying function calls, such as
+.BR malloc (3)
+or
+.BR opendir (3).
+These will store their error code in
+.IR errno .
.SH EXAMPLE
One example of use is the following code, which simulates typing
.sp
@@ -219,28 +241,6 @@ globbuf.gl_pathv[0] = "ls";
globbuf.gl_pathv[1] = "\-l";
execvp("ls", &globbuf.gl_pathv[0]);
.fi
-.SH "CONFORMING TO"
-POSIX.2, POSIX.1-2001.
-.SH BUGS
-The
-.BR glob ()
-function may fail due to failure of underlying function calls, such as
-.BR malloc (3)
-or
-.BR opendir (3).
-These will store their error code in
-.IR errno .
-.SH NOTES
-The structure elements
-.I gl_pathc
-and
-.I gl_offs
-are declared as
-.BR size_t
-in glibc 2.1, as they should according to POSIX.2,
-but are declared as
-.I int
-in libc4, libc5 and glibc 2.0.
.SH "SEE ALSO"
.BR ls (1),
.BR sh (1),
diff --git a/man3/inet.3 b/man3/inet.3
index 772ac574aa..b10814ac4d 100644
--- a/man3/inet.3
+++ b/man3/inet.3
@@ -135,6 +135,13 @@ struct in_addr {
Note that on the i80x86 the host byte order is Least Significant Byte
first (little endian), whereas the network byte order, as used on the
Internet, is Most Significant Byte first (big endian).
+.SH "CONFORMING TO"
+4.3BSD.
+.BR inet_addr (),
+.BR inet_aton (),
+and
+.BR inet_ntoa ()
+are specified in POSIX.1-2001.
.SH NOTES
When you using numbers-and-dots notation for addresses,
be aware that each number will be interpreted as octal
@@ -146,13 +153,6 @@ In order to expose the declaration of
.BR inet_aton (),
one of the feature test macros _BSD_SOURCE, _SVID_SOURCE, or
_GNU_SOURCE must be defined.
-.SH "CONFORMING TO"
-4.3BSD.
-.BR inet_addr (),
-.BR inet_aton (),
-and
-.BR inet_ntoa ()
-are specified in POSIX.1-2001.
.SH "SEE ALSO"
.BR gethostbyname (3),
.BR getnetent (3),
diff --git a/man3/infnan.3 b/man3/infnan.3
index 37f6c5b706..a4418ee81e 100644
--- a/man3/infnan.3
+++ b/man3/infnan.3
@@ -48,13 +48,6 @@ The value of \fIerror\fP can be ERANGE
to represent infinity or anything else to represent NaN.
\fIerrno\fP
is also set.
-.SH NOTES
-This obsolete function was provided in
-.I libc4
-and
-.IR libc5 ,
-but is not available in
-.IR glibc2 .
.SH "RETURN VALUE"
If \fIerror\fP is ERANGE (Infinity), HUGE_VAL is returned.
.PP
@@ -70,3 +63,10 @@ The value of \fIerror\fP is "not-a-number" (NaN).
The value of \fIerror\fP is positive or negative infinity.
.SH "CONFORMING TO"
4.3BSD
+.SH NOTES
+This obsolete function was provided in
+.I libc4
+and
+.IR libc5 ,
+but is not available in
+.IR glibc2 .
diff --git a/man3/isgreater.3 b/man3/isgreater.3
index 650e222d5c..0f26451f7c 100644
--- a/man3/isgreater.3
+++ b/man3/isgreater.3
@@ -53,13 +53,13 @@ true if x or y is NaN.
.TP
isunordered()
is true if x or y is NaN and false otherwise.
+.SH "CONFORMING TO"
+C99
.SH NOTES
Not all hardware supports these functions, and where it doesn't, they
will be emulated by macros.
This will give you a performance penalty.
Don't use these functions if NaN is of no concern for you.
-.SH "CONFORMING TO"
-C99
.SH "SEE ALSO"
.BR fpclassify (3),
.BR isnan (3)
diff --git a/man3/key_setsecret.3 b/man3/key_setsecret.3
index d224025a98..948d211ae9 100644
--- a/man3/key_setsecret.3
+++ b/man3/key_setsecret.3
@@ -53,6 +53,8 @@ The function
.BR key_secretkey_is_set ()
can be used to determine whether a key has been
set for the effective UID of the calling process.
+.SH "RETURN VALUE"
+These functions return 1 on success and 0 on failure.
.SH NOTES
Note that we talk about two types of encryption here.
One is asymmetric using a public and secret key.
@@ -60,7 +62,5 @@ The other is symmetric, the
64-bit DES.
.br
The routines were part of the linux/doors-project, abandoned by now.
-.SH "RETURN VALUE"
-These functions return 1 on success and 0 on failure.
.SH "SEE ALSO"
.BR crypt (3)
diff --git a/man3/login.3 b/man3/login.3
index fb9df8a1f6..b88ef0e723 100644
--- a/man3/login.3
+++ b/man3/login.3
@@ -86,6 +86,18 @@ The
.BR logout ()
function returns 1 if the entry was successfully written to the
database, or 0 if an error occurred.
+.SH FILES
+.TP
+.I /var/run/utmp
+user accounting database, configured through _PATH_UTMP in
+.I <paths.h>
+.TP
+.I /var/log/wtmp
+user accounting log file, configured through _PATH_WTMP in
+.I <paths.h>
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on the BSDs.
.SH NOTES
These functions are included in libutil, hence you'll need to add
.B \-lutil
@@ -105,18 +117,6 @@ is defined as an alias for
.I ut_user
in
.IR <utmp.h> .
-.SH FILES
-.TP
-.I /var/run/utmp
-user accounting database, configured through _PATH_UTMP in
-.I <paths.h>
-.TP
-.I /var/log/wtmp
-user accounting log file, configured through _PATH_WTMP in
-.I <paths.h>
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on the BSDs.
.SH "SEE ALSO"
.BR getutent (3),
.BR utmp (5)
diff --git a/man3/makecontext.3 b/man3/makecontext.3
index 25ccfcc2b7..f012046cfb 100644
--- a/man3/makecontext.3
+++ b/man3/makecontext.3
@@ -92,6 +92,8 @@ sets \fIerrno\fP appropriately.
.TP
.B ENOMEM
Insufficient stack space left.
+.SH "CONFORMING TO"
+SUSv2, POSIX.1-2001.
.SH NOTES
The interpretation of \fIucp->uc_stack\fP is just as in
.BR sigaltstack (2),
@@ -100,8 +102,6 @@ to be used as the stack, regardless of the direction of growth of
the stack.
Thus, it is not necessary for the user program to
worry about this direction.
-.SH "CONFORMING TO"
-SUSv2, POSIX.1-2001.
.SH EXAMPLE
.PP
The example program below demonstrates the use of
diff --git a/man3/malloc_hook.3 b/man3/malloc_hook.3
index 8ce32255f4..11a8c0c61d 100644
--- a/man3/malloc_hook.3
+++ b/man3/malloc_hook.3
@@ -75,6 +75,8 @@ The variable
points at a function that is called each time after
.BR sbrk (2)
was asked for more memory.
+.SH "CONFORMING TO"
+These functions are GNU extensions.
.SH "EXAMPLE"
Here is a short example of how to use these variables.
.sp
@@ -123,8 +125,6 @@ my_malloc_hook(size_t size, const void *caller)
return result;
}
.fi
-.SH "CONFORMING TO"
-These functions are GNU extensions.
.SH "SEE ALSO"
.BR mallinfo (3),
.BR malloc (3),
diff --git a/man3/mempcpy.3 b/man3/mempcpy.3
index 83d6a81759..ca3fd6a474 100644
--- a/man3/mempcpy.3
+++ b/man3/mempcpy.3
@@ -48,6 +48,8 @@ type arguments and copies
wide characters.
.SH "RETURN VALUE"
\fIdest\fP + \fIn\fP .
+.SH "CONFORMING TO"
+This function is a GNU extension.
.SH "EXAMPLE"
.nf
void *
@@ -59,8 +61,6 @@ combine(void *o1, size_t s1, void *o2, size_t s2)
return result;
}
.fi
-.SH "CONFORMING TO"
-This function is a GNU extension.
.SH "SEE ALSO"
.BR memccpy (3),
.BR memcpy (3),
diff --git a/man3/mkdtemp.3 b/man3/mkdtemp.3
index 8df667e1ac..b8aa2ba169 100644
--- a/man3/mkdtemp.3
+++ b/man3/mkdtemp.3
@@ -59,12 +59,12 @@ Now \fItemplate\fP is unchanged.
Also see
.BR mkdir (2)
for other possible values for \fIerrno\fP.
+.SH VERSIONS
+Available since glibc 2.1.91.
.SH "CONFORMING TO"
This function is present on the BSDs.
.\" As at 2006, this function is being considered for a revision of POSIX.1
.\" Also in NetBSD 1.4.
-.SH VERSIONS
-Available since glibc 2.1.91.
.SH "SEE ALSO"
.BR mkdir (2),
.BR mkstemp (3),
diff --git a/man3/mkfifoat.3 b/man3/mkfifoat.3
index 6039319647..7c6a5f5206 100644
--- a/man3/mkfifoat.3
+++ b/man3/mkfifoat.3
@@ -91,20 +91,20 @@ is not a valid file descriptor.
is a relative path and
.I dirfd
is a file descriptor referring to a file other than a directory.
-.SH NOTES
-See
-.BR openat (2)
-for an explanation of the need for
-.BR mkfifoat ().
-.SH "CONFORMING TO"
-This function is non-standard but is proposed
-for inclusion in a future revision of POSIX.1.
.SH VERSIONS
.BR mkfifoat ()
was added to glibc in version 2.4.
It is implemented using
.BR mknod (2),
available on Linux since kernel 2.6.16.
+.SH "CONFORMING TO"
+This function is non-standard but is proposed
+for inclusion in a future revision of POSIX.1.
+.SH NOTES
+See
+.BR openat (2)
+for an explanation of the need for
+.BR mkfifoat ().
.SH "SEE ALSO"
.BR openat (2),
.BR path_resolution (2),
diff --git a/man3/mkstemp.3 b/man3/mkstemp.3
index 87b4a67c8c..92a854f1e2 100644
--- a/man3/mkstemp.3
+++ b/man3/mkstemp.3
@@ -73,6 +73,8 @@ Now the contents of \fItemplate\fP are undefined.
.B EINVAL
The last six characters of \fItemplate\fP were not XXXXXX.
Now \fItemplate\fP is unchanged.
+.SH "CONFORMING TO"
+4.3BSD, POSIX.1-2001
.SH NOTES
The old behaviour (creating a file with mode 0666) may be
a security risk, especially since other Unix flavours use 0600,
@@ -87,8 +89,6 @@ The prototype is in
.I <unistd.h>
for libc4, libc5, glibc1; glibc2 follows POSIX.1 and has the prototype in
.IR <stdlib.h> .
-.SH "CONFORMING TO"
-4.3BSD, POSIX.1-2001
.SH "SEE ALSO"
.BR mkdtemp (3),
.BR mktemp (3),
diff --git a/man3/mq_close.3 b/man3/mq_close.3
index 26d3c4810a..a550c1253d 100644
--- a/man3/mq_close.3
+++ b/man3/mq_close.3
@@ -39,10 +39,6 @@ to this message queue via
.IR mqdes ,
then this request is removed,
and another process can now attach a notification request.
-.SH NOTES
-All open message queues are automatically closed on process termination,
-or upon
-.BR execve (2).
.SH RETURN VALUE
On success
.BR mq_close ()
@@ -57,6 +53,10 @@ The descriptor specified in
is invalid.
.SH CONFORMING TO
POSIX.1-2001.
+.SH NOTES
+All open message queues are automatically closed on process termination,
+or upon
+.BR execve (2).
.SH "SEE ALSO"
.BR mq_getattr (3),
.BR mq_notify (3),
diff --git a/man3/mtrace.3 b/man3/mtrace.3
index 8ed5e9abb3..0316d0629a 100644
--- a/man3/mtrace.3
+++ b/man3/mtrace.3
@@ -32,13 +32,13 @@ This file must be writable to the user or
.BR mtrace ()
will do nothing.
If the file is not empty it will be truncated.
+.SH "CONFORMING TO"
+These are GNU extensions.
.SH NOTES
The output of
.BR mtrace ()
will be ASCII but not in a friendly format.
So glibc comes with a perl-script called mtrace to make sense of it.
-.SH "CONFORMING TO"
-These are GNU extensions.
.SH "SEE ALSO"
.BR malloc (3),
.BR malloc_hook (3)
diff --git a/man3/offsetof.3 b/man3/offsetof.3
index 3275a37214..9f9e861da9 100644
--- a/man3/offsetof.3
+++ b/man3/offsetof.3
@@ -50,6 +50,8 @@ A compiler error will result if
.BR offsetof ()
returns the offset of the given element within the
given type, in units of bytes.
+.SH "CONFORMING TO"
+C89, C99, POSIX.1-2001.
.SH EXAMPLE
On a Linux/x86 system, when compiled using the default
.BR gcc (1)
@@ -88,8 +90,6 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
-.SH "CONFORMING TO"
-C89, C99, POSIX.1-2001.
.\" .SH SEE ALSO
.\" FIXME . When one day readdir_r(3) is documented, it should have
.\" a SEE ALSO that refers to this page.
diff --git a/man3/opendir.3 b/man3/opendir.3
index 8739862b84..85ba0788d4 100644
--- a/man3/opendir.3
+++ b/man3/opendir.3
@@ -69,11 +69,11 @@ Insufficient memory to complete the operation.
.TP
.B ENOTDIR
\fIname\fP is not a directory.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, POSIX.1-2001.
.SH NOTES
The underlying file descriptor of the directory stream can be obtained using
.BR dirfd (3).
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, POSIX.1-2001.
.SH "SEE ALSO"
.BR open (2),
.BR closedir (3),
diff --git a/man3/openpty.3 b/man3/openpty.3
index a40785275c..26013588ce 100644
--- a/man3/openpty.3
+++ b/man3/openpty.3
@@ -145,6 +145,8 @@ will fail if either
or
.BR fork (2)
fails.
+.SH "CONFORMING TO"
+These are BSD functions, present in libc5 and glibc2.
.SH NOTES
These functions are included in libutil, hence you'll need to add
.B \-lutil
@@ -156,8 +158,6 @@ returns file descriptors for a BSD pseudo-terminal pair;
since glibc 2.0.92,
it first attempts to open a Unix 98 pseudo-terminal pair,
and falls back to opening a BSD pseudo-terminal pair if that fails.
-.SH "CONFORMING TO"
-These are BSD functions, present in libc5 and glibc2.
.SH BUGS
Nobody knows how much space should be reserved for
.IR name .
diff --git a/man3/posix_memalign.3 b/man3/posix_memalign.3
index 5ab1377a7e..7b26351372 100644
--- a/man3/posix_memalign.3
+++ b/man3/posix_memalign.3
@@ -91,6 +91,46 @@ parameter was not a power of two, or was not a multiple of
.TP
.B ENOMEM
There was insufficient memory to fulfill the allocation request.
+.SH VERSIONS
+The functions
+.BR memalign ()
+and
+.BR valloc ()
+have been available in all Linux libc libraries.
+The function
+.BR posix_memalign ()
+is available since glibc 2.1.91.
+.SH "CONFORMING TO"
+The function
+.BR valloc ()
+appeared in 3.0BSD.
+It is documented as being obsolete in 4.3BSD,
+and as legacy in SUSv2.
+It does not appear in POSIX.1-2001.
+The function
+.BR memalign ()
+appears in SunOS 4.1.3 but not in 4.4BSD.
+The function
+.BR posix_memalign ()
+comes from POSIX.1d.
+.SS Headers
+Everybody agrees that
+.BR posix_memalign ()
+is declared in <stdlib.h>.
+In order to declare it, glibc needs
+_GNU_SOURCE defined, or _XOPEN_SOURCE defined to a value not less than 600.
+
+On some systems
+.BR memalign ()
+is declared in <stdlib.h> instead of <malloc.h>.
+
+According to SUSv2,
+.BR valloc ()
+is declared in <stdlib.h>.
+Libc4,5 and glibc declare it in <malloc.h> and perhaps also in <stdlib.h>
+(namely, if _GNU_SOURCE is defined, or _BSD_SOURCE is defined, or,
+for glibc, if _XOPEN_SOURCE_EXTENDED is defined, or, equivalently,
+_XOPEN_SOURCE is defined to a value not less than 500).
.SH NOTES
On many systems there are alignment restrictions, e.g. on buffers
used for direct block device I/O.
@@ -141,46 +181,6 @@ GNU libc
.BR malloc (3)
always returns 8-byte aligned memory addresses, so these routines are only
needed if you require larger alignment values.
-.SH VERSIONS
-The functions
-.BR memalign ()
-and
-.BR valloc ()
-have been available in all Linux libc libraries.
-The function
-.BR posix_memalign ()
-is available since glibc 2.1.91.
-.SH "CONFORMING TO"
-The function
-.BR valloc ()
-appeared in 3.0BSD.
-It is documented as being obsolete in 4.3BSD,
-and as legacy in SUSv2.
-It does not appear in POSIX.1-2001.
-The function
-.BR memalign ()
-appears in SunOS 4.1.3 but not in 4.4BSD.
-The function
-.BR posix_memalign ()
-comes from POSIX.1d.
-.SS Headers
-Everybody agrees that
-.BR posix_memalign ()
-is declared in <stdlib.h>.
-In order to declare it, glibc needs
-_GNU_SOURCE defined, or _XOPEN_SOURCE defined to a value not less than 600.
-
-On some systems
-.BR memalign ()
-is declared in <stdlib.h> instead of <malloc.h>.
-
-According to SUSv2,
-.BR valloc ()
-is declared in <stdlib.h>.
-Libc4,5 and glibc declare it in <malloc.h> and perhaps also in <stdlib.h>
-(namely, if _GNU_SOURCE is defined, or _BSD_SOURCE is defined, or,
-for glibc, if _XOPEN_SOURCE_EXTENDED is defined, or, equivalently,
-_XOPEN_SOURCE is defined to a value not less than 500).
.SH "SEE ALSO"
.BR brk (2),
.BR getpagesize (2),
diff --git a/man3/printf.3 b/man3/printf.3
index 31b4c365d0..91762f9dc6 100644
--- a/man3/printf.3
+++ b/man3/printf.3
@@ -756,109 +756,6 @@ A `%' is written.
No argument is converted.
The complete conversion
specification is `%%'.
-.SH EXAMPLE
-.br
-.if \w'\*(Pi'=0 .ds Pi pi
-To print \*(Pi to five decimal places:
-.RS
-.nf
-
-#include <math.h>
-#include <stdio.h>
-fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0));
-.fi
-.RE
-.PP
-To print a date and time in the form `Sunday, July 3, 10:02',
-where
-.I weekday
-and
-.I month
-are pointers to strings:
-.RS
-.nf
-
-#include <stdio.h>
-fprintf(stdout, "%s, %s %d, %.2d:%.2d\en",
- weekday, month, day, hour, min);
-.fi
-.RE
-.PP
-Many countries use the day-month-year order.
-Hence, an internationalized version must be able to print
-the arguments in an order specified by the format:
-.RS
-.nf
-
-#include <stdio.h>
-fprintf(stdout, format,
- weekday, month, day, hour, min);
-
-.fi
-.RE
-where
-.I format
-depends on locale, and may permute the arguments.
-With the value
-.RS
-.nf
-"%1$s, %3$d. %2$s, %4$d:%5$.2d\en"
-.fi
-.RE
-one might obtain `Sonntag, 3. Juli, 10:02'.
-.PP
-To allocate a sufficiently large string and print into it
-(code correct for both glibc 2.0 and glibc 2.1):
-.RS
-.nf
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-char *
-make_message(const char *fmt, ...)
-{
- /* Guess we need no more than 100 bytes. */
- int n, size = 100;
- char *p, *np;
- va_list ap;
-
- if ((p = malloc(size)) == NULL)
- return NULL;
-
- while (1) {
- /* Try to print in the allocated space. */
- va_start(ap, fmt);
- n = vsnprintf(p, size, fmt, ap);
- va_end(ap);
- /* If that worked, return the string. */
- if (n > \-1 && n < size)
- return p;
- /* Else try again with more space. */
- if (n > \-1) /* glibc 2.1 */
- size = n+1; /* precisely what is needed */
- else /* glibc 2.0 */
- size *= 2; /* twice the old size */
- if ((np = realloc (p, size)) == NULL) {
- free(p);
- return NULL;
- } else {
- p = np;
- }
- }
-}
-.fi
-.RE
-.SH NOTES
-The glibc implementation of the functions
-.BR snprintf ()
-and
-.BR vsnprintf ()
-conforms to the C99 standard, i.e., behaves as described above,
-since glibc version 2.1.
-Until glibc 2.0.6 they would return \-1
-when the output was truncated.
.SH "CONFORMING TO"
The
.BR fprintf (),
@@ -912,6 +809,15 @@ glibc 2.1 adds length modifiers hh,j,t,z and conversion characters a,A.
.PP
glibc 2.2 adds the conversion character F with C99 semantics, and the
flag character I.
+.SH NOTES
+The glibc implementation of the functions
+.BR snprintf ()
+and
+.BR vsnprintf ()
+conforms to the C99 standard, i.e., behaves as described above,
+since glibc version 2.1.
+Until glibc 2.0.6 they would return \-1
+when the output was truncated.
.\" .SH HISTORY
.\" Unix V7 defines the three routines
.\" .BR printf (),
@@ -989,6 +895,100 @@ call to write to memory and creating a security hole.
.\" .PP
.\" Some floating point conversions under early libc4
.\" caused memory leaks.
+.SH EXAMPLE
+.br
+.if \w'\*(Pi'=0 .ds Pi pi
+To print \*(Pi to five decimal places:
+.RS
+.nf
+
+#include <math.h>
+#include <stdio.h>
+fprintf(stdout, "pi = %.5f\en", 4 * atan(1.0));
+.fi
+.RE
+.PP
+To print a date and time in the form `Sunday, July 3, 10:02',
+where
+.I weekday
+and
+.I month
+are pointers to strings:
+.RS
+.nf
+
+#include <stdio.h>
+fprintf(stdout, "%s, %s %d, %.2d:%.2d\en",
+ weekday, month, day, hour, min);
+.fi
+.RE
+.PP
+Many countries use the day-month-year order.
+Hence, an internationalized version must be able to print
+the arguments in an order specified by the format:
+.RS
+.nf
+
+#include <stdio.h>
+fprintf(stdout, format,
+ weekday, month, day, hour, min);
+
+.fi
+.RE
+where
+.I format
+depends on locale, and may permute the arguments.
+With the value
+.RS
+.nf
+"%1$s, %3$d. %2$s, %4$d:%5$.2d\en"
+.fi
+.RE
+one might obtain `Sonntag, 3. Juli, 10:02'.
+.PP
+To allocate a sufficiently large string and print into it
+(code correct for both glibc 2.0 and glibc 2.1):
+.RS
+.nf
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+char *
+make_message(const char *fmt, ...)
+{
+ /* Guess we need no more than 100 bytes. */
+ int n, size = 100;
+ char *p, *np;
+ va_list ap;
+
+ if ((p = malloc(size)) == NULL)
+ return NULL;
+
+ while (1) {
+ /* Try to print in the allocated space. */
+ va_start(ap, fmt);
+ n = vsnprintf(p, size, fmt, ap);
+ va_end(ap);
+ /* If that worked, return the string. */
+ if (n > \-1 && n < size)
+ return p;
+ /* Else try again with more space. */
+ if (n > \-1) /* glibc 2.1 */
+ size = n+1; /* precisely what is needed */
+ else /* glibc 2.0 */
+ size *= 2; /* twice the old size */
+ if ((np = realloc (p, size)) == NULL) {
+ free(p);
+ return NULL;
+ } else {
+ p = np;
+ }
+ }
+}
+.fi
+.RE
.SH "SEE ALSO"
.BR printf (1),
.BR asprintf (3),
diff --git a/man3/profil.3 b/man3/profil.3
index e1b0cd591c..64535420cf 100644
--- a/man3/profil.3
+++ b/man3/profil.3
@@ -56,6 +56,8 @@ If
is NULL, profiling is disabled.
.SH "RETURN VALUE"
Zero is always returned.
+.SH "CONFORMING TO"
+Similar to a call in SVr4 (but not POSIX.1-2001).
.SH BUGS
.BR profil ()
cannot be used on a program that also uses
@@ -64,8 +66,6 @@ itimers.
True kernel profiling provides more accurate results.
Libc 4.4 contained a kernel patch providing a system call profil.
-.SH "CONFORMING TO"
-Similar to a call in SVr4 (but not POSIX.1-2001).
.SH "SEE ALSO"
.BR gprof (1),
.BR setitimer (2),
diff --git a/man3/program_invocation_name.3 b/man3/program_invocation_name.3
index ce5fae804a..d49e7dec1a 100644
--- a/man3/program_invocation_name.3
+++ b/man3/program_invocation_name.3
@@ -50,13 +50,13 @@ with all text up to and including the final slash (/), if any, removed.
These variables are automatically initialised by the glibc run-time
startup code.
+.SH "CONFORMING TO"
+These variables are GNU extensions, and should not be
+used in programs intended to be portable.
.SH NOTES
The Linux-specific
.I /proc/[number]/cmdline
file provides access to similar information.
-.SH "CONFORMING TO"
-These variables are GNU extensions, and should not be
-used in programs intended to be portable.
.SH SEE ALSO
.BR proc (5),
.BR feature_test_macros (7)
diff --git a/man3/putenv.3 b/man3/putenv.3
index 3635b3166f..673edd4546 100644
--- a/man3/putenv.3
+++ b/man3/putenv.3
@@ -63,6 +63,8 @@ or non-zero if an error occurs.
.TP
.B ENOMEM
Insufficient space to allocate new environment.
+.SH "CONFORMING TO"
+SVr4, POSIX.1-2001, 4.3BSD
.SH NOTES
The
.BR putenv ()
@@ -101,8 +103,6 @@ This has been fixed in glibc 2.1.2.
The 4.4BSD version, like glibc 2.0, uses a copy.
.LP
SUSv2 removes the `const' from the prototype, and so does glibc 2.1.3.
-.SH "CONFORMING TO"
-SVr4, POSIX.1-2001, 4.3BSD
.SH "SEE ALSO"
.BR clearenv (3),
.BR getenv (3),
diff --git a/man3/qecvt.3 b/man3/qecvt.3
index 609b7a0ce4..7bb9965e8d 100644
--- a/man3/qecvt.3
+++ b/man3/qecvt.3
@@ -55,17 +55,17 @@ See
.BR ecvt (3)
and
.BR gcvt (3).
-.SH NOTES
-These functions are obsolete.
-Instead,
-.BR sprintf (3)
-is recommended.
.SH "CONFORMING TO"
SVr4.
Not seen in most common Unix implementations,
but occurs in SunOS.
Not supported by libc4 and libc5.
Supported by glibc.
+.SH NOTES
+These functions are obsolete.
+Instead,
+.BR sprintf (3)
+is recommended.
.SH "SEE ALSO"
.BR ecvt (3),
.BR ecvt_r (3),
diff --git a/man3/rand.3 b/man3/rand.3
index ef27552fbd..5c1ef04fa5 100644
--- a/man3/rand.3
+++ b/man3/rand.3
@@ -96,26 +96,15 @@ between 0 and RAND_MAX.
The
.BR srand ()
function returns no value.
-.SH EXAMPLE
-POSIX.1-2001 gives the following example of an implementation of
+.SH "CONFORMING TO"
+The functions
.BR rand ()
and
-.BR srand (),
-possibly useful when one needs the same sequence on two different machines.
-.sp
-.nf
- static unsigned long next = 1;
-
- /* RAND_MAX assumed to be 32767 */
- int myrand(void) {
- next = next * 1103515245 + 12345;
- return((unsigned)(next/65536) % 32768);
- }
-
- void mysrand(unsigned seed) {
- next = seed;
- }
-.fi
+.BR srand ()
+conform to SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
+The function
+.BR rand_r ()
+is from POSIX.1-2001.
.SH NOTES
The versions of
.BR rand ()
@@ -169,15 +158,26 @@ in depth, see Chapter 3 (Random Numbers) in Donald E. Knuth's
.IR "The Art of Computer Programming" ,
volume 2 (Seminumerical Algorithms), 2nd ed.; Reading, Massachusetts:
Addison-Wesley Publishing Company, 1981.
-.SH "CONFORMING TO"
-The functions
+.SH EXAMPLE
+POSIX.1-2001 gives the following example of an implementation of
.BR rand ()
and
-.BR srand ()
-conform to SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
-The function
-.BR rand_r ()
-is from POSIX.1-2001.
+.BR srand (),
+possibly useful when one needs the same sequence on two different machines.
+.sp
+.nf
+ static unsigned long next = 1;
+
+ /* RAND_MAX assumed to be 32767 */
+ int myrand(void) {
+ next = next * 1103515245 + 12345;
+ return((unsigned)(next/65536) % 32768);
+ }
+
+ void mysrand(unsigned seed) {
+ next = seed;
+ }
+.fi
.SH "SEE ALSO"
.BR drand48 (3),
.BR random (3)
diff --git a/man3/random.3 b/man3/random.3
index b320508274..2918c67baa 100644
--- a/man3/random.3
+++ b/man3/random.3
@@ -115,14 +115,14 @@ array, or NULL on error.
.B EINVAL
A state array of less than 8 bytes was specified to
.BR initstate ().
+.SH "CONFORMING TO"
+4.3BSD, POSIX.1-2001.
.SH NOTES
Current "optimal" values for the size of the state array \fIn\fP are
8, 32, 64, 128, and 256 bytes; other amounts will be rounded down to
the nearest known amount.
Using less than 8 bytes will cause an
error.
-.SH "CONFORMING TO"
-4.3BSD, POSIX.1-2001.
.SH "SEE ALSO"
.BR rand (3),
.BR srand (3)
diff --git a/man3/realpath.3 b/man3/realpath.3
index 00ccaa3317..3c6ff611e0 100644
--- a/man3/realpath.3
+++ b/man3/realpath.3
@@ -94,6 +94,41 @@ The named file does not exist.
.TP
.B ENOTDIR
A component of the path prefix is not a directory.
+.SH VERSIONS
+On Linux this function appeared in libc 4.5.21.
+.SH "CONFORMING TO"
+4.4BSD, POSIX.1-2001.
+
+In 4.4BSD and Solaris the limit on the pathname length is MAXPATHLEN
+(found in <sys/param.h>).
+SUSv2 prescribes PATH_MAX and
+NAME_MAX, as found in <limits.h> or provided by the
+.BR pathconf (3)
+function.
+A typical source fragment would be
+.LP
+.RS
+.nf
+#ifdef PATH_MAX
+ path_max = PATH_MAX;
+#else
+ path_max = pathconf(path, _PC_PATH_MAX);
+ if (path_max <= 0)
+ path_max = 4096;
+#endif
+.fi
+.RE
+(But see the BUGS section.)
+.LP
+The 4.4BSD, Linux and SUSv2 versions always return an absolute
+pathname.
+Solaris may return a relative pathname when the
+.I path
+argument is relative.
+The prototype of
+.BR realpath ()
+is given in <unistd.h> in libc4 and libc5,
+but in <stdlib.h> everywhere else.
.SH NOTES
The glibc implementation of
.BR realpath ()
@@ -112,6 +147,10 @@ The caller should deallocate this buffer using
.\" Even if we use resolved_path == NULL, then realpath() will still
.\" return ENAMETOOLONG if the resolved pathname would exceed PATH_MAX
.\" bytes -- MTK, Dec 04
+.\" .SH HISTORY
+.\" The
+.\" .BR realpath ()
+.\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry.
.SH BUGS
Avoid using this function.
It is broken by design since (unless
@@ -138,45 +177,6 @@ may return \-1 to signify that PATH_MAX is not bounded.
The libc4 and libc5 implementation contains a buffer overflow
(fixed in libc-5.4.13).
Thus, set-user-ID programs like mount need a private version.
-.\" .SH HISTORY
-.\" The
-.\" .BR realpath ()
-.\" function first appeared in 4.4BSD, contributed by Jan-Simon Pendry.
-.SH VERSIONS
-On Linux this function appeared in libc 4.5.21.
-.SH "CONFORMING TO"
-4.4BSD, POSIX.1-2001.
-
-In 4.4BSD and Solaris the limit on the pathname length is MAXPATHLEN
-(found in <sys/param.h>).
-SUSv2 prescribes PATH_MAX and
-NAME_MAX, as found in <limits.h> or provided by the
-.BR pathconf (3)
-function.
-A typical source fragment would be
-.LP
-.RS
-.nf
-#ifdef PATH_MAX
- path_max = PATH_MAX;
-#else
- path_max = pathconf(path, _PC_PATH_MAX);
- if (path_max <= 0)
- path_max = 4096;
-#endif
-.fi
-.RE
-(But see the BUGS section.)
-.LP
-The 4.4BSD, Linux and SUSv2 versions always return an absolute
-pathname.
-Solaris may return a relative pathname when the
-.I path
-argument is relative.
-The prototype of
-.BR realpath ()
-is given in <unistd.h> in libc4 and libc5,
-but in <stdlib.h> everywhere else.
.SH "SEE ALSO"
.BR readlink (2),
.BR canonicalize_file_name (3),
diff --git a/man3/remove.3 b/man3/remove.3
index c4ad951af9..eabe26bc5d 100644
--- a/man3/remove.3
+++ b/man3/remove.3
@@ -69,15 +69,15 @@ and
.BR rmdir (2).
.SH "CONFORMING TO"
C89, C99, 4.3BSD, POSIX.1-2001.
-.SH BUGS
-Infelicities in the protocol underlying NFS can cause the unexpected
-disappearance of files which are still being used.
.SH NOTES
Under libc4 and libc5,
.BR remove ()
was an alias for
.BR unlink (2)
(and hence would not remove directories).
+.SH BUGS
+Infelicities in the protocol underlying NFS can cause the unexpected
+disappearance of files which are still being used.
.SH "SEE ALSO"
.BR rm (1),
.BR link (2),
diff --git a/man3/rint.3 b/man3/rint.3
index 8897be6f9c..852d8034e8 100644
--- a/man3/rint.3
+++ b/man3/rint.3
@@ -63,6 +63,8 @@ No errors other than EDOM and ERANGE can occur.
If \fIx\fP is NaN, then NaN is returned and
.I errno
may be set to EDOM.
+.SH "CONFORMING TO"
+C99.
.SH NOTES
SUSv2 and POSIX.1-2001 contain text about overflow (which might set
.I errno
@@ -74,8 +76,6 @@ of the exponent is smaller than the number of mantissa bits.
For the IEEE-754 standard 32-bit and 64-bit floating point numbers
the maximum value of the exponent is 128 (resp. 1024), and the number
of mantissa bits is 24 (resp. 53).)
-.SH "CONFORMING TO"
-C99.
.SH "SEE ALSO"
.BR ceil (3),
.BR floor (3),
diff --git a/man3/round.3 b/man3/round.3
index 93809b138c..c1d49c9622 100644
--- a/man3/round.3
+++ b/man3/round.3
@@ -49,6 +49,8 @@ No errors other than EDOM and ERANGE can occur.
If \fIx\fP is NaN, then NaN is returned and
.I errno
may be set to EDOM.
+.SH "CONFORMING TO"
+C99.
.SH NOTES
POSIX.1-2001 contains text about overflow (which might set
.I errno
@@ -60,8 +62,6 @@ of the exponent is smaller than the number of mantissa bits.
For the IEEE-754 standard 32-bit and 64-bit floating point numbers
the maximum value of the exponent is 128 (resp. 1024), and the number
of mantissa bits is 24 (resp. 53).)
-.SH "CONFORMING TO"
-C99.
.SH "SEE ALSO"
.BR ceil (3),
.BR floor (3),
diff --git a/man3/rtime.3 b/man3/rtime.3
index 627e1411bb..fbade730a6 100644
--- a/man3/rtime.3
+++ b/man3/rtime.3
@@ -48,6 +48,27 @@ The number of returned bytes is not 4.
.TP
.B ETIMEDOUT
The waiting time as defined in timeout has expired.
+.SH "NOTES"
+Only IPV4 is supported.
+.LP
+Some
+.I in.timed
+versions only support TCP.
+Try the above example program with
+.I use_tcp
+set to 1.
+.LP
+Libc5 uses the prototype
+.br
+int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
+.br
+and requires
+.I <sys/time.h>
+instead of
+.IR <rpc/auth_des.h> .
+.SH "BUGS"
+.BR rtime ()
+in glibc <= 2.2.5 does not work properly on 64bit machines.
.SH "EXAMPLE"
This example requires that port 37 is up and open.
You may check
@@ -93,27 +114,6 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
-.SH "NOTES"
-Only IPV4 is supported.
-.LP
-Some
-.I in.timed
-versions only support TCP.
-Try the above example program with
-.I use_tcp
-set to 1.
-.LP
-Libc5 uses the prototype
-.br
-int rtime(struct sockaddr_in *, struct timeval *, struct timeval *);
-.br
-and requires
-.I <sys/time.h>
-instead of
-.IR <rpc/auth_des.h> .
-.SH "BUGS"
-.BR rtime ()
-in glibc <= 2.2.5 does not work properly on 64bit machines.
.SH "SEE ALSO"
.BR netdate (1),
.BR ntpdate (1),
diff --git a/man3/rtnetlink.3 b/man3/rtnetlink.3
index 933ab43373..6870cca21b 100644
--- a/man3/rtnetlink.3
+++ b/man3/rtnetlink.3
@@ -75,6 +75,8 @@ bytes of data plus the header.
returns the amount of space which will be needed in the message with
.I len
bytes of data.
+.SH BUGS
+This manual page is lacking and incomplete.
.SH EXAMPLE
.\" FIXME would be better to use libnetlink in the EXAMPLE code here
@@ -107,8 +109,6 @@ Creating a rtnetlink message to set a MTU of a device.
memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));
send(rtnetlink_sk, &req, req.n.nlmsg_len);
.fi
-.SH BUGS
-This manual page is lacking and incomplete.
.SH "SEE ALSO"
.BR netlink (3),
.BR netlink (7),
diff --git a/man3/sem_close.3 b/man3/sem_close.3
index ee8301a010..7b75720483 100644
--- a/man3/sem_close.3
+++ b/man3/sem_close.3
@@ -35,10 +35,6 @@ closes the named semaphore referred to by
.IR sem ,
allowing any resources that the system has allocated to
the calling process for this semaphore to be freed.
-.SH NOTES
-All open named semaphores are automatically closed on process
-termination, or upon
-.BR execve (2).
.SH RETURN VALUE
On success
.BR sem_close ()
@@ -52,6 +48,10 @@ set to indicate the error.
is not a valid semaphore.
.SH CONFORMING TO
POSIX.1-2001.
+.SH NOTES
+All open named semaphores are automatically closed on process
+termination, or upon
+.BR execve (2).
.SH "SEE ALSO"
.BR sem_getvalue (3),
.BR sem_open (3),
diff --git a/man3/sem_getvalue.3 b/man3/sem_getvalue.3
index 6e32b35b34..73dd56aef2 100644
--- a/man3/sem_getvalue.3
+++ b/man3/sem_getvalue.3
@@ -57,12 +57,12 @@ is set to indicate the error.
.B EINVAL
.I sem
is not a valid semaphore.
+.SH CONFORMING TO
+POSIX.1-2001.
.SH NOTES
The value of the semaphore may already have changed by the time
.BR sem_getvalue ()
returns.
-.SH CONFORMING TO
-POSIX.1-2001.
.SH "SEE ALSO"
.BR sem_post (3),
.BR sem_wait (3),
diff --git a/man3/sem_wait.3 b/man3/sem_wait.3
index 91b27d38e3..84aa2cbfbe 100644
--- a/man3/sem_wait.3
+++ b/man3/sem_wait.3
@@ -128,6 +128,8 @@ is less than 0, or greater than or equal to 1000 million.
The call timed out before the semaphore could be locked.
.\" POSIX.1-2001 also allows EDEADLK -- "A deadlock condition
.\" was detected", but this does not occur on Linux(?).
+.SH CONFORMING TO
+POSIX.1-2001.
.SH NOTES
A signal handler always interrupts a blocked call to
one of these functions, regardless of the use of the
@@ -136,8 +138,6 @@ one of these functions, regardless of the use of the
flag.
.\" sem_wait() is always interrupted on most other implementations,
.\" but on FreeBSD 5.4 SA_RESTART does cause restarting.
-.SH CONFORMING TO
-POSIX.1-2001.
.SH EXAMPLE
.PP
The (somewhat trivial) program shown below operates on an
diff --git a/man3/setaliasent.3 b/man3/setaliasent.3
index 35e8bbb974..5916665f61 100644
--- a/man3/setaliasent.3
+++ b/man3/setaliasent.3
@@ -80,18 +80,30 @@ struct aliasent {
int alias_local;
};
.fi
-.SH FILES
-The default alias database is the file
-.IR /etc/aliases .
-This can be changed in the
-.I /etc/nsswitch.conf
-file.
.SH "RETURN VALUE"
The functions
.BR getaliasent_r ()
and
.BR getaliasbyname_r ()
return a non-zero value on error.
+.SH FILES
+The default alias database is the file
+.IR /etc/aliases .
+This can be changed in the
+.I /etc/nsswitch.conf
+file.
+.SH "CONFORMING TO"
+These routines are glibc-specific.
+The NeXT has similar routines
+.RS
+.nf
+#include <aliasdb.h>
+void alias_setent(void);
+void alias_endent(void);
+alias_ent *alias_getent(void);
+alias_ent *alias_getbyname(char *name);
+.fi
+.RE
.SH EXAMPLE
The following example compiles with
.IR "gcc example.c \-o example" .
@@ -122,18 +134,6 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
-.SH "CONFORMING TO"
-These routines are glibc-specific.
-The NeXT has similar routines
-.RS
-.nf
-#include <aliasdb.h>
-void alias_setent(void);
-void alias_endent(void);
-alias_ent *alias_getent(void);
-alias_ent *alias_getbyname(char *name);
-.fi
-.RE
.SH "SEE ALSO"
.BR getgrent (3),
.BR getpwent (3),
diff --git a/man3/setnetgrent.3 b/man3/setnetgrent.3
index e3e8a1dac5..cb5c7af9e0 100644
--- a/man3/setnetgrent.3
+++ b/man3/setnetgrent.3
@@ -66,12 +66,12 @@ The function
can be used for this without calling the above three functions.
Again, a NULL pointer is a wildcard and matches any string.
The function is thread-safe.
+.SH "RETURN VALUE"
+These functions return 1 on success and 0 for failure.
.SH FILES
.I /etc/netgroup
.br
.I /etc/nsswitch.conf
-.SH "RETURN VALUE"
-These functions return 1 on success and 0 for failure.
.SH NOTES
In the BSD implementation,
.BR setnetgrent ()
diff --git a/man3/shm_open.3 b/man3/shm_open.3
index 3580124a12..87ce76381b 100644
--- a/man3/shm_open.3
+++ b/man3/shm_open.3
@@ -225,6 +225,12 @@ An attempt was to made to
a
.I name
that does not exist.
+.SH "CONFORMING TO"
+POSIX.1-2001.
+.LP
+POSIX.1-2001 says that the group ownership of a newly created shared
+memory object is set to either the calling process's effective group ID
+or "a system default group ID"
.SH "NOTES"
These functions are provided in glibc 2.2 and later.
Programs using these
@@ -246,12 +252,6 @@ The POSIX shared memory object implementation on Linux 2.4 makes use
of a dedicated file system, which is normally
mounted under
.IR /dev/shm .
-.SH "CONFORMING TO"
-POSIX.1-2001.
-.LP
-POSIX.1-2001 says that the group ownership of a newly created shared
-memory object is set to either the calling process's effective group ID
-or "a system default group ID"
.SH "SEE ALSO"
.BR close (2),
.BR fchmod (2),
diff --git a/man3/sigset.3 b/man3/sigset.3
index 7a19159831..7adf3a2568 100644
--- a/man3/sigset.3
+++ b/man3/sigset.3
@@ -159,6 +159,9 @@ For
.BR sigignore (),
see the errors under
.BR sigaction (2).
+.SH "CONFORMING TO"
+SVr4, POSIX.1-2001.
+These functions are obsolete: do not use them in new programs.
.SH NOTES
These functions appeared in glibc version 2.1.
@@ -242,9 +245,6 @@ Instead, the previous disposition of the signal is returned.
.\" previous disposition if it had not been blocked.
.\" Otherwise, SIG_ERR shall be returned and errno set to
.\" indicate the error.
-.SH "CONFORMING TO"
-SVr4, POSIX.1-2001.
-These functions are obsolete: do not use them in new programs.
.SH "SEE ALSO"
.BR kill (2),
.BR pause (2),
diff --git a/man3/sigvec.3 b/man3/sigvec.3
index af095b3d1c..30aa0e6afd 100644
--- a/man3/sigvec.3
+++ b/man3/sigvec.3
@@ -205,6 +205,12 @@ See the ERRORS under
.BR sigaction (2)
and
.BR sigprocmask (2).
+.SH "CONFORMING TO"
+All of these functions were in
+4.3BSD, except
+.BR siggetmask (),
+whose origin is unclear.
+These functions are obsolete: do not use them in new programs.
.SH NOTES
On 4.3BSD, the
.BR signal ()
@@ -230,12 +236,6 @@ but this function has a different argument on the two systems.
See
.BR sigpause (3)
for details.
-.SH "CONFORMING TO"
-All of these functions were in
-4.3BSD, except
-.BR siggetmask (),
-whose origin is unclear.
-These functions are obsolete: do not use them in new programs.
.SH "SEE ALSO"
.BR kill (2),
.BR pause (2),
diff --git a/man3/sockatmark.3 b/man3/sockatmark.3
index 374da03843..b1350a0078 100644
--- a/man3/sockatmark.3
+++ b/man3/sockatmark.3
@@ -50,6 +50,11 @@ is not a valid file descriptor.
is not a file descriptor to which
.BR sockatmark ()
can be applied.
+.SH VERSIONS
+.BR sockatmark ()
+was added to glibc in version 2.2.4.
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
If
.BR sockatmark ()
@@ -68,11 +73,6 @@ is implemented using the
.B SIOCATMARK
.BR ioctl (2)
operation.
-.SH "CONFORMING TO"
-POSIX.1-2001
-.SH VERSIONS
-.BR sockatmark ()
-was added to glibc in version 2.2.4.
.SH BUGS
Prior to glibc 2.4,
.BR sockatmark ()
diff --git a/man3/stdarg.3 b/man3/stdarg.3
index 465aeb4302..dbbbc012d6 100644
--- a/man3/stdarg.3
+++ b/man3/stdarg.3
@@ -201,46 +201,6 @@ Some systems that do not supply
have
.B __va_copy
instead, since that was the name used in the draft proposal.
-.SH EXAMPLE
-The function
-.I foo
-takes a string of format characters and prints out the argument associated
-with each format character based on the type.
-.RS
-.nf
-
-#include <stdio.h>
-#include <stdarg.h>
-
-void
-foo(char *fmt, ...)
-{
- va_list ap;
- int d;
- char c, *s;
-
- va_start(ap, fmt);
- while (*fmt)
- switch(*fmt++) {
- case 's': /* string */
- s = va_arg(ap, char *);
- printf("string %s\en", s);
- break;
- case 'd': /* int */
- d = va_arg(ap, int);
- printf("int %d\en", d);
- break;
- case 'c': /* char */
- /* need a cast here since va_arg only
- takes fully promoted types */
- c = (char) va_arg(ap, int);
- printf("char %c\en", c);
- break;
- }
- va_end(ap);
-}
-.fi
-.RE
.SH "CONFORMING TO"
The
.BR va_start (),
@@ -303,3 +263,43 @@ pass all of their arguments on to a function that takes a
.B va_list
argument, such as
.BR vfprintf (3).
+.SH EXAMPLE
+The function
+.I foo
+takes a string of format characters and prints out the argument associated
+with each format character based on the type.
+.RS
+.nf
+
+#include <stdio.h>
+#include <stdarg.h>
+
+void
+foo(char *fmt, ...)
+{
+ va_list ap;
+ int d;
+ char c, *s;
+
+ va_start(ap, fmt);
+ while (*fmt)
+ switch(*fmt++) {
+ case 's': /* string */
+ s = va_arg(ap, char *);
+ printf("string %s\en", s);
+ break;
+ case 'd': /* int */
+ d = va_arg(ap, int);
+ printf("int %d\en", d);
+ break;
+ case 'c': /* char */
+ /* need a cast here since va_arg only
+ takes fully promoted types */
+ c = (char) va_arg(ap, int);
+ printf("char %c\en", c);
+ break;
+ }
+ va_end(ap);
+}
+.fi
+.RE
diff --git a/man3/stpcpy.3 b/man3/stpcpy.3
index 472d3b4faf..1dcd3ca947 100644
--- a/man3/stpcpy.3
+++ b/man3/stpcpy.3
@@ -46,28 +46,30 @@ The strings may not overlap, and the destination string
returns a pointer to the \fBend\fP of the string
\fIdest\fP (that is, the address of the terminating null byte)
rather than the beginning.
+.SH "CONFORMING TO"
+This function is not part of the C or POSIX.1 standards, and is
+not customary on Unix systems, but is not a GNU invention either.
+Perhaps it comes from MS-DOS.
.SH EXAMPLE
For example, this program uses
.BR stpcpy ()
to concatenate \fBfoo\fP and
\fBbar\fP to produce \fBfoobar\fP, which it then prints.
+.in +0.5i
.nf
- #include <string.h>
+#include <string.h>
- int
- main (void)
- {
- char *to = buffer;
- to = stpcpy(to, "foo");
- to = stpcpy(to, "bar");
- printf("%s\\n", buffer);
- }
+int
+main (void)
+{
+ char *to = buffer;
+ to = stpcpy(to, "foo");
+ to = stpcpy(to, "bar");
+ printf("%s\\n", buffer);
+}
.fi
-.SH "CONFORMING TO"
-This function is not part of the C or POSIX.1 standards, and is
-not customary on Unix systems, but is not a GNU invention either.
-Perhaps it comes from MS-DOS.
+.in
.SH "SEE ALSO"
.BR bcopy (3),
.BR memccpy (3),
diff --git a/man3/strcpy.3 b/man3/strcpy.3
index ad494e7114..38afa973d2 100644
--- a/man3/strcpy.3
+++ b/man3/strcpy.3
@@ -70,6 +70,8 @@ and
.BR strncpy ()
functions return a pointer to
the destination string \fIdest\fP.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, C89, C99.
.SH BUGS
If the destination string of a
.BR strcpy ()
@@ -77,8 +79,6 @@ is not large enough
(that is, if the programmer was stupid/lazy, and failed to check
the size before copying) then anything might happen.
Overflowing fixed length strings is a favourite cracker technique.
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, C89, C99.
.SH "SEE ALSO"
.BR bcopy (3),
.BR memccpy (3),
diff --git a/man3/strfmon.3 b/man3/strfmon.3
index 9071cdf81e..9c7a4013d6 100644
--- a/man3/strfmon.3
+++ b/man3/strfmon.3
@@ -118,6 +118,9 @@ provided the string, including the terminating null byte, fits.
Otherwise, it sets
.I errno
to E2BIG, returns \-1, and the contents of the array is undefined.
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on several other systems.
.SH EXAMPLE
The call
.RS
@@ -153,9 +156,6 @@ and Portuguese locales yield
.br
[ **1234$57Esc] [ **1.234$57PTE ]
.RE
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on several other systems.
.SH "SEE ALSO"
.BR setlocale (3),
.BR sprintf (3),
diff --git a/man3/strptime.3 b/man3/strptime.3
index 0bd18adef7..03b145e7e1 100644
--- a/man3/strptime.3
+++ b/man3/strptime.3
@@ -273,28 +273,6 @@ of the format string and therefore an error occurred the function
returns NULL.
.SH "CONFORMING TO"
SUSv2, POSIX.1-2001.
-.SH EXAMPLE
-The following example demonstrates the use of
-.BR strptime ()
-and
-.BR strftime (3).
-.sp
-.nf
-#include <stdio.h>
-#include <time.h>
-
-int
-main(void)
-{
- struct tm tm;
- char buf[255];
-
- strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
- strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
- puts(buf);
- exit(EXIT_SUCCESS);
-}
-.fi
.SH NOTES
.LP
In principle, this function does not initialize \fBtm\fP but
@@ -372,6 +350,28 @@ Leap seconds are not counted unless leap second support is available.
.LP
The GNU libc implementation does not require whitespace between
two field descriptors.
+.SH EXAMPLE
+The following example demonstrates the use of
+.BR strptime ()
+and
+.BR strftime (3).
+.sp
+.nf
+#include <stdio.h>
+#include <time.h>
+
+int
+main(void)
+{
+ struct tm tm;
+ char buf[255];
+
+ strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
+ strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
+ puts(buf);
+ exit(EXIT_SUCCESS);
+}
+.fi
.SH "SEE ALSO"
.BR time (2),
.BR getdate (3),
diff --git a/man3/strsep.3 b/man3/strsep.3
index 0ffae734ad..5706f4e837 100644
--- a/man3/strsep.3
+++ b/man3/strsep.3
@@ -55,6 +55,8 @@ The
.BR strsep ()
function returns a pointer to the token,
that is, it returns the original value of *\fIstringp\fP.
+.SH "CONFORMING TO"
+4.4BSD
.SH NOTES
The
.BR strsep ()
@@ -69,8 +71,6 @@ This function suffers from the same problems as
.BR strtok (3).
In particular, it modifies the original string.
Avoid it.
-.SH "CONFORMING TO"
-4.4BSD
.SH "SEE ALSO"
.BR index (3),
.BR memchr (3),
diff --git a/man3/strstr.3 b/man3/strstr.3
index 061d46a482..abb687aa17 100644
--- a/man3/strstr.3
+++ b/man3/strstr.3
@@ -58,12 +58,6 @@ but ignores the case of both arguments.
.SH "RETURN VALUE"
These functions return a pointer to the beginning of the
substring, or NULL if the substring is not found.
-.SH BUGS
-Early versions of Linux libc (like 4.5.26) would not allow
-an empty \fIneedle\fP argument for
-.BR strstr ().
-Later versions (like 4.6.27) work correctly,
-and return \fIhaystack\fP when \fIneedle\fP is empty.
.SH "CONFORMING TO"
The
.BR strstr ()
@@ -71,6 +65,12 @@ function conforms to C89 and C99.
The
.BR strcasestr ()
function is a non-standard extension.
+.SH BUGS
+Early versions of Linux libc (like 4.5.26) would not allow
+an empty \fIneedle\fP argument for
+.BR strstr ().
+Later versions (like 4.6.27) work correctly,
+and return \fIhaystack\fP when \fIneedle\fP is empty.
.SH "SEE ALSO"
.BR index (3),
.BR memchr (3),
diff --git a/man3/strtok.3 b/man3/strtok.3
index 1ba125d68a..c39b12739f 100644
--- a/man3/strtok.3
+++ b/man3/strtok.3
@@ -90,6 +90,38 @@ In subsequent calls, \fIstr\fP should be NULL, and
Different strings may be parsed concurrently using sequences of calls to
.BR strtok_r ()
that specify different \fIsaveptr\fP arguments.
+.SH "RETURN VALUE"
+The
+.BR strtok ()
+and
+.BR strtok_r ()
+functions return a pointer to
+the next token, or NULL if there are no more tokens.
+.SH "CONFORMING TO"
+.TP
+.BR strtok ()
+SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
+.TP
+.BR strtok_r ()
+POSIX.1-2001
+.SH BUGS
+Avoid using these functions.
+If you do use them, note that:
+.PP
+.RS
+These functions modify their first argument.
+.PP
+These functions cannot be used on constant strings.
+.PP
+The identity of the delimiting character is lost.
+.PP
+The
+.BR strtok ()
+function uses a static buffer while parsing, so it's not thread safe.
+Use
+.BR strtok_r ()
+if this matters to you.
+.RE
.SH EXAMPLE
The following program uses nested loops that employ
.BR strtok_r ()
@@ -149,38 +181,6 @@ $ ./a.out 'a/bbb///cc;xxx:yyy:' ':;' '/'
3: yyy
--> yyy
.fi
-.SH BUGS
-Avoid using these functions.
-If you do use them, note that:
-.PP
-.RS
-These functions modify their first argument.
-.PP
-These functions cannot be used on constant strings.
-.PP
-The identity of the delimiting character is lost.
-.PP
-The
-.BR strtok ()
-function uses a static buffer while parsing, so it's not thread safe.
-Use
-.BR strtok_r ()
-if this matters to you.
-.RE
-.SH "RETURN VALUE"
-The
-.BR strtok ()
-and
-.BR strtok_r ()
-functions return a pointer to
-the next token, or NULL if there are no more tokens.
-.SH "CONFORMING TO"
-.TP
-.BR strtok ()
-SVr4, POSIX.1-2001, 4.3BSD, C89, C99.
-.TP
-.BR strtok_r ()
-POSIX.1-2001
.SH "SEE ALSO"
.BR index (3),
.BR memchr (3),
diff --git a/man3/strtol.3 b/man3/strtol.3
index 961efb07cf..1f0a594e8d 100644
--- a/man3/strtol.3
+++ b/man3/strtol.3
@@ -109,6 +109,11 @@ The resulting value was out of range.
.LP
The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case
no conversion was performed (no digits seen, and 0 returned).
+.SH "CONFORMING TO"
+.BR strtol ()
+conforms to SVr4, 4.3BSD, C89, C99 and POSIX.1-2001, and
+.BR strtoll ()
+to C99 and POSIX.1-2001.
.SH NOTES
Since
.BR strtol ()
@@ -141,11 +146,6 @@ may be equivalent to
.BR strtoll ()
or to
.BR strtol ().
-.SH "CONFORMING TO"
-.BR strtol ()
-conforms to SVr4, 4.3BSD, C89, C99 and POSIX.1-2001, and
-.BR strtoll ()
-to C99 and POSIX.1-2001.
.SH EXAMPLE
The program shown below demonstrates the use of
.BR strtol ().
diff --git a/man3/strtoul.3 b/man3/strtoul.3
index dc3627e522..9d73da7711 100644
--- a/man3/strtoul.3
+++ b/man3/strtoul.3
@@ -110,6 +110,11 @@ The resulting value was out of range.
.LP
The implementation may also set \fIerrno\fP to \fBEINVAL\fP in case
no conversion was performed (no digits seen, and 0 returned).
+.SH "CONFORMING TO"
+.BR strtoul ()
+conforms to SVr4, C89, C99 and POSIX-2001, and
+.BR strtoull ()
+to C99 and POSIX.1-2001.
.SH NOTES
Since
.BR strtoul ()
@@ -144,11 +149,6 @@ or to
Negative values are considered valid input and are
silently converted to the equivalent unsigned long value.
-.SH "CONFORMING TO"
-.BR strtoul ()
-conforms to SVr4, C89, C99 and POSIX-2001, and
-.BR strtoull ()
-to C99 and POSIX.1-2001.
.SH EXAMPLE
See the example on the
.BR strtol (3)
diff --git a/man3/sysv_signal.3 b/man3/sysv_signal.3
index e8252d7ae7..1a4a90913c 100644
--- a/man3/sysv_signal.3
+++ b/man3/sysv_signal.3
@@ -55,6 +55,8 @@ on error.
.SH ERRORS
As for
.BR signal (2).
+.SH "CONFORMING TO"
+This function is non-standard.
.SH NOTES
Use of
.BR sysv_signal ()
@@ -78,8 +80,6 @@ The use of
is a GNU extension;
this type is only defined if
the _GNU_SOURCE feature test macro is defined.
-.SH "CONFORMING TO"
-This function is non-standard.
.SH "SEE ALSO"
.BR sigaction (2),
.BR signal (2),
diff --git a/man3/tcgetpgrp.3 b/man3/tcgetpgrp.3
index 1ebd87dde1..3ab8eb3861 100644
--- a/man3/tcgetpgrp.3
+++ b/man3/tcgetpgrp.3
@@ -98,14 +98,14 @@ of the calling process.
.I pgrp
has a supported value, but is not the process group ID of a
process in the same session as the calling process.
+.SH "CONFORMING TO"
+POSIX.1-2001.
.SH NOTES
These functions are implemented via the TIOCGPGRP and
TIOCSPGRP ioctls.
.SS History
The ioctls appeared in 4.2BSD.
The functions are POSIX inventions.
-.SH "CONFORMING TO"
-POSIX.1-2001.
.SH "SEE ALSO"
.BR setpgid (2),
.BR setsid (2)
diff --git a/man3/tcgetsid.3 b/man3/tcgetsid.3
index 7891d81f13..696fb15a48 100644
--- a/man3/tcgetsid.3
+++ b/man3/tcgetsid.3
@@ -56,12 +56,12 @@ is not a valid file descriptor.
The calling process does not have a controlling terminal, or
it has one but it is not described by
.IR fd .
+.SH "CONFORMING TO"
+POSIX.1-2001
.SH NOTES
This function is implemented via the TIOCGSID
.BR ioctl (2),
present
since Linux 2.1.71.
-.SH "CONFORMING TO"
-POSIX.1-2001
.SH "SEE ALSO"
.BR getsid (2)
diff --git a/man3/tempnam.3 b/man3/tempnam.3
index d4ff556b5d..8372691313 100644
--- a/man3/tempnam.3
+++ b/man3/tempnam.3
@@ -81,6 +81,8 @@ filename, or NULL if a unique name cannot be generated.
.TP
.B ENOMEM
Allocation of storage failed.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, POSIX.1-2001
.SH NOTES
Although
.BR tempnam (3)
@@ -140,8 +142,6 @@ Use
or
.BR tmpfile (3)
instead.
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, POSIX.1-2001
.SH "SEE ALSO"
.BR mkstemp (3),
.BR mktemp (3),
diff --git a/man3/timegm.3 b/man3/timegm.3
index 315c67eea4..9bea9efa9e 100644
--- a/man3/timegm.3
+++ b/man3/timegm.3
@@ -39,6 +39,9 @@ are the inverses to
.BR localtime (3)
and
.BR gmtime (3).
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on the BSDs.
.SH NOTES
These functions are GNU extensions.
The
@@ -81,9 +84,6 @@ my_timegm(struct tm *tm)
}
.fi
.RE
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on the BSDs.
.SH "SEE ALSO"
.BR gmtime (3),
.BR localtime (3),
diff --git a/man3/tmpnam.3 b/man3/tmpnam.3
index 46e0234207..0ac7af75f7 100644
--- a/man3/tmpnam.3
+++ b/man3/tmpnam.3
@@ -70,6 +70,8 @@ function returns a pointer to a unique temporary
filename, or NULL if a unique name cannot be generated.
.SH ERRORS
No errors are defined.
+.SH "CONFORMING TO"
+SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
.SH NOTES
The
.BR tmpnam ()
@@ -128,8 +130,6 @@ Use
or
.BR tmpfile (3)
instead.
-.SH "CONFORMING TO"
-SVr4, 4.3BSD, C89, C99, POSIX.1-2001.
.SH "SEE ALSO"
.BR mkstemp (3),
.BR mktemp (3),
diff --git a/man3/tsearch.3 b/man3/tsearch.3
index 4642d5c8bf..60ae2a2b77 100644
--- a/man3/tsearch.3
+++ b/man3/tsearch.3
@@ -151,6 +151,11 @@ and
.BR tdelete ()
also
return NULL if \fIrootp\fP was NULL on entry.
+.SH "CONFORMING TO"
+SVr4, POSIX.1-2001.
+The function
+.BR tdestroy ()
+is a GNU extension.
.SH NOTES
.BR twalk ()
takes a pointer to the root, while the other functions
@@ -247,11 +252,6 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
-.SH "CONFORMING TO"
-SVr4, POSIX.1-2001.
-The function
-.BR tdestroy ()
-is a GNU extension.
.SH "SEE ALSO"
.BR bsearch (3),
.BR hsearch (3),
diff --git a/man3/ttyslot.3 b/man3/ttyslot.3
index d69b9d1169..9009fefc11 100644
--- a/man3/ttyslot.3
+++ b/man3/ttyslot.3
@@ -104,6 +104,9 @@ On error (e.g., if none of the file descriptors 0, 1 or 2 is
associated with a terminal that occurs in this data base)
it returns 0 on Unix V6 and V7 and BSD-like systems,
but \-1 on System V-like systems.
+.SH "CONFORMING TO"
+SUSv1; marked as LECACY in SUSv2; removed in POSIX.1-2001.
+SUSv2 requires \-1 on error.
.SH NOTES
The utmp file is found various places on various systems, such as
.IR /etc/utmp ,
@@ -124,9 +127,6 @@ Minix also has
.\" .SH HISTORY
.\" .BR ttyslot ()
.\" appeared in Unix V7.
-.SH "CONFORMING TO"
-SUSv1; marked as LECACY in SUSv2; removed in POSIX.1-2001.
-SUSv2 requires \-1 on error.
.SH "SEE ALSO"
.BR getttyent (3),
.BR ttyname (3),
diff --git a/man3/updwtmp.3 b/man3/updwtmp.3
index 9ab4f9f213..ade43e812b 100644
--- a/man3/updwtmp.3
+++ b/man3/updwtmp.3
@@ -43,6 +43,13 @@ current time and current process ID.
Then it calls
.BR updwtmp ()
to append the structure to the utmp file.
+.SH FILES
+.TP
+.I /var/log/wtmp
+database of past user logins
+.SH "CONFORMING TO"
+Not in POSIX.1-2001.
+Present on Solaris, NetBSD, and perhaps other systems.
.SH AVAILABILITY
Both functions are available under glibc2, but not under libc5.
However,
@@ -54,12 +61,5 @@ function is included in libutil.
(Hence you'll need to add
.B \-lutil
to your compiler command line to get it.)
-.SH "CONFORMING TO"
-Not in POSIX.1-2001.
-Present on Solaris, NetBSD, and perhaps other systems.
-.SH FILES
-.TP
-.I /var/log/wtmp
-database of past user logins
.SH "SEE ALSO"
.BR wtmp (5)
diff --git a/man3/wcstok.3 b/man3/wcstok.3
index 23a8d1b7bf..d530c0a637 100644
--- a/man3/wcstok.3
+++ b/man3/wcstok.3
@@ -55,6 +55,8 @@ The
.BR wcstok ()
function returns a pointer to the next token,
or NULL if no further token was found.
+.SH "CONFORMING TO"
+C99.
.SH NOTES
The original \fIwcs\fP wide-character string is destructively modified during
the operation.
@@ -71,8 +73,6 @@ for (token = wcstok(wcs, " \\t\\n", &state);
...
}
.fi
-.SH "CONFORMING TO"
-C99.
.SH "SEE ALSO"
.BR strtok (3),
.BR wcschr (3)