This commit is contained in:
Michael Kerrisk 2007-07-09 20:43:38 +00:00
parent 7f45503bd8
commit cab87712a1
13 changed files with 80 additions and 38 deletions

View File

@ -27,17 +27,23 @@ function converts \fIc\fP,
interpreted as a multibyte sequence interpreted as a multibyte sequence
of length 1, starting in the initial shift state, to a wide character and of length 1, starting in the initial shift state, to a wide character and
returns it. returns it.
If \fIc\fP is EOF or not a valid multibyte sequence of length 1, If \fIc\fP is
.B EOF
or not a valid multibyte sequence of length 1,
the the
.BR btowc () .BR btowc ()
function returns WEOF. function returns
.BR WEOF .
.SH "RETURN VALUE" .SH "RETURN VALUE"
The The
.BR btowc () .BR btowc ()
function returns the wide character function returns the wide character
converted from the single byte \fIc\fP. converted from the single byte \fIc\fP.
If \fIc\fP is EOF or not a valid multibyte sequence of length 1, If \fIc\fP is
it returns WEOF. .B EOF
or not a valid multibyte sequence of length 1,
it returns
.BR WEOF .
.SH "CONFORMING TO" .SH "CONFORMING TO"
C99, POSIX.1-2001. C99, POSIX.1-2001.
.SH NOTES .SH NOTES

View File

@ -34,9 +34,11 @@ of the
function. function.
It reads a wide character from \fIstream\fP and returns it. It reads a wide character from \fIstream\fP and returns it.
If the end of stream is reached, or if \fIferror(stream)\fP becomes true, If the end of stream is reached, or if \fIferror(stream)\fP becomes true,
it returns WEOF. it returns
.BR WEOF .
If a wide-character conversion error occurs, it sets If a wide-character conversion error occurs, it sets
\fIerrno\fP to \fBEILSEQ\fP and returns WEOF. \fIerrno\fP to \fBEILSEQ\fP and returns
.BR WEOF .
.PP .PP
The The
.BR getwc () .BR getwc ()
@ -52,7 +54,8 @@ For non-locking counterparts, see
The The
.BR fgetwc () .BR fgetwc ()
function returns the next wide-character function returns the next wide-character
from the stream, or WEOF. from the stream, or
.BR WEOF .
.SH ERRORS .SH ERRORS
Apart from the usual ones, there is Apart from the usual ones, there is
.TP .TP

View File

@ -66,7 +66,9 @@ The values
.BR MM_NULLTXT , .BR MM_NULLTXT ,
.BR MM_NULLACT , .BR MM_NULLACT ,
.BR MM_NULLTAG .BR MM_NULLTAG
are synonyms for ((char *) 0), the empty string, and are synonyms for
.IR "((char *) 0)" ,
the empty string, and
.B MM_NULLSEV .B MM_NULLSEV
is a synonym for is a synonym for
.BR NO_SEV . .BR NO_SEV .
@ -266,17 +268,23 @@ main(void)
.PP .PP
The output should be: The output should be:
.nf .nf
util\-linux:mount: ERROR: unknown mount option
TO FIX: See mount(8). util\-linux:mount:017 util\-linux:mount: ERROR: unknown mount option
TO FIX: See mount(8). util\-linux:mount:017
.fi .fi
and after and after
.nf .nf
MSGVERB=text:action; export MSGVERB
MSGVERB=text:action; export MSGVERB
.fi .fi
the output becomes: the output becomes:
.nf .nf
unknown mount option
TO FIX: See mount(8). unknown mount option
TO FIX: See mount(8).
.fi .fi
.SH "SEE ALSO" .SH "SEE ALSO"
.BR addseverity (3), .BR addseverity (3),

View File

@ -113,7 +113,7 @@ file and expect that your program may be ported to non-Unix
environments.) environments.)
.PP .PP
Any created files will have mode Any created files will have mode
.BR S_IRUSR \&| S_IWUSR \&| S_IRGRP \&| S_IWGRP \&| S_IROTH \&| S_IWOTH .BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH
(0666), as modified by the process's umask value (see (0666), as modified by the process's umask value (see
.BR umask (2)). .BR umask (2)).
.PP .PP
@ -136,9 +136,11 @@ Opening a file in append mode (\fBa\fR as the first character of
.IR mode ) .IR mode )
causes all subsequent write operations to this stream to occur causes all subsequent write operations to this stream to occur
at end-of-file, as if preceded by an at end-of-file, as if preceded by an
.RS .nf
fseek(stream,0,SEEK_END);
.RE fseek(stream,0,SEEK_END);
.fi
.PP
call. call.
.PP .PP
The The

View File

@ -32,9 +32,11 @@ equivalent of the
function. function.
It writes the wide character \fIwc\fP to \fIstream\fP. It writes the wide character \fIwc\fP to \fIstream\fP.
If If
\fIferror(stream)\fP becomes true, it returns WEOF. \fIferror(stream)\fP becomes true, it returns
.BR WEOF .
If a wide-character conversion error occurs, If a wide-character conversion error occurs,
it sets \fIerrno\fP to \fBEILSEQ\fP and returns WEOF. it sets \fIerrno\fP to \fBEILSEQ\fP and returns
.BR WEOF .
Otherwise it returns \fIwc\fP. Otherwise it returns \fIwc\fP.
.PP .PP
The The
@ -50,8 +52,9 @@ For non-locking counterparts, see
.SH "RETURN VALUE" .SH "RETURN VALUE"
The The
.BR fputwc () .BR fputwc ()
function returns \fIwc\fP if no error occurred, function returns \fIwc\fP if no error occurred, or
or WEOF to indicate an error. .B WEOF
to indicate an error.
.SH ERRORS .SH ERRORS
Apart from the usual ones, there is Apart from the usual ones, there is
.TP .TP

View File

@ -54,9 +54,11 @@ On many architectures both \fIoff_t\fP and \fIlong\fP are 32-bit types,
but compilation with but compilation with
.RS .RS
.nf .nf
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
.fi .fi
.RE .RE
.PP
will turn \fIoff_t\fP into a 64-bit type. will turn \fIoff_t\fP into a 64-bit type.
.SH RETURN VALUE .SH RETURN VALUE
On successful completion, On successful completion,

View File

@ -39,13 +39,13 @@ Return current date and time in
.IR tp , .IR tp ,
which is declared as follows: which is declared as follows:
.sp .sp
.in +1i .in +0.5i
.nf .nf
struct timeb { struct timeb {
time_t time; time_t time;
unsigned short millitm; unsigned short millitm;
short timezone; short timezone;
short dstflag; short dstflag;
}; };
.fi .fi
.in -1i .in -1i

View File

@ -70,10 +70,12 @@ system call.
.SH "CONFORMING TO" .SH "CONFORMING TO"
POSIX.1-2001. POSIX.1-2001.
.SH NOTES .SH NOTES
Under libc4 and libc5 (and under SunOS 4.x) the prototype was Under libc4 and libc5 (and under SunOS 4.x) the prototype was:
.sp
.RS .RS
.BI "key_t ftok(char *" pathname ", char " proj_id ); .BI "key_t ftok(char *" pathname ", char " proj_id );
.RE .RE
.PP
Today Today
.I proj_id .I proj_id
is an is an

View File

@ -30,9 +30,11 @@ function.
It reads a wide character from \fIstdin\fP and returns It reads a wide character from \fIstdin\fP and returns
it. it.
If the end of stream is reached, or if \fIferror(stdin)\fP becomes If the end of stream is reached, or if \fIferror(stdin)\fP becomes
true, it returns WEOF. true, it returns
.BR WEOF .
If a wide-character conversion error occurs, it sets If a wide-character conversion error occurs, it sets
\fIerrno\fP to \fBEILSEQ\fP and returns WEOF. \fIerrno\fP to \fBEILSEQ\fP and returns
.BR WEOF .
.PP .PP
For a non-locking counterpart, see For a non-locking counterpart, see
.BR unlocked_stdio (3). .BR unlocked_stdio (3).
@ -40,7 +42,8 @@ For a non-locking counterpart, see
The The
.BR getwchar () .BR getwchar ()
function returns the next wide-character from function returns the next wide-character from
standard input, or WEOF. standard input, or
.BR WEOF .
.SH "CONFORMING TO" .SH "CONFORMING TO"
C99 C99
.SH NOTES .SH NOTES

View File

@ -28,7 +28,9 @@ If \fIwc\fP is a wide character having the character property designated by
function returns non-zero. function returns non-zero.
Otherwise it Otherwise it
returns zero. returns zero.
If \fIwc\fP is WEOF, zero is returned. If \fIwc\fP is
.BR WEOF ,
zero is returned.
.PP .PP
\fIdesc\fP must be a character property descriptor \fIdesc\fP must be a character property descriptor
returned by the \fBwctype\fP returned by the \fBwctype\fP

View File

@ -28,9 +28,11 @@ function is the wide-character equivalent of the
.BR putchar (3) .BR putchar (3)
function. function.
It writes the wide character \fIwc\fP to \fIstdout\fP. It writes the wide character \fIwc\fP to \fIstdout\fP.
If \fIferror(stdout)\fP becomes true, it returns WEOF. If \fIferror(stdout)\fP becomes true, it returns
.BR WEOF .
If a wide character If a wide character
conversion error occurs, it sets \fIerrno\fP to \fBEILSEQ\fP and returns WEOF. conversion error occurs, it sets \fIerrno\fP to \fBEILSEQ\fP and returns
.BR WEOF .
Otherwise it returns \fIwc\fP. Otherwise it returns \fIwc\fP.
.PP .PP
For a non-locking counterpart, see For a non-locking counterpart, see
@ -38,8 +40,9 @@ For a non-locking counterpart, see
.SH "RETURN VALUE" .SH "RETURN VALUE"
The The
.BR putwchar () .BR putwchar ()
function returns \fIwc\fP if no error occurred, function returns \fIwc\fP if no error occurred, or
or WEOF to indicate an error. .B WEOF
to indicate an error.
.SH "CONFORMING TO" .SH "CONFORMING TO"
C99. C99.
.SH NOTES .SH NOTES

View File

@ -66,9 +66,15 @@ is non-zero or
.I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) .I fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW)
is non-zero, an error has occurred. is non-zero, an error has occurred.
.LP .LP
A range error occurs if x is too large. A range error occurs if
A pole error occurs if x is zero. .I x
A domain error (or a pole error) occurs if x is a negative integer. is too large.
A pole error occurs if
.I x
is zero.
A domain error (or a pole error) occurs if
.I x
is a negative integer.
.SH "CONFORMING TO" .SH "CONFORMING TO"
C99. C99.
.SH "SEE ALSO" .SH "SEE ALSO"

View File

@ -46,7 +46,9 @@ to lower case, if possible.
.PP .PP
If If
.I c .I c
is not an unsigned char value, or EOF, the behavior of these functions is not an unsigned char value, or
.BR EOF ,
the behavior of these functions
is undefined. is undefined.
.SH "RETURN VALUE" .SH "RETURN VALUE"
The value returned is that of the converted letter, or The value returned is that of the converted letter, or