Fix inconsistencies in order of .SH sections

This commit is contained in:
Michael Kerrisk 2007-05-19 04:30:20 +00:00
parent 2dd578fd5b
commit 2b2581ee37
179 changed files with 1853 additions and 1837 deletions

View File

@ -111,13 +111,6 @@ is set appropriately.
.TP
.B ENOSYS
The system call is not supported on this kernel.
.SH "CONFORMING TO"
These calls existed only in Linux 2.5.36 through to 2.5.54.
These calls are specific to Linux on Intel processors, and should not be
used in programs intended to be portable.
Indeed, the system call numbers
are marked for reuse, so programs using these may do something random
on a future kernel.
.SH FILES
.I /proc/sys/vm/nr_hugepages
Number of configured hugetlb pages.
@ -126,6 +119,13 @@ This can be read and written.
.I /proc/meminfo
Gives info on the number of configured hugetlb pages and on their size
in the three variables HugePages_Total, HugePages_Free, Hugepagesize.
.SH "CONFORMING TO"
These calls existed only in Linux 2.5.36 through to 2.5.54.
These calls are specific to Linux on Intel processors, and should not be
used in programs intended to be portable.
Indeed, the system call numbers
are marked for reuse, so programs using these may do something random
on a future kernel.
.SH NOTES
The system calls are gone.
Now the hugetlbfs filesystem can be used instead.

View File

@ -74,6 +74,8 @@ An error occurred during synchronization.
.BR EROFS ", " EINVAL
.I fd
is bound to a special file which does not support synchronization.
.SH "CONFORMING TO"
POSIX.1-2001.
.SH AVAILABILITY
On POSIX systems on which
.BR fdatasync ()
@ -85,8 +87,6 @@ i defined in <unistd.h> to a value greater than 0.
.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
.\" -1: unavailable, 0: ask using sysconf().
.\" glibc defines them to 1.
.SH "CONFORMING TO"
POSIX.1-2001.
.SH BUGS
.\" FIXME The following is no longer true
Currently (Linux 2.2)

View File

@ -177,11 +177,6 @@ capability.
failed to allocate the necessary kernel structures because memory is tight.
.SH "CONFORMING TO"
SVr4, 4.3BSD, POSIX.1-2001.
.SH EXAMPLE
See
.BR pipe (2)
and
.BR wait (2).
.SH NOTES
.PP
Under Linux,
@ -189,6 +184,11 @@ Under Linux,
is implemented using copy-on-write pages, so the only penalty that it incurs
is the time and memory required to duplicate the parent's page tables,
and to create a unique task structure for the child.
.SH EXAMPLE
See
.BR pipe (2)
and
.BR wait (2).
.SH "SEE ALSO"
.BR clone (2),
.BR execve (2),

View File

@ -56,6 +56,8 @@ argument is stored in the file
.BR gethostid ()
returns the 32-bit identifier for the current host as set by
.BR sethostid (2).
.SH FILES
.I /etc/hostid
.SH "CONFORMING TO"
4.2BSD; these functions were dropped in 4.4BSD.
SVr4 includes
@ -66,8 +68,6 @@ POSIX.1-2001 specifies
.BR gethostid ()
but not
.BR sethostid ().
.SH FILES
.I /etc/hostid
.SH "SEE ALSO"
.BR hostid (1),
.BR gethostbyname (3)

View File

@ -83,50 +83,8 @@ These macros create a function called \fIname\fP with the arguments you
specify.
Once you include the _syscall() in your source file,
you call the system call by \fIname\fP.
.SH EXAMPLE
.sp
.nf
#include <stdio.h>
#include <errno.h>
#include <linux/unistd.h> /* for _syscallX macros/related stuff */
#include <linux/kernel.h> /* for struct sysinfo */
_syscall1(int, sysinfo, struct sysinfo *, info);
/* Note: if you copy directly from the nroff source, remember to
REMOVE the extra backslashes in the printf statement. */
int
main(void)
{
struct sysinfo s_info;
int error;
error = sysinfo(&s_info);
printf("code error = %d\\n", error);
printf("Uptime = %lds\\nLoad: 1 min %lu / 5 min %lu / 15 min %lu\\n"
"RAM: total %lu / free %lu / shared %lu\\n"
"Memory in buffers = %lu\\nSwap: total %lu / free %lu\\n"
"Number of processes = %d\\n",
s_info.uptime, s_info.loads[0],
s_info.loads[1], s_info.loads[2],
s_info.totalram, s_info.freeram,
s_info.sharedram, s_info.bufferram,
s_info.totalswap, s_info.freeswap,
s_info.procs);
exit(EXIT_SUCCESS);
}
.fi
.SS "Sample Output"
.nf
code error = 0
uptime = 502034s
Load: 1 min 13376 / 5 min 5504 / 15 min 1152
RAM: total 15343616 / free 827392 / shared 8237056
Memory in buffers = 5066752
Swap: total 27881472 / free 24698880
Number of processes = 40
.fi
.SH FILES
.I /usr/include/linux/unistd.h
.SH "CONFORMING TO"
Certain codes are used to indicate Unix variants and standards to
which calls in the section conform.
@ -172,8 +130,50 @@ Some architectures, notably ia64, do not provide the _syscall macros.
On these architectures,
.BR syscall (2)
must be used.
.SH FILES
.I /usr/include/linux/unistd.h
.SH EXAMPLE
.sp
.nf
#include <stdio.h>
#include <errno.h>
#include <linux/unistd.h> /* for _syscallX macros/related stuff */
#include <linux/kernel.h> /* for struct sysinfo */
_syscall1(int, sysinfo, struct sysinfo *, info);
/* Note: if you copy directly from the nroff source, remember to
REMOVE the extra backslashes in the printf statement. */
int
main(void)
{
struct sysinfo s_info;
int error;
error = sysinfo(&s_info);
printf("code error = %d\\n", error);
printf("Uptime = %lds\\nLoad: 1 min %lu / 5 min %lu / 15 min %lu\\n"
"RAM: total %lu / free %lu / shared %lu\\n"
"Memory in buffers = %lu\\nSwap: total %lu / free %lu\\n"
"Number of processes = %d\\n",
s_info.uptime, s_info.loads[0],
s_info.loads[1], s_info.loads[2],
s_info.totalram, s_info.freeram,
s_info.sharedram, s_info.bufferram,
s_info.totalswap, s_info.freeswap,
s_info.procs);
exit(EXIT_SUCCESS);
}
.fi
.SS "Sample Output"
.nf
code error = 0
uptime = 502034s
Load: 1 min 13376 / 5 min 5504 / 15 min 1152
RAM: total 15343616 / free 827392 / shared 8237056
Memory in buffers = 5066752
Swap: total 27881472 / free 24698880
Number of processes = 40
.fi
.SH "SEE ALSO"
.BR syscall (2),
.BR errno (3),

View File

@ -91,7 +91,7 @@ An empty buffer of
zero can be passed into these calls to return the current size of the
list of extended attribute names, which can be used to estimate the
size of a buffer which is sufficiently large to hold the list of names.
.SH EXAMPLE
.SS Example
The
.I list
of names is returned as an unordered array of null-terminated character

View File

@ -420,6 +420,10 @@ Attempted write into a region mapped as read-only.
Attempted access to a portion of the buffer that does not correspond
to the file (for example, beyond the end of the file, including the
case where another process has truncated the file).
.SH "CONFORMING TO"
SVr4, 4.4BSD, POSIX.1-2001.
.\" SVr4 documents additional error codes ENXIO and ENODEV.
.\" SUSv2 documents additional error codes EMFILE and EOVERFLOW.
.SH AVAILABILITY
On POSIX systems on which
.BR mmap (),
@ -433,10 +437,6 @@ is defined in <unistd.h> to a value greater than 0. (See also
.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
.\" -1: unavailable, 0: ask using sysconf().
.\" glibc defines it to 1.
.SH "CONFORMING TO"
SVr4, 4.4BSD, POSIX.1-2001.
.\" SVr4 documents additional error codes ENXIO and ENODEV.
.\" SUSv2 documents additional error codes EMFILE and EOVERFLOW.
.SH NOTES
It is architecture dependent whether
.B PROT_READ

View File

@ -99,6 +99,27 @@ Or: addresses in the range
.IR addr + len ]
are invalid for the address space of the process,
or specify one or more pages that are not mapped.
.SH "CONFORMING TO"
SVr4, POSIX.1-2001.
.\" SVr4 defines an additional error
.\" code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
POSIX says that
.BR mprotect ()
can be used only on regions of memory obtained from
.BR mmap (2).
.SH NOTES
On Linux it is always legal to call
.BR mprotect ()
on any address in a process' address space (except for the
kernel vsyscall area).
In particular it can be used
to change existing code mappings to be writable.
Whether
.B PROT_EXEC
has any effect different from
.B PROT_READ
is architecture and kernel version dependent.
.SH EXAMPLE
.nf
#include <stdio.h>
@ -143,26 +164,5 @@ main(void)
exit(EXIT_SUCCESS);
}
.fi
.SH "CONFORMING TO"
SVr4, POSIX.1-2001.
.\" SVr4 defines an additional error
.\" code EAGAIN. The SVr4 error conditions don't map neatly onto Linux's.
POSIX says that
.BR mprotect ()
can be used only on regions of memory obtained from
.BR mmap (2).
.SH NOTES
On Linux it is always legal to call
.BR mprotect ()
on any address in a process' address space (except for the
kernel vsyscall area).
In particular it can be used
to change existing code mappings to be writable.
Whether
.B PROT_EXEC
has any effect different from
.B PROT_READ
is architecture and kernel version dependent.
.SH "SEE ALSO"
.BR mmap (2)

View File

@ -88,6 +88,12 @@ MS_SYNC and MS_ASYNC are set in
.TP
.B ENOMEM
The indicated memory (or part of it) was not mapped.
.SH "CONFORMING TO"
POSIX.1-2001.
This call was introduced in Linux 1.3.21, and then used EFAULT instead of
ENOMEM.
In Linux 2.4.19 this was changed to the POSIX value ENOMEM.
.SH AVAILABILITY
On POSIX systems on which
.BR msync ()
@ -101,12 +107,6 @@ are defined in <unistd.h> to a value greater than 0.
.\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
.\" -1: unavailable, 0: ask using sysconf().
.\" glibc defines them to 1.
.SH "CONFORMING TO"
POSIX.1-2001.
This call was introduced in Linux 1.3.21, and then used EFAULT instead of
ENOMEM.
In Linux 2.4.19 this was changed to the POSIX value ENOMEM.
.SH "SEE ALSO"
.BR mmap (2)
.br

View File

@ -322,6 +322,55 @@ Although perhaps not intended, under Linux a traced child can be
detached in this way regardless of which method was used to initiate
tracing.
(\fIaddr\fP is ignored.)
.SH "RETURN VALUE"
On success, PTRACE_PEEK* requests return the requested data,
while other requests return zero.
On error, all requests return \-1, and
.I errno
is set appropriately.
Since the value returned by a successful PTRACE_PEEK*
request may be \-1, the caller must check
.I errno
after such requests to determine whether or not an error occurred.
.SH ERRORS
.TP
.B EBUSY
(i386 only) There was an error with allocating or freeing a debug
register.
.TP
.B EFAULT
There was an attempt to read from or write to an invalid area in
the parent's or child's memory,
probably because the area wasn't mapped or accessible.
Unfortunately, under Linux, different variations of this fault
will return EIO or EFAULT more or less arbitrarily.
.TP
.B EINVAL
An attempt was made to set an invalid option.
.TP
.B EIO
\fIrequest\fP is invalid, or an attempt was made to read from or
write to an invalid area in the parent's or child's memory,
or there was a word-alignment violation,
or an invalid signal was specified during a restart request.
.TP
.B EPERM
The specified process cannot be traced.
This could be because the
parent has insufficient privileges (the required capability is
.BR CAP_SYS_PTRACE );
non-root processes cannot trace processes that they
cannot send signals to or those running
set-user-ID/set-group-ID programs, for obvious reasons.
Alternatively, the process may already be being traced, or be
.BR init
(PID 1).
.TP
.B ESRCH
The specified process does not exist, or is not currently being traced
by the caller, or is not stopped (for requests that require that).
.SH "CONFORMING TO"
SVr4, 4.3BSD
.SH NOTES
Although arguments to
.BR ptrace ()
@ -376,55 +425,6 @@ The proc-based debugging interface
present in Solaris 2 implements a superset of
.BR ptrace ()
functionality in a more powerful and uniform way.
.SH "RETURN VALUE"
On success, PTRACE_PEEK* requests return the requested data,
while other requests return zero.
On error, all requests return \-1, and
.I errno
is set appropriately.
Since the value returned by a successful PTRACE_PEEK*
request may be \-1, the caller must check
.I errno
after such requests to determine whether or not an error occurred.
.SH ERRORS
.TP
.B EBUSY
(i386 only) There was an error with allocating or freeing a debug
register.
.TP
.B EFAULT
There was an attempt to read from or write to an invalid area in
the parent's or child's memory,
probably because the area wasn't mapped or accessible.
Unfortunately, under Linux, different variations of this fault
will return EIO or EFAULT more or less arbitrarily.
.TP
.B EINVAL
An attempt was made to set an invalid option.
.TP
.B EIO
\fIrequest\fP is invalid, or an attempt was made to read from or
write to an invalid area in the parent's or child's memory,
or there was a word-alignment violation,
or an invalid signal was specified during a restart request.
.TP
.B EPERM
The specified process cannot be traced.
This could be because the
parent has insufficient privileges (the required capability is
.BR CAP_SYS_PTRACE );
non-root processes cannot trace processes that they
cannot send signals to or those running
set-user-ID/set-group-ID programs, for obvious reasons.
Alternatively, the process may already be being traced, or be
.BR init
(PID 1).
.TP
.B ESRCH
The specified process does not exist, or is not currently being traced
by the caller, or is not stopped (for requests that require that).
.SH "CONFORMING TO"
SVr4, 4.3BSD
.SH BUGS
On hosts with 2.6 kernel headers, PTRACE_SETOPTIONS is declared
with a different value than the one for 2.4.

View File

@ -308,42 +308,6 @@ is invalid.
.TP
.B ENOMEM
unable to allocate memory for internal tables.
.SH EXAMPLE
.nf
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
int
main(void)
{
fd_set rfds;
struct timeval tv;
int retval;
/* Watch stdin (fd 0) to see when it has input. */
FD_ZERO(&rfds);
FD_SET(0, &rfds);
/* Wait up to five seconds. */
tv.tv_sec = 5;
tv.tv_usec = 0;
retval = select(1, &rfds, NULL, NULL, &tv);
/* Don't rely on the value of tv now! */
if (retval == \-1)
perror("select()");
else if (retval)
printf("Data is available now.\\n");
/* FD_ISSET(0, &rfds) will be true. */
else
printf("No data within five seconds.\\n");
exit(EXIT_SUCCESS);
}
.fi
.SH VERSIONS
.BR pselect ()
was added to Linux in kernel 2.6.16.
@ -485,6 +449,42 @@ Thus it may be safer to use O_NONBLOCK on sockets that should not block.
.\"
.\" FIXME select() (and pselect()?) also modify the timeout
.\" on an EINTR error return; POSIX.1-2001 doesn't permit this.
.SH EXAMPLE
.nf
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
int
main(void)
{
fd_set rfds;
struct timeval tv;
int retval;
/* Watch stdin (fd 0) to see when it has input. */
FD_ZERO(&rfds);
FD_SET(0, &rfds);
/* Wait up to five seconds. */
tv.tv_sec = 5;
tv.tv_usec = 0;
retval = select(1, &rfds, NULL, NULL, &tv);
/* Don't rely on the value of tv now! */
if (retval == \-1)
perror("select()");
else if (retval)
printf("Data is available now.\\n");
/* FD_ISSET(0, &rfds) will be true. */
else
printf("No data within five seconds.\\n");
exit(EXIT_SUCCESS);
}
.fi
.SH "SEE ALSO"
For a tutorial with discussion and examples, see
.BR select_tut (2).

View File

@ -497,6 +497,55 @@ follows:
.fi
.PP
This is only guaranteed to work on Unix systems, however.
.SH RETURN VALUE
On success,
.BR select ()
returns the total number of file descriptors
still present in the file descriptor sets.
If
.BR select ()
timed out, then
the return value will be zero.
The file descriptors set should be all
empty (but may not be on some systems).
A return value of \-1 indicates an error, with \fIerrno\fP being
set appropriately.
In the case of an error, the returned sets and
the timeout struct contents are undefined and should not be used.
.BR pselect ()
however never modifies \fIntimeout\fP.
.SH NOTES
Generally speaking, all operating systems that support sockets, also
support
.BR select ().
Many types of programs become
extremely complicated without the use of
.BR select ().
.BR select ()
can be used to solve
many problems in a portable and efficient way that naive programmers try
to solve in a more complicated manner using
threads, forking, IPCs, signals, memory sharing, and so on.
.PP
The
.BR poll (2)
system call has the same functionality as
.BR select (),
and is somewhat more efficient when monitoring sparse
file descriptor sets.
It is nowadays widely available,
but historically was less portable than
.BR select ().
.PP
The Linux-specific
.BR epoll (7)
API provides an interface that is more efficient than
.BR select (2)
and
.BR poll (2)
when monitoring large numbers of file descriptors.
.SH EXAMPLE
Here is an example that better demonstrates the true utility of
.BR select ().
@ -788,55 +837,6 @@ time, although it could easily be extended to do this with a linked list
of buffers \(em one for each connection.
At the moment, new
connections cause the current connection to be dropped.
.SH RETURN VALUE
On success,
.BR select ()
returns the total number of file descriptors
still present in the file descriptor sets.
If
.BR select ()
timed out, then
the return value will be zero.
The file descriptors set should be all
empty (but may not be on some systems).
A return value of \-1 indicates an error, with \fIerrno\fP being
set appropriately.
In the case of an error, the returned sets and
the timeout struct contents are undefined and should not be used.
.BR pselect ()
however never modifies \fIntimeout\fP.
.SH NOTES
Generally speaking, all operating systems that support sockets, also
support
.BR select ().
Many types of programs become
extremely complicated without the use of
.BR select ().
.BR select ()
can be used to solve
many problems in a portable and efficient way that naive programmers try
to solve in a more complicated manner using
threads, forking, IPCs, signals, memory sharing, and so on.
.PP
The
.BR poll (2)
system call has the same functionality as
.BR select (),
and is somewhat more efficient when monitoring sparse
file descriptor sets.
It is nowadays widely available,
but historically was less portable than
.BR select ().
.PP
The Linux-specific
.BR epoll (7)
API provides an interface that is more efficient than
.BR select (2)
and
.BR poll (2)
when monitoring large numbers of file descriptors.
.SH SEE ALSO
.BR accept (2),
.BR connect (2),

View File

@ -95,22 +95,6 @@ Applications may wish to fall back to
in the case where
.BR sendfile ()
fails with EINVAL or ENOSYS.
.SH NOTES
If you plan to use
.BR sendfile ()
for sending files to a TCP socket, but need
to send some header data in front of the file contents, you will find
it useful to employ the
.B TCP_CORK
option, described in
.BR tcp (7),
to minimize the number of packets and to tune performance.
In Linux 2.4 and earlier,
.I out_fd
could refer to a regular file, and
.BR sendfile ()
changed the current offset of that file.
.SH "RETURN VALUE"
If the transfer was successful, the number of bytes written to
.I out_fd
@ -156,6 +140,22 @@ Other Unix systems implement
.BR sendfile ()
with different semantics and prototypes.
It should not be used in portable programs.
.SH NOTES
If you plan to use
.BR sendfile ()
for sending files to a TCP socket, but need
to send some header data in front of the file contents, you will find
it useful to employ the
.B TCP_CORK
option, described in
.BR tcp (7),
to minimize the number of packets and to tune performance.
In Linux 2.4 and earlier,
.I out_fd
could refer to a regular file, and
.BR sendfile ()
changed the current offset of that file.
.SH "SEE ALSO"
.BR open (2),
.BR mmap (2),

View File

@ -130,23 +130,6 @@ The specified size of the new alternate signal stack
An attempt was made to change the alternate signal stack while
it was active (i.e., the process was already executing
on the current alternate signal stack).
.SH EXAMPLE
The following code segment demonstrates the use of
.BR sigaltstack ():
.RS
.nf
stack_t ss;
ss.ss_sp = malloc(SIGSTKSZ);
if (ss.ss_sp == NULL)
/* Handle error */;
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) == \-1)
/* Handle error */;
.fi
.RE
.SH "CONFORMING TO"
SUSv2, SVr4, POSIX.1-2001.
.SH NOTES
@ -203,6 +186,23 @@ system call.
It used a slightly
different struct, and had the major disadvantage that the caller
had to know the direction of stack growth.
.SH EXAMPLE
The following code segment demonstrates the use of
.BR sigaltstack ():
.RS
.nf
stack_t ss;
ss.ss_sp = malloc(SIGSTKSZ);
if (ss.ss_sp == NULL)
/* Handle error */;
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
if (sigaltstack(&ss, NULL) == \-1)
/* Handle error */;
.fi
.RE
.SH "SEE ALSO"
.BR execve (2),
.BR setrlimit (2),

View File

@ -43,6 +43,10 @@ interrupted by the signal.
.SH "RETURN VALUE"
.BR sigreturn ()
never returns.
.SH FILES
/usr/src/linux/arch/i386/kernel/signal.c
.br
/usr/src/linux/arch/alpha/kernel/entry.S
.SH "CONFORMING TO"
.BR sigreturn ()
is specific to Linux and should not be used in programs intended to be
@ -57,10 +61,6 @@ be called directly.
Better yet, the specific use of the
.I __unused
argument varies depending on the architecture.
.SH FILES
/usr/src/linux/arch/i386/kernel/signal.c
.br
/usr/src/linux/arch/alpha/kernel/entry.S
.SH "SEE ALSO"
.BR kill (2),
.BR signal (2),

View File

@ -249,29 +249,6 @@ The `sticky' bit (S_ISVTX) on a directory means that a file
in that directory can be renamed or deleted only by the owner
of the file, by the owner of the directory, and by a privileged
process.
.SH NOTES
.SS Linux Notes
Since kernel 2.5.48, the
.I stat
structure supports nanosecond resolution for the three
file timestamp fields.
Glibc exposes the nanosecond component of each field using names either
of the form
.IR st_atim.tv_nsec ,
if the _BSD_SOURCE or _SVID_SOURCE feature test macro is defined,
or of the form
.IR st_atimensec ,
if neither of these macros is defined.
On file systems that do not support sub-second timestamps,
these nanosecond fields are returned with the value 0.
For most files under the
.I /proc
directory,
.BR stat ()
does not return the file size in the
.I st_size
field; instead the field is returned with the value 0.
.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, and
@ -377,6 +354,29 @@ e000 S_IFWHT w% 160000 BSD whiteout (not used for inode)
.TE
A sticky command appeared in Version 32V AT&T UNIX.
.SH NOTES
.SS Linux Notes
Since kernel 2.5.48, the
.I stat
structure supports nanosecond resolution for the three
file timestamp fields.
Glibc exposes the nanosecond component of each field using names either
of the form
.IR st_atim.tv_nsec ,
if the _BSD_SOURCE or _SVID_SOURCE feature test macro is defined,
or of the form
.IR st_atimensec ,
if neither of these macros is defined.
On file systems that do not support sub-second timestamps,
these nanosecond fields are returned with the value 0.
For most files under the
.I /proc
directory,
.BR stat ()
does not return the file size in the
.I st_size
field; instead the field is returned with the value 0.
.SH "SEE ALSO"
.BR access (2),
.BR chmod (2),

View File

@ -78,7 +78,7 @@ after performing any write.
Specifying
.I flags
as 0 is permitted, as a no-op.
.SH NOTES
.SS Some details
None of these operations write out the file's metadata.
Therefore, unless the application is strictly performing overwrites of
already-instantiated disk blocks,

View File

@ -70,39 +70,6 @@ a directory tree under
.IR /proc/sys ,
and if the requested item is found calls some appropriate routine
to read or modify the value.
.SH EXAMPLE
.nf
#include <linux/unistd.h>
#include <linux/types.h>
#include <linux/sysctl.h>
_syscall1(int, _sysctl, struct __sysctl_args *, args);
int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
struct __sysctl_args args = { name, nlen, oldval, oldlenp,
newval, newlen };
return _sysctl(&args);
}
#define SIZE(x) sizeof(x)/sizeof(x[0])
#define OSNAMESZ 100
char osname[OSNAMESZ];
int osnamelth;
int name[] = { CTL_KERN, KERN_OSTYPE };
int
main(void)
{
osnamelth = sizeof(osname);
if (sysctl(name, SIZE(name), osname, &osnamelth, 0, 0))
perror("sysctl");
else
printf("This machine is running %*s\en", osnamelth, osname);
exit(EXIT_SUCCESS);
}
.fi
.SH "RETURN VALUE"
Upon successful completion,
.BR _sysctl ()
@ -154,5 +121,38 @@ Not all available objects are properly documented.
.PP
It is not yet possible to change operating system by writing to
.IR /proc/sys/kernel/ostype .
.SH EXAMPLE
.nf
#include <linux/unistd.h>
#include <linux/types.h>
#include <linux/sysctl.h>
_syscall1(int, _sysctl, struct __sysctl_args *, args);
int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
struct __sysctl_args args = { name, nlen, oldval, oldlenp,
newval, newlen };
return _sysctl(&args);
}
#define SIZE(x) sizeof(x)/sizeof(x[0])
#define OSNAMESZ 100
char osname[OSNAMESZ];
int osnamelth;
int name[] = { CTL_KERN, KERN_OSTYPE };
int
main(void)
{
osnamelth = sizeof(osname);
if (sysctl(name, SIZE(name), osname, &osnamelth, 0, 0))
perror("sysctl");
else
printf("This machine is running %*s\en", osnamelth, osname);
exit(EXIT_SUCCESS);
}
.fi
.SH "SEE ALSO"
.BR proc (5)

View File

@ -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)

View File

@ -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

View File

@ -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),

View File

@ -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)

View File

@ -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

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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)

View File

@ -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),

View File

@ -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)

View File

@ -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 ()

View File

@ -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),

View File

@ -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)

View File

@ -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)

View File

@ -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 ,

View File

@ -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

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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 */

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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.

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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 .

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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),

View File

@ -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)

View File

@ -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.

View File

@ -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),

Some files were not shown because too many files have changed in this diff Show More