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
of length 1, starting in the initial shift state, to a wide character and
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
.BR btowc ()
function returns WEOF.
function returns
.BR WEOF .
.SH "RETURN VALUE"
The
.BR btowc ()
function returns the wide character
converted from the single byte \fIc\fP.
If \fIc\fP is EOF or not a valid multibyte sequence of length 1,
it returns WEOF.
If \fIc\fP is
.B EOF
or not a valid multibyte sequence of length 1,
it returns
.BR WEOF .
.SH "CONFORMING TO"
C99, POSIX.1-2001.
.SH NOTES

View File

@ -34,9 +34,11 @@ of the
function.
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,
it returns WEOF.
it returns
.BR WEOF .
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
The
.BR getwc ()
@ -52,7 +54,8 @@ For non-locking counterparts, see
The
.BR fgetwc ()
function returns the next wide-character
from the stream, or WEOF.
from the stream, or
.BR WEOF .
.SH ERRORS
Apart from the usual ones, there is
.TP

View File

@ -66,7 +66,9 @@ The values
.BR MM_NULLTXT ,
.BR MM_NULLACT ,
.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
is a synonym for
.BR NO_SEV .
@ -266,17 +268,23 @@ main(void)
.PP
The output should be:
.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
and after
.nf
MSGVERB=text:action; export MSGVERB
MSGVERB=text:action; export MSGVERB
.fi
the output becomes:
.nf
unknown mount option
TO FIX: See mount(8).
unknown mount option
TO FIX: See mount(8).
.fi
.SH "SEE ALSO"
.BR addseverity (3),

View File

@ -113,7 +113,7 @@ file and expect that your program may be ported to non-Unix
environments.)
.PP
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
.BR umask (2)).
.PP
@ -136,9 +136,11 @@ Opening a file in append mode (\fBa\fR as the first character of
.IR mode )
causes all subsequent write operations to this stream to occur
at end-of-file, as if preceded by an
.RS
fseek(stream,0,SEEK_END);
.RE
.nf
fseek(stream,0,SEEK_END);
.fi
.PP
call.
.PP
The

View File

@ -32,9 +32,11 @@ equivalent of the
function.
It writes the wide character \fIwc\fP to \fIstream\fP.
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,
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.
.PP
The
@ -50,8 +52,9 @@ For non-locking counterparts, see
.SH "RETURN VALUE"
The
.BR fputwc ()
function returns \fIwc\fP if no error occurred,
or WEOF to indicate an error.
function returns \fIwc\fP if no error occurred, or
.B WEOF
to indicate an error.
.SH ERRORS
Apart from the usual ones, there is
.TP

View File

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

View File

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

View File

@ -70,10 +70,12 @@ system call.
.SH "CONFORMING TO"
POSIX.1-2001.
.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
.BI "key_t ftok(char *" pathname ", char " proj_id );
.RE
.PP
Today
.I proj_id
is an

View File

@ -30,9 +30,11 @@ function.
It reads a wide character from \fIstdin\fP and returns
it.
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
\fIerrno\fP to \fBEILSEQ\fP and returns WEOF.
\fIerrno\fP to \fBEILSEQ\fP and returns
.BR WEOF .
.PP
For a non-locking counterpart, see
.BR unlocked_stdio (3).
@ -40,7 +42,8 @@ For a non-locking counterpart, see
The
.BR getwchar ()
function returns the next wide-character from
standard input, or WEOF.
standard input, or
.BR WEOF .
.SH "CONFORMING TO"
C99
.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.
Otherwise it
returns zero.
If \fIwc\fP is WEOF, zero is returned.
If \fIwc\fP is
.BR WEOF ,
zero is returned.
.PP
\fIdesc\fP must be a character property descriptor
returned by the \fBwctype\fP

View File

@ -28,9 +28,11 @@ function is the wide-character equivalent of the
.BR putchar (3)
function.
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
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.
.PP
For a non-locking counterpart, see
@ -38,8 +40,9 @@ For a non-locking counterpart, see
.SH "RETURN VALUE"
The
.BR putwchar ()
function returns \fIwc\fP if no error occurred,
or WEOF to indicate an error.
function returns \fIwc\fP if no error occurred, or
.B WEOF
to indicate an error.
.SH "CONFORMING TO"
C99.
.SH NOTES

View File

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

View File

@ -46,7 +46,9 @@ to lower case, if possible.
.PP
If
.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.
.SH "RETURN VALUE"
The value returned is that of the converted letter, or