This commit is contained in:
Michael Kerrisk 2006-05-22 19:44:47 +00:00
parent 3e2984b2dd
commit 9b33650560
12 changed files with 41 additions and 41 deletions

View File

@ -92,7 +92,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 EXAMPLES
.SH EXAMPLE
The
.I list
of names is returned as an unordered array of null-terminated character

View File

@ -117,7 +117,7 @@ is set to
If the value of
.I name
is invalid.
.SH EXAMPLES
.SH EXAMPLE
The following code fragment determines the path where to find
the POSIX.2 system utilities:
.br

View File

@ -140,7 +140,7 @@ in virtual memory using the formula:
.nf
addr == info->dlpi_addr + info->dlpi_phdr[x].p_vaddr;
.fi
.SH EXAMPLE PROGRAM
.SH EXAMPLE
The following program displays a list of pathnames of the
shared objects it has loaded.
For each shared object, the program lists the virtual addresses

View File

@ -153,7 +153,7 @@ The former is the constant MAXDNAME in recent versions of BIND's
.I <arpa/nameser.h>
header file. The latter is a guess based on the services listed
in the current Assigned Numbers RFC.
.SH EXAMPLES
.SH EXAMPLE
The following code tries to get the numeric hostname and service name, for
a given socket address. Note that there is no hardcoded reference to
a particular address family.

View File

@ -203,7 +203,7 @@ for a read error, and
.TP
.B GLOB_NOMATCH
for no found matches.
.SH EXAMPLES
.SH EXAMPLE
One example of use is the following code, which simulates typing
.nl
.B ls \-l *.c ../*.c

View File

@ -702,7 +702,7 @@ indicated by the
A `%' is written. No argument is converted. The complete conversion
specification is `%%'.
.PP
.SH EXAMPLES
.SH EXAMPLE
.br
.if \w'\*(Pi'=0 .ds Pi pi
To print \*(Pi to five decimal places:

View File

@ -195,7 +195,7 @@ Some systems that do not supply
have
.B __va_copy
instead, since that was the name used in the draft proposal.
.SH EXAMPLES
.SH EXAMPLE
The function
.I foo
takes a string of format characters and prints out the argument associated

View File

@ -81,7 +81,7 @@ In subsequent calls, \fIstr\fP should be NULL, and
Different strings may be parsed concurrently using sequences of calls to
.BR strtok_r ()
that specify different \fIsaveptr\fP arguments.
.SH EXAMPLES
.SH EXAMPLE
The following program uses nested loops that employ
.BR strtok_r ()
to break a string into a two-level hierarchy of tokens.

View File

@ -47,17 +47,17 @@ administrator can control access using file system permissions.
The devices for the first eight virtual consoles may be created by:
.nf
for x in 0 1 2 3 4 5 6 7 8; do
mknod \-m 644 /dev/vcs$x c 7 $x;
mknod \-m 644 /dev/vcsa$x c 7 $[$x+128];
done
chown root:tty /dev/vcs*
for x in 0 1 2 3 4 5 6 7 8; do
mknod \-m 644 /dev/vcs$x c 7 $x;
mknod \-m 644 /dev/vcsa$x c 7 $[$x+128];
done
chown root:tty /dev/vcs*
.fi
No
.BR ioctl ()
requests are supported.
.SH EXAMPLES
.SH EXAMPLE
You may do a screendump on vt3 by switching to vt1 and typing
\fIcat /dev/vcs3 >foo\fP. Note that the output does not contain
newline characters, so some processing may be required, like
@ -71,32 +71,32 @@ cursor of the second virtual console, then changes the background color
there:
.nf
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
int main() {
int fd;
char *device = "/dev/vcsa2";
struct {unsigned char lines, cols, x, y;} scrn;
char ch, attrib;
int main() {
int fd;
char *device = "/dev/vcsa2";
struct {unsigned char lines, cols, x, y;} scrn;
char ch, attrib;
fd = open(device, O_RDWR);
if (fd < 0) {
perror(device);
exit(1);
}
(void)read(fd, &scrn, 4);
(void)lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0);
(void)read(fd, &ch, 1);
(void)read(fd, &attrib, 1);
printf("ch='%c' attrib=0x%02x\\n", ch, attrib);
attrib ^= 0x10;
(void)lseek(fd, \-1, 1);
(void)write(fd, &attrib, 1);
return 0;
}
fd = open(device, O_RDWR);
if (fd < 0) {
perror(device);
exit(1);
}
(void) read(fd, &scrn, 4);
(void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0);
(void) read(fd, &ch, 1);
(void) read(fd, &attrib, 1);
printf("ch='%c' attrib=0x%02x\\n", ch, attrib);
attrib ^= 0x10;
(void) lseek(fd, \-1, 1);
(void) write(fd, &attrib, 1);
return 0;
}
.fi
.SH FILES

View File

@ -36,7 +36,7 @@ and available to be queried by other programs.
Be aware that there are programs which consult this file to
find out if a user is a normal user. E.g.: ftp daemons traditionally
disallow access to users with shells not included in this file.
.SH EXAMPLES
.SH EXAMPLE
.I /etc/shells
may contain the following paths:
.sp

View File

@ -339,7 +339,7 @@ capability may send or listen to a netlink multicast group.
Any replies to a message received for a multicast group should be
sent back to the sending PID and the multicast group.
.SH EXAMPLES
.SH EXAMPLE
The following example creates a
.B NETLINK_ROUTE
netlink socket which will listen to the

View File

@ -164,7 +164,7 @@ code values 0xd800\(en0xdfff (UTF-16 surrogates) as well as 0xfffe and
0xffff (UCS non-characters) should not appear in conforming
.B UTF-8
streams.
.SH EXAMPLES
.SH EXAMPLE
The
.B Unicode
character 0xa9 = 1010 1001 (the copyright sign) is encoded