Make the standard indent for code samples, shell session

logs, etc. to be ".in +4n".
This commit is contained in:
Michael Kerrisk 2007-12-19 05:53:30 +00:00
parent 8a35999094
commit a08ea57c20
80 changed files with 313 additions and 263 deletions

38
Changes
View File

@ -10,6 +10,8 @@ The following people contributed notes, ideas, or patches that have
been incorporated in changes in this release:
Alain PORTAL <alain.portal@free.fr>
Andrew Morton <akpm@linux-foundation.org>
David Brown <lkml@davidb.org>
Sam Morris <sam@robots.org.uk>
Sam Varshavchik <mrsam@courier-mta.com>
Samuel Thibault <samuel.thibault@ens-lyon.org>
@ -28,6 +30,15 @@ Various pages
mtk / Alain Portal
s/``...''/"..."/
Various pages
mtk
s/epoch/Epoch/
Various pages
mtk
Make the standard indent for code samples, shell session
logs, etc. to be ".in +4n".
Typographical or grammatical errors have been corrected in several places.
@ -38,6 +49,11 @@ chroot.2
mtk
Various minor formatting changes.
epoll_wait.2
mtk
Fix types in structs.
Formatting fixes.
mount.2
mtk, after a note by Sam Morris
Clarify that MS_NODIRATIME provides a subset of the
@ -47,6 +63,24 @@ sched_setaffinity.2
mtk
Minor rearrangement of text.
select_tut.2
mtk
Fix (my) typos in argument names.
Formatting fixes.
times.2
mtk, after a note from David Brown and Andrew Morton
http://marc.info/?l=linux-kernel&m=119447727031225&w=2
Rework the text describing the return value to be closer
to the requirements of POSIX.1; move Linux details
to NOTES and add a warning not to rely on those details.
Add a warning about the -1 to -4095 bug which results
in a 41 second window where the glibc wrapper will wrongly
return -1 indicating an error.
mtk
Remove cruft HZ text.
Clarify text describing return value of clock(3).
hash.3
mtk / Alain Portal
Minor rewordings + formatting fixes.
@ -68,3 +102,7 @@ vcs.4
bootparam.7
Alain PORTAL
Formatting fixes.
inotify.7
mtk
Minor heading changes and reformattings.

View File

@ -133,7 +133,7 @@ argument will depend on the address family.
The
.I sockaddr
structure is defined as something like:
.in +0.25in
.in +4n
.nf
struct sockaddr {
@ -142,7 +142,7 @@ struct sockaddr {
}
.fi
.in -0.25in
.in
The only purpose of this structure is to cast the structure
pointer passed in
.I my_addr
@ -261,7 +261,6 @@ domain, and accept connections:
.\" accept.7 refers to this example.
.\" unix.7 refers to this example.
.in +0.25in
.nf
#include <sys/socket.h>
#include <sys/un.h>
@ -314,7 +313,6 @@ main(int argc, char *argv[])
should be deleted using unlink(2) or remove(3) */
}
.fi
.in -0.25in
.SH "SEE ALSO"
.BR accept (2),
.BR connect (2),

View File

@ -43,7 +43,7 @@ The
.I struct epoll_event
is defined as :
.sp
.in +0.5i
.in +4n
.nf
typedef union epoll_data {
void *ptr;
@ -57,7 +57,7 @@ struct epoll_event {
epoll_data_t data; /* User data variable */
};
.fi
.in -0.5i
.in
The
.I events

View File

@ -67,21 +67,21 @@ The
.I struct epoll_event
is defined as :
.sp
.in +0.5i
.in +4n
.nf
typedef union epoll_data {
void *ptr;
int fd;
__uint32_t u32;
__uint64_t u64;
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event {
__uint32_t events; /* Epoll events */
uint32_t events; /* Epoll events */
epoll_data_t data; /* User data variable */
};
.fi
.in -0.5i
.in
The
.I data

View File

@ -84,7 +84,7 @@ argument to both
and
.BR setrlimit ()):
.PP
.in +0.5i
.in +4n
.nf
struct rlimit {
rlim_t rlim_cur; /* Soft limit */
@ -92,7 +92,7 @@ struct rlimit {
};
.fi
.in -0.5i
.in
The soft limit is the value that the kernel enforces for the
corresponding resource.
The hard limit acts as a ceiling for the soft limit:

View File

@ -52,7 +52,7 @@ The former asks for resources used by the current process,
the latter for resources used by those of its children
that have terminated and have been waited for.
.PP
.in +0.5i
.in +4n
.nf
struct rusage {
struct timeval ru_utime; /* user time used */
@ -73,7 +73,7 @@ struct rusage {
long ru_nivcsw; /* involuntary context switches */
};
.fi
.in -0.5i
.in
.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, and

View File

@ -68,14 +68,14 @@ argument is a
(as specified in
.IR <sys/time.h> ):
.sp
.in +0.25i
.in +4n
.nf
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
.fi
.in -0.25i
.in
.sp
and gives the number of seconds and microseconds since the Epoch (see
.BR time (2)).
@ -84,14 +84,14 @@ The
argument is a
.IR "struct timezone" :
.sp
.in +0.25i
.in +4n
.nf
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of DST correction */
};
.fi
.in -0.25i
.in
.PP
If either
.I tv
@ -126,7 +126,7 @@ is in force.
it does not indicate that DST is in force, it just selects an
algorithm.)
The daylight saving time algorithms defined are as follows :
.RS
.in +4n
.nf
\fBDST_NONE\fP /* not on dst */
@ -151,7 +151,7 @@ The daylight saving time algorithms defined are as follows :
.br
\fBDST_AUSTALT\fP /* Australian style with shift in 1986 */
.fi
.RE
.in
.PP
Of course it turned out that the period in which
Daylight Saving Time is in force cannot be given

View File

@ -64,7 +64,7 @@ The
.I msgp
argument is a pointer to caller-defined structure
of the following general form:
.in +0.5i
.in +4n
.nf
struct msgbuf {
@ -72,7 +72,7 @@ struct msgbuf {
char mtext[1]; /* message data */
};
.fi
.in -0.5i
.in
.PP
The
.I mtext

View File

@ -59,15 +59,17 @@ The set of file descriptors to be monitored is specified in the
argument, which is an array of
.I nfds
structures of the following form:
.in +0.5i
.nf
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */
short revents; /* returned events */
};
struct pollfd {
int fd; /* file descriptor */
short events; /* requested events */
short revents; /* returned events */
};
.fi
.in
The field
.I fd
contains a file descriptor for an open file.
@ -219,7 +221,7 @@ argument specifies an upper limit on the amount of time that
.BR ppoll ()
will block.
This argument is a pointer to a structure of the following form:
.in +0.25i
.in +0.5i
.nf
struct timespec {
@ -227,7 +229,7 @@ struct timespec {
long tv_nsec; /* nanoseconds */
};
.fi
.in -0.25i
.in
If
.I timeout

View File

@ -63,16 +63,16 @@ The
.I dirent
structure is declared as follows:
.PP
.RS
.in +0.25i
.nf
struct dirent {
long d_ino; /* inode number */
off_t d_off; /* offset to this \fIdirent\fP */
unsigned short d_reclen; /* length of this \fId_name\fP */
char d_name [NAME_MAX+1]; /* filename (null-terminated) */
long d_ino; /* inode number */
off_t d_off; /* offset to this \fIdirent\fP */
unsigned short d_reclen; /* length of this \fId_name\fP */
char d_name[NAME_MAX+1]; /* filename (null-terminated) */
}
.fi
.RE
.in
.PP
.I d_ino
is an inode number.

View File

@ -178,7 +178,7 @@ on the next socket operation.
The error is supplied in a
.I sock_extended_err
structure:
.in +0.25i
.in +4n
.nf
#define SO_EE_ORIGIN_NONE 0
@ -200,7 +200,7 @@ struct sock_extended_err
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
.fi
.in -0.25i
.in
.IP
.I ee_errno
contains the
@ -271,7 +271,7 @@ call uses a
structure to minimize the number of directly supplied parameters.
This structure has the following form, as defined in
.IR <sys/socket.h> :
.in +0.25i
.in +4n
.nf
struct msghdr {
@ -284,7 +284,7 @@ struct msghdr {
int msg_flags; /* flags on received message */
};
.fi
.in -0.25i
.in
.PP
Here
.I msg_name
@ -315,7 +315,7 @@ upon return from a successful call it will contain the length
of the control message sequence.
.PP
The messages are of the form:
.in +0.25i
.in +4n
.nf
struct cmsghdr {
@ -326,7 +326,7 @@ struct cmsghdr {
u_char cmsg_data[]; */
};
.fi
.in -0.25i
.in
.PP
Ancillary data should only be accessed by the macros defined in
.BR cmsg (3).

View File

@ -228,25 +228,25 @@ The time structures involved are defined in
.I <sys/time.h>
and look like
.in +0.25i
.in +0.5i
.nf
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
.fi
.in -0.25i
.in
and
.in +0.25i
.in +0.5i
.nf
struct timespec {
long tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
.fi
.in -0.25i
.in
(However, see below on the POSIX.1-2001 versions.)
.PP
@ -363,14 +363,14 @@ structure are typed as
.IR <sys/time.h> .
The POSIX.1-2001 situation is
.RS
.in +0.5i
.nf
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
.fi
.RE
.in
where the structure is defined in
.I <sys/select.h>

View File

@ -234,7 +234,7 @@ structure follows.
See
.BR recv (2)
and below for an exact description of its fields.
.in +0.25i
.in +4n
.nf
struct msghdr {
@ -247,7 +247,7 @@ struct msghdr {
int msg_flags; /* flags on received message */
};
.fi
.in -0.25i
.in
.PP
You may send control information using the
.I msg_control

View File

@ -75,7 +75,7 @@ If we are interested in performing just one
of these tasks then the other argument can be specified as NULL.
Each of these arguments is a structure of the following type:
.sp
.RS
.RS 4
.nf
typedef struct {
void *ss_sp; /* Base address of stack */

View File

@ -96,7 +96,7 @@ All of these system calls return a
.I stat
structure, which contains the following fields:
.PP
.RS 0.25i
.RS 4
.nf
struct stat {
dev_t st_dev; /* ID of device containing file */

View File

@ -43,7 +43,7 @@ is a pointer to a
.I statfs
structure defined approximately as follows:
.RS
.RS 4
.nf
struct statfs {
long f_type; /* type of filesystem (see below) */

View File

@ -24,7 +24,7 @@ Until Linux 2.3.16,
used to return information in the following structure:
.nf
.in +0.25i
.in +4n
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
@ -37,7 +37,7 @@ struct sysinfo {
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
.in -0.25i
.in
.fi
.PP
and the sizes were given in bytes.
@ -46,7 +46,7 @@ Since Linux 2.3.23 (i386), 2.3.48
(all architectures) the structure is:
.nf
.in +0.25i
.in +4n
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
@ -62,7 +62,7 @@ struct sysinfo {
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */
};
.in -0.25i
.in
.fi
.PP
and the sizes are given as multiples of \fImem_unit\fP bytes.

View File

@ -37,7 +37,7 @@ The
.I utsname
struct is defined in
.IR <sys/utsname.h> :
.in +0.5i
.in +4n
.nf
struct utsname {
@ -52,7 +52,7 @@ struct utsname {
};
.fi
.in -0.5i
.in
The length of the arrays in a
.I struct utsname
is unspecified; the fields are terminated by a null byte ('\\0').

View File

@ -70,7 +70,7 @@ The
.I utimbuf
structure is:
.RS
.RS 4
.nf
struct utimbuf {
time_t actime; /* access time */
@ -92,7 +92,7 @@ The
.I timeval
structure is:
.RS
.RS 4
.nf
struct timeval {
long tv_sec; /* seconds */

View File

@ -61,13 +61,13 @@ points to an array of
structures as defined in
.IR <sys/uio.h> :
.in +0.25i
.in +4n
.nf
struct iovec {
void *iov_base; /* Starting address */
size_t iov_len; /* Number of bytes */
};
.in -0.25i
.in
.fi
The

View File

@ -41,7 +41,7 @@ The amount of time by which the clock is to be adjusted is specified
in the structure pointed to by
.IR delta .
This structure has the following form:
.in +0.25i
.in +4n
.nf
struct timeval {
@ -49,7 +49,7 @@ struct timeval {
suseconds_t tv_usec; /* microseconds */
};
.fi
.in -0.25i
.in
.PP
If the adjustment in
.I delta

View File

@ -160,7 +160,7 @@ This code looks for the
.B IP_TTL
option in a received ancillary buffer:
.PP
.RS
.RS 4
.nf
struct msghdr msgh;
struct cmsghdr *cmsg;
@ -190,9 +190,8 @@ if (cmsg == NULL) {
The code below passes an array of file descriptors over a Unix socket using
.BR SCM_RIGHTS :
.PP
.RS
.RS 4
.nf
.ta 8n 16n 32n
struct msghdr msg = {0};
struct cmsghdr *cmsg;
int myfds[NUM_FD]; /* Contains the file descriptors to pass. */
@ -210,7 +209,6 @@ fdptr = (int *) CMSG_DATA(cmsg);
memcpy(fdptr, myfds, NUM_FD * sizeof(int));
/* Sum of the length of all control messages in the buffer: */
msg.msg_controllen = cmsg\->cmsg_len;
.ta
.fi
.RE
.SH "SEE ALSO"

View File

@ -91,7 +91,7 @@ separated into year, month, day, etc.
Broken-down time is stored
in the structure \fItm\fP which is defined in \fI<time.h>\fP as follows:
.sp
.RS
.RS 4
.nf
struct tm {
int tm_sec; /* seconds */

View File

@ -345,13 +345,13 @@ Information is stored in the
.I Dl_info
structure:
.sp
.in +0.25i
.in +0.5i
.nf
typedef struct {
const char *dli_fname; /* Filename of defining object */
void *dli_fbase; /* Load address of that object */
void *dli_fbase; /* Load address of that object */
const char *dli_sname; /* Name of nearest lower symbol */
void *dli_saddr; /* Exact value of nearest symbol */
void *dli_saddr; /* Exact value of nearest symbol */
} Dl_info;
.fi
.in

View File

@ -79,7 +79,7 @@ and
are the reentrant versions.
They use the following
structure to hold the key data:
.RS
.RS 4
.nf
struct crypt_data {

View File

@ -113,13 +113,13 @@ The structure \fIether_addr\fP is defined in
.I <net/ethernet.h>
as:
.sp
.in +0.5i
.in +4n
.nf
struct ether_addr {
u_int8_t ether_addr_octet[6];
}
.fi
.in -0.5i
.in
.SH "CONFORMING TO"
4.3BSD, SunOS
.SH BUGS

View File

@ -55,7 +55,7 @@ The file \fIstream\fP must have the same format as \fI/etc/group\fP.
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp
.RS
.RS 4
.nf
struct group {
char *gr_name; /* group name */

View File

@ -59,7 +59,7 @@ The file \fIstream\fP must have the same format as
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
struct passwd {
char *pw_name; /* user name */
@ -71,7 +71,7 @@ struct passwd {
char *pw_shell; /* shell program */
};
.fi
.in -0.5i
.in
.SH "RETURN VALUE"
The
.BR fgetpwent ()

View File

@ -39,7 +39,7 @@ Return current date and time in
.IR tp ,
which is declared as follows:
.sp
.in +0.5i
.in +4n
.nf
struct timeb {
time_t time;
@ -48,7 +48,7 @@ struct timeb {
short dstflag;
};
.fi
.in -1i
.in
.LP
Here \fItime\fP is the number of seconds since the Epoch,
\fImillitm\fP is the number of milliseconds since \fItime\fP

View File

@ -101,24 +101,24 @@ The
.I FTSENT
structure contains at least the following fields, which are
described in greater detail below:
.in +0.25i
.in +0.5i
.nf
typedef struct _ftsent {
u_short fts_info; /* flags for FTSENT structure */
char *fts_accpath; /* access path */
char *fts_path; /* root path */
short fts_pathlen; /* strlen(fts_path) */
char *fts_name; /* filename */
short fts_namelen; /* strlen(fts_name) */
short fts_level; /* depth (\-1 to N) */
int fts_errno; /* file errno */
long fts_number; /* local numeric value */
void *fts_pointer; /* local address value */
struct ftsent *fts_parent; /* parent directory */
struct ftsent *fts_link; /* next file structure */
struct ftsent *fts_cycle; /* cycle structure */
struct stat *fts_statp; /* stat(2) information */
u_short fts_info; /* flags for FTSENT structure */
char *fts_accpath; /* access path */
char *fts_path; /* root path */
short fts_pathlen; /* strlen(fts_path) */
char *fts_name; /* filename */
short fts_namelen; /* strlen(fts_name) */
short fts_level; /* depth (\-1 to N) */
int fts_errno; /* file errno */
long fts_number; /* local numeric value */
void *fts_pointer; /* local address value */
struct ftsent *fts_parent; /* parent directory */
struct ftsent *fts_link; /* next file structure */
struct ftsent *fts_cycle; /* cycle structure */
struct stat *fts_statp; /* stat(2) information */
} FTSENT;
.fi
.in

View File

@ -267,7 +267,7 @@ The fourth argument that
supplies when calling
\fIfn\fP()
is a structure of type \fIFTW\fP:
.in +0.25i
.in +0.5i
.nf
struct FTW {
@ -276,7 +276,7 @@ struct FTW {
};
.fi
.in -0.25i
.in
.I base
is the offset of the filename (i.e., basename component)
in the pathname given in

View File

@ -74,7 +74,7 @@ after all processing has been performed.
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp
.RS +0.25i
.RS +0.5i
.nf
struct group {
char *gr_name; /* group name */

View File

@ -66,13 +66,13 @@ The \fIgroup\fP structure is defined in
.I <grp.h>
as follows:
.sp
.RS
.RS 4
.nf
struct group {
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group ID */
char **gr_mem; /* group members */
char *gr_name; /* group name */
char *gr_passwd; /* group password */
gid_t gr_gid; /* group ID */
char **gr_mem; /* group members */
};
.ta
.fi

View File

@ -88,7 +88,7 @@ was found or an error occurred) is stored in
.PP
The \fIgroup\fP structure is defined in \fI<grp.h>\fP as follows:
.sp
.RS +0.25i
.RS 4
.nf
struct group {
char *gr_name; /* group name */

View File

@ -202,7 +202,7 @@ followed by
.PP
The \fIhostent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
.ne 7
struct hostent {
@ -214,7 +214,7 @@ struct hostent {
}
#define h_addr h_addr_list[0] /* for backward compatibility */
.fi
.in -0.5i
.in
.PP
The members of the \fIhostent\fP structure are:
.TP

View File

@ -116,7 +116,7 @@ of size
.PP
The \fImntent\fP structure is defined in \fI<mntent.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
struct mntent {
char *mnt_fsname; /* name of mounted file system */
@ -127,7 +127,7 @@ struct mntent {
int mnt_passno; /* pass number on parallel fsck */
};
.fi
.in -0.5i
.in
Since fields in the mtab and fstab files are separated by whitespace,
octal escapes are used to represent the four characters space (\e040),

View File

@ -80,7 +80,7 @@ function closes \fI/etc/networks\fP.
.PP
The \fInetent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
struct netent {
char *n_name; /* official network name */
@ -89,7 +89,7 @@ struct netent {
unsigned long n_net; /* network number */
}
.fi
.in -0.5i
.in
.PP
The members of the \fInetent\fP structure are:
.TP

View File

@ -78,7 +78,7 @@ function closes \fI/etc/protocols\fP.
.PP
The \fIprotoent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
struct protoent {
char *p_name; /* official protocol name */
@ -86,7 +86,7 @@ struct protoent {
int p_proto; /* protocol number */
}
.fi
.in -0.5i
.in
.PP
The members of the \fIprotoent\fP structure are:
.TP

View File

@ -51,7 +51,7 @@ The returned buffer contains a line of format
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.RS
.RS 4
.nf
struct passwd {
char *pw_name; /* user name */

View File

@ -78,7 +78,7 @@ after all processing has been performed.
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.RS 0.25i
.RS 4
.nf
struct passwd {
char *pw_name; /* user name */

View File

@ -65,7 +65,7 @@ The \fIpasswd\fP structure is defined in
.I <pwd.h>
as follows:
.sp
.RS
.RS 4
.nf
struct passwd {
char *pw_name; /* user name */

View File

@ -99,7 +99,7 @@ was found or an error occurred) is stored in
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.RS 0.25i
.RS 4
.nf
struct passwd {
char *pw_name; /* user name */

View File

@ -39,29 +39,25 @@ following structure
containing the broken-out
fields of a line in the rpc program number data base,
.IR /etc/rpc .
.RS
.RS 4
.LP
.nf
.ft B
struct rpcent {
char *r_name; /* name of server for this rpc program */
char **r_aliases; /* alias list */
long r_number; /* rpc program number */
struct rpcent {
char *r_name; /* name of server for this rpc program */
char **r_aliases; /* alias list */
long r_number; /* rpc program number */
};
.ft R
.fi
.RE
.LP
The members of this structure are:
.RS
.PD 0
.TP 20
.TP 10
.I r_name
The name of the server for this rpc program.
.TP 20
.TP
.I r_aliases
A zero terminated list of alternate names for the rpc program.
.TP 20
.TP
.I r_number
The rpc program number for this service.
.PD

View File

@ -86,7 +86,7 @@ function closes \fI/etc/services\fP.
.PP
The \fIservent\fP structure is defined in \fI<netdb.h>\fP as follows:
.sp
.RS
.RS 4
.nf
struct servent {
char *s_name; /* official service name */

View File

@ -188,7 +188,7 @@ often with different prototypes.
.SS Structure
The shadow password structure is defined in \fI<shadow.h>\fP as follows:
.sp
.RS +0.25i
.RS 4
.nf
struct spwd {
char *sp_namp; /* Login name */

View File

@ -37,7 +37,7 @@ getumask \- get file creation mask
.SH DESCRIPTION
This function returns the current file creation mask.
It is equivalent to
.in +0.5i
.in +4n
.nf
mode_t getumask(void)
@ -48,7 +48,7 @@ mode_t getumask(void)
}
.fi
.in -0.5i
.in
except that it is documented to be thread-safe (that is, shares
a lock with the
.BR umask (2)

View File

@ -77,12 +77,12 @@ the hash table so that a new table can be constructed.
.PP
The argument \fIitem\fP is of type \fBENTRY\fP, which is a typedef defined in
\fI<search.h>\fP and includes these elements:
.RS
.RS 4
.sp
.nf
typedef struct entry {
char *\fIkey\fP;
void *\fIdata\fP;
char *key;
void *data;
} ENTRY;
.RE
.fi

View File

@ -137,7 +137,7 @@ is defined in
.I <netinet/in.h>
as:
.sp
.RS
.RS 4
.nf
typedef uint32_t in_addr_t;

View File

@ -72,7 +72,7 @@ Traditionally (e.g., SunOS, Linux libc 4,5) the parameters of these
functions were of type \fIstruct qelem *\fP, where the struct
is defined as
.RS
.RS 4
.nf
struct qelem {
struct qelem *q_forw;

View File

@ -110,7 +110,7 @@ The example program below demonstrates the use of
and
.BR swapcontext ().
Running the program produces the following output:
.in +0.5i
.in +4n
.nf
$ ./a.out
@ -124,7 +124,7 @@ func1: returning
main: exiting
.fi
.in -0.5i
.in
.nf
#include <ucontext.h>
#include <stdio.h>

View File

@ -47,7 +47,7 @@ returns an
structure in the buffer pointed by
.IR attr .
This structure is defined as:
.in +0.25i
.in +4n
.nf
struct mq_attr {
@ -57,7 +57,7 @@ struct mq_attr {
long mq_curmsgs; /* # of messages currently in queue */
};
.fi
.in -0.25i
.in
.PP
The
.I mq_flags

View File

@ -43,25 +43,27 @@ The
argument is a pointer to a
.I sigevent
structure that is defined something like the following:
.in +0.25i
.in +4n
.nf
union sigval { /* Data passed with notification */
int sival_int; /* Integer value */
void *sival_ptr; /* Pointer value */
union sigval { /* Data passed with notification */
int sival_int; /* Integer value */
void *sival_ptr; /* Pointer value */
};
struct sigevent {
int sigev_notify; /* Notification method */
int sigev_signo; /* Notification signal */
union sigval sigev_value; /* Data passed with notification */
void (*sigev_notify_function) (union sigval);
/* Function for thread notification */
void *sigev_notify_attributes;
/* Thread function attributes */
int sigev_notify; /* Notification method */
int sigev_signo; /* Notification signal */
union sigval sigev_value; /* Data passed with
notification */
void (*sigev_notify_function) (union sigval);
/* Function for thread
notification */
void *sigev_notify_attributes;
/* Thread function attributes */
};
.fi
.in -0.25i
.in
.PP
If
.I notification

View File

@ -83,7 +83,7 @@ This ceiling is an absolute timeout in seconds and nanoseconds
since the Epoch (midnight on the morning of 1 January 1970),
specified in the following structure:
.sp
.RS
.RS 4
.nf
struct timespec {
time_t tv_sec; /* seconds */

View File

@ -89,7 +89,7 @@ This ceiling is an absolute timeout in seconds and nanoseconds
since the Epoch (midnight on the morning of 1 January 1970),
specified in the following structure:
.sp
.RS
.RS 4
.nf
struct timespec {
time_t tv_sec; /* seconds */

View File

@ -84,7 +84,7 @@ This function is a recent invention in POSIX.
Some Unix implementations that support System V
(aka Unix 98) pseudo-terminals don't have this function, but it
is easy to implement:
.in +0.5i
.in +4n
.nf
int
@ -93,7 +93,7 @@ posix_openpt(int flags)
return open("/dev/ptmx", flags);
}
.fi
.in -0.5i
.in
.SH "SEE ALSO"
.BR open (2),
.BR getpt (3),

View File

@ -22,7 +22,7 @@ The list of group members must be NULL terminated or NULL initialized.
.sp
The \fIstruct group\fP is defined as follows:
.sp
.in +0.5i
.in +4n
.nf
struct group {
char *gr_name; /* group name */
@ -31,7 +31,7 @@ struct group {
char **gr_mem; /* group members */
};
.fi
.in -0.5i
.in
.SH "RETURN VALUE"
The function returns zero on success, and a non-zero value on error.
.SH "CONFORMING TO"

View File

@ -52,7 +52,7 @@ structure \fIp\fP in the file associated with \fIstream\fP.
.PP
The \fIpasswd\fP structure is defined in \fI<pwd.h>\fP as follows:
.sp
.in +0.5i
.in +4n
.nf
struct passwd {
char *pw_name; /* user name */
@ -65,7 +65,7 @@ struct passwd {
};
.ta
.fi
.in -0.5i
.in
.SH "RETURN VALUE"
The
.BR putpwent ()

View File

@ -54,7 +54,7 @@ On Linux, the
.I dirent
structure is defined as follows:
.PP
.RS 0.25i
.RS 4
.nf
struct dirent {
ino_t d_ino; /* inode number */

View File

@ -182,7 +182,7 @@ structure which is the type of
is defined in
.IR <regex.h> .
.RS
.RS 4
.nf
typedef struct {
regoff_t rm_so;

View File

@ -74,12 +74,12 @@ in seconds and nanoseconds since the Epoch (00:00:00, 1 January 1970).
This structure is defined as follows:
.nf
.in +0.5i
.in +4n
struct timespec {
time_t tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds [0 .. 999999999] */
};
.in -0.5i
.in
.fi
.PP
If the timeout has already expired by the time of the call,
@ -162,7 +162,7 @@ of the timeout, in seconds, for
.BR sem_timedwait ().
The following shows what happens on two different runs of the program:
.in +0.5i
.in +4n
.nf
$ ./a.out 2 3
About to call sem_timedwait()
@ -173,7 +173,7 @@ $ ./a.out 2 1
About to call sem_timedwait()
sem_timedwait() timed out
.fi
.in -0.5i
.in
.PP
The source code of the program is as follows:
.nf

View File

@ -374,7 +374,7 @@ to circumvent this
problem.
A relatively clean one is to add an
intermediate function
.in +0.5i
.in +4n
.nf
size_t
@ -384,7 +384,7 @@ my_strftime(char *s, size_t max, const char *fmt,
return strftime(s, max, fmt, tm);
}
.fi
.in -0.5i
.in
Nowadays,
.BR gcc (1)

View File

@ -255,7 +255,7 @@ using the locale's alternative numeric symbols.
The broken-down time structure \fItm\fP is defined in \fI<time.h>\fP
as follows:
.sp
.in +0.5i
.in +4n
.nf
struct tm {
int tm_sec; /* seconds */
@ -269,7 +269,7 @@ struct tm {
int tm_isdst; /* daylight saving time */
};
.fi
.in -0.5i
.in
.SH "RETURN VALUE"
The return value of the function is a pointer to the first character
not processed in this function call.

View File

@ -162,10 +162,9 @@ BSD also has
.sp
.in +4n
.nf
.B "quad_t"
.BI "strtoq(const char *" nptr ", char **" endptr ", int " base );
.BI "quad_t strtoq(const char *" nptr ", char **" endptr ", int " base );
.sp
.in -4n
.in
.fi
with completely analogous definition.
Depending on the wordsize of the current architecture, this
@ -187,7 +186,7 @@ a function that performs no error checking and
has a simpler interface than
.BR strtol ().)
Some examples of the results produced by this program are the following:
.in +0.25i
.in +4n
.nf
$ ./a.out 123
@ -205,7 +204,7 @@ $ ./a.out 4000000000
strtol: Numerical result out of range
.fi
.in -0.25i
.in
The source code of the program is as follows:
.nf

View File

@ -139,7 +139,7 @@ struct rtc_time {
int tm_isdst; /* unused */
};
.fi
.in -0.5i
.in
.RE
.IP
The fields in this structure have the same meaning and ranges as for the
@ -261,7 +261,7 @@ struct rtc_wkalrm {
struct rtc_time time;
};
.fi
.in -0.5i
.in
.RE
.IP
The

View File

@ -74,7 +74,7 @@ are provided:
.B HDIO_GETGEO
.RS
Returns the BIOS disk parameters in the following structure:
.RS
.RS 4
.nf
struct hd_geometry {

View File

@ -123,12 +123,14 @@ The entries are separated by null bytes ('\\0'),
and there may be a null bytes at the end.
Thus, to print out the environment of process 1, you would do:
.br
.in +4n
.nf
.ft CW
(cat /proc/1/environ; echo) | tr "\\000" "\\n"
.fi
.ft P
.in
(For a reason why one should want to do this, see
.BR lilo (8)
@ -183,13 +185,13 @@ input, and which write to a file, but will not send their output to
standard output, can be effectively foiled this way, assuming that \-i
is the flag designating an input file and \-o is the flag designating
an output file:
.br
.in +4n
.nf
\f(CWfoobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ...\fR
.fi
.br
.in
and you have a working filter.
.\" The following is not true in my tests (MTK):
.\" Note that this will not work for
@ -282,7 +284,7 @@ are not available if the main thread has already terminated
.IR /proc/[number]/smaps " (since Linux 2.6.14)"
This file shows memory consumption for each of the process's mappings.
For each of mappings there is a series of lines as follows:
.in +0.25i
.in +4n
.nf
08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
@ -294,7 +296,7 @@ Private_Clean: 0 kB
Private_Dirty: 0 kB
.fi
.in -0.25i
.in
The first of these lines shows the same information as is displayed
for the mapping in
.IR /proc/[number]/maps .
@ -505,13 +507,18 @@ Aggregated block I/O delays, measured in clock ticks (centiseconds).
.I /proc/[number]/statm
Provides information about memory status in pages.
The columns are:
size total program size
resident resident set size
share shared pages
text text (code)
lib library
data data/stack
dt dirty pages (unused in Linux 2.6)
.in +4n
.nf
size total program size
resident resident set size
share shared pages
text text (code)
lib library
data data/stack
dt dirty pages (unused in Linux 2.6)
.fi
.in
.TP
.I /proc/[number]/status
Provides much of the information in
@ -650,6 +657,7 @@ exists on systems with the ide bus.
There are directories for each ide channel and attached device.
Files include:
.in +4n
.nf
cache buffer size in KB
capacity number of sectors
@ -662,6 +670,7 @@ settings drive settings
smart_thresholds in hexadecimal
smart_values in hexadecimal
.fi
.in
The
.BR hdparm (8)
@ -1045,7 +1054,9 @@ kernel configuration option is enabled.
The columns in
.I /proc/slabinfo
are:
.in +4n
.nf
cache-name
num-active-objs
total-objs
@ -1054,6 +1065,8 @@ num-active-slabs
total-slabs
num-pages-per-slab
.fi
.in
See
.BR slabinfo (5)
for details.
@ -1450,25 +1463,23 @@ hostname of your box in exactly the same way as the commands
and
.BR hostname (1),
that is:
.br
.br
.in +4n
.nf
# echo "darkstar" > /proc/sys/kernel/hostname
.br
# echo "mydomain" > /proc/sys/kernel/domainname
.br
.fi
.in
.br
has the same effect as
.br
.br
.in +4n
.nf
# hostname "darkstar"
.br
# domainname "mydomain"
.br
.fi
.in
.br
Note, however, that the classic darkstar.frop.org has the
hostname "darkstar" and DNS (Internet Domain Name Server)
domainname "frop.org", not to be confused with the NIS (Network

View File

@ -60,7 +60,7 @@ These values serve as indices into an array of
.I ttinfo
structures that appears next in the file;
these structures are defined as follows:
.in +.5i
.in +4n
.sp
.nf
struct ttinfo {
@ -68,7 +68,7 @@ struct ttinfo {
int tt_isdst;
unsigned int tt_abbrind;
};
.in -.5i
.in
.fi
.sp
Each structure is written as a four-byte value for

View File

@ -74,15 +74,17 @@ They take a pointer to a
.I struct arpreq
as their parameter.
.RS 4
.nf
struct arpreq {
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
struct sockaddr arp_netmask; /* netmask of protocol address */
struct sockaddr arp_pa; /* protocol address */
struct sockaddr arp_ha; /* hardware address */
int arp_flags; /* flags */
struct sockaddr arp_netmask; /* netmask of protocol address */
char arp_dev[16];
};
.fi
.RE
.BR SIOCSARP ", " SIOCDARP " and " SIOCGARP
respectively set, delete and get an ARP mapping.
@ -245,7 +247,9 @@ It is replaced by automatic proxy arp setup by
the kernel for all reachable hosts on other interfaces (when
forwarding and proxy arp is enabled for the interface).
The neigh/* sysctls did not exist before Linux 2.2.
The
.I neigh/*
sysctls did not exist before Linux 2.2.
.SH BUGS
Some timer settings are specified in jiffies, which is architecture
and kernel version dependent; see

View File

@ -61,7 +61,7 @@ capability.
An Appletalk socket address is defined as a combination of a network number,
a node number, and a port number.
.PP
.RS
.RS 4
.nf
struct at_addr {
u_short s_net;

View File

@ -77,7 +77,7 @@ will block until at least one event occurs.
Each successful
.BR read (2)
returns a buffer containing one or more of the following structures:
.RS 4
.in +4n
.nf
struct inotify_event {
@ -89,7 +89,7 @@ struct inotify_event {
char name[]; /* Optional null-terminated name */
};
.fi
.RE
.in
.I wd
identifies the watch for which this event occurs.

View File

@ -111,7 +111,7 @@ On raw sockets
.I sin_port
is set to the IP protocol.
.PP
.in +0.25i
.in +4n
.nf
struct sockaddr_in {
sa_family_t sin_family; /* address family: AF_INET */
@ -124,7 +124,7 @@ struct in_addr {
u_int32_t s_addr; /* address in network byte order */
};
.fi
.in -0.25i
.in
.PP
.I sin_family
is always set to
@ -253,7 +253,7 @@ as control message with a packet using
or
.BR sendmsg (2).
.IP
.in +0.25i
.in +4n
.nf
struct in_pktinfo {
unsigned int ipi_ifindex; /* Interface index */
@ -262,7 +262,7 @@ struct in_pktinfo {
address */
};
.fi
.in -0.25i
.in
.IP
.\" FIXME elaborate on that.
.I ipi_ifindex
@ -399,7 +399,7 @@ control message contains a
.I sock_extended_err
structure:
.IP
.in +0.25i
.in +4n
.ne 18
.nf
#define SO_EE_ORIGIN_NONE 0
@ -420,7 +420,7 @@ struct sock_extended_err {
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
.fi
.in -0.25i
.in
.IP
.I ee_errno
contains the
@ -633,7 +633,7 @@ Argument is an
.I ip_mreqn
structure.
.sp
.in +0.25i
.in +4n
.nf
struct ip_mreqn {
struct in_addr imr_multiaddr; /* IP multicast group
@ -643,7 +643,7 @@ struct ip_mreqn {
int imr_ifindex; /* interface index */
};
.fi
.in -0.25i
.in
.sp
.I imr_multiaddr
contains the address of the multicast group the application

View File

@ -62,7 +62,7 @@ or packet to a IPv6 socket its source address will be mapped
to v6 and it will be mapped to v6.
.SS "Address Format"
.sp
.RS
.RS 4
.nf
struct sockaddr_in6 {
u_int16_t sin6_family; /* AF_INET6 */

View File

@ -93,7 +93,7 @@ In most cases the
library interfaces listed above are implemented
on top of underlying system calls of the same name.
Deviations from this scheme are indicated in the following table:
.in +0.25i
.in +4n
.TS
lB lB
l l.
@ -108,7 +108,7 @@ mq_timedreceive(3) mq_timedreceive(2)
mq_timedsend(3) mq_timedsend(2)
mq_unlink(3) mq_unlink(2)
.TE
.in -0.25i
.in
.SS Versions
POSIX message queues have been supported on Linux since kernel 2.6.6.
Glibc support has been provided since version 2.3.4.
@ -186,14 +186,14 @@ On Linux, message queues are created in a virtual file system.
(Other implementations may also provide such a feature,
but the details are likely to differ.)
This file system can be mounted using the following commands:
.in +0.25i
.in +4n
.nf
$ mkdir /dev/mqueue
$ mount -t mqueue none /dev/mqueue
.fi
.in -0.25i
.in
The sticky bit is automatically enabled on the mount directory.
After the file system has been mounted, the message queues on the system
@ -205,7 +205,7 @@ and
The contents of each file in the directory consist of a single line
containing information about the queue:
.in +0.25i
.in +4n
.nf
$ ls /dev/mqueue/mymq
@ -213,7 +213,7 @@ QSIZE:129 NOTIFY:2 SIGNO:0 NOTIFY_PID:8260
$ mount -t mqueue none /dev/mqueue
.fi
.in -0.25i
.in
These fields are as follows:
.TP
.B

View File

@ -27,6 +27,7 @@ They pass an
.I ifreq
structure:
.RS 4
.nf
struct ifreq {
char ifr_name[IFNAMSIZ]; /* Interface name */
@ -55,6 +56,7 @@ struct ifconf {
};
};
.fi
.RE
Normally, the user specifies which device to affect by setting
.I ifr_name

View File

@ -134,7 +134,7 @@ After each
.I nlmsghdr
the payload follows.
.in +0.25i
.in +4n
.nf
struct nlmsghdr {
__u32 nlmsg_len; /* Length of message including header. */
@ -144,7 +144,7 @@ struct nlmsghdr {
__u32 nlmsg_pid; /* PID of the sending process. */
};
.fi
.in -0.25i
.in
.I nlmsg_type
can be one of the standard message types:
@ -157,14 +157,14 @@ structure,
.B NLMSG_DONE
message terminates a multipart message.
.in +0.25i
.in +4n
.nf
struct nlmsgerr {
int error; /* Negative errno or 0 for acknowledgements */
struct nlmsghdr msg; /* Message header that caused the error */
};
.fi
.in -0.25i
.in
A netlink family usually specifies more message types, see the
appropriate manual pages for that, for example,
@ -282,7 +282,7 @@ netlink multicast groups
.RI ( nl_groups
not equal 0).
.in +0.25i
.in +4n
.nf
struct sockaddr_nl {
sa_family_t nl_family; /* AF_NETLINK */
@ -291,7 +291,7 @@ struct sockaddr_nl {
__u32 nl_groups; /* Multicast groups mask. */
};
.fi
.in -0.25i
.in
.I nl_pid
is the unicast address of netlink socket.
@ -381,7 +381,7 @@ netlink socket which will listen to the
.B RTMGRP_IPV4_IFADDR
(IPv4 addresses add/delete events) multicast groups.
.in +0.25i
.in +4n
.nf
struct sockaddr_nl sa;
@ -392,14 +392,14 @@ snl.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
bind(fd, (struct sockaddr*)&sa, sizeof(sa));
.fi
.in -0.25i
.in
The next example demonstrates how to send a netlink message to the
kernel (pid 0).
Note that application must take care of message sequence numbers
in order to reliably track acknowledgements.
.in +0.25i
.in +4n
.nf
struct nlmsghdr *nh; /* The nlmsghdr with payload to send. */
struct sockaddr_nl sa;
@ -416,11 +416,11 @@ nh\->nlmsg_flags |= NLM_F_ACK;
sendmsg(fd, &msg, 0);
.fi
.in -0.25i
.in
And the last example is about reading netlink message.
.in +0.25i
.in +4n
.nf
int len;
char buf[4096];
@ -446,7 +446,7 @@ for (nh = (struct nlmsghdr *) buf; NLMSG_OK (nh, len);
...
}
.fi
.in -0.25i
.in
.SH "SEE ALSO"
.BR cmsg (3),
.BR netlink (3),

View File

@ -105,7 +105,7 @@ even when it is longer than the buffer.
.SS Address Types
The sockaddr_ll is a device independent physical layer address.
.in +0.25i
.in +4n
.nf
struct sockaddr_ll {
unsigned short sll_family; /* Always AF_PACKET */
@ -117,7 +117,7 @@ struct sockaddr_ll {
unsigned char sll_addr[8]; /* Physical layer address */
};
.fi
.in -0.25i
.in
.I sll_protocol
is the standard ethernet protocol type in network order as defined
@ -187,7 +187,7 @@ They both expect a
.B packet_mreq
structure as argument:
.in +0.25i
.in +4n
.nf
struct packet_mreq {
int mr_ifindex; /* interface index */
@ -196,7 +196,7 @@ struct packet_mreq {
unsigned char mr_address[8]; /* physical layer address */
};
.fi
.in -0.25i
.in
.B mr_ifindex
contains the interface index for the interface whose status
@ -284,7 +284,7 @@ The include file
is present since glibc 2.1.
Older systems need:
.sp
.in +0.5i
.in +4n
.nf
#include <asm/types.h>
#include <linux/if_packet.h>
@ -333,7 +333,7 @@ uses the old
to specify an interface, which doesn't provide physical layer
independence.
.in +0.25i
.in +4n
.nf
struct sockaddr_pkt {
unsigned short spkt_family;
@ -341,7 +341,7 @@ struct sockaddr_pkt {
unsigned short spkt_protocol;
};
.fi
.in -0.25i
.in
.I spkt_family
contains
@ -358,7 +358,7 @@ This structure is obsolete and should not be used in new code.
glibc 2.1 does not have a define for
.BR SOL_PACKET .
The suggested workaround is to use:
.in +0.5i
.in +4n
.nf
#ifndef SOL_PACKET
@ -366,7 +366,7 @@ The suggested workaround is to use:
#endif
.fi
.in -0.5i
.in
This is fixed in later glibc versions and also does not occur on
libc5 systems.

View File

@ -285,14 +285,14 @@ The argument is a
.I linger
structure.
.sp
.in +0.25i
.in +4n
.nf
struct linger {
int l_onoff; /* linger active */
int l_linger; /* how many seconds to linger for */
};
.fi
.in -0.25i
.in
.IP
When enabled, a
.BR close (2)
@ -587,11 +587,11 @@ per socket.
These operations can be accessed using
.BR ioctl (2):
.in +0.25i
.in +4n
.nf
.IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");"
.fi
.in -0.25i
.in
.TP
.B SIOCGSTAMP
Return a

View File

@ -555,7 +555,7 @@ The
file contains the contents of the SPU MFC DMA queue, represented as the
following structure:
.in +0.25i
.in +0.5i
.nf
struct spu_dma_info {
uint64_t dma_info_type;
@ -574,7 +574,7 @@ The
.I mfc_cq_sr
structure is defined as:
.in +0.25i
.in +0.5i
.nf
struct mfc_cq_sr {
uint64_t mfc_cq_data0_RW;
@ -640,7 +640,7 @@ The following operations are supported:
Writes to this file need to be in the format of a MFC DMA command,
defined as follows:
.in +0.25i
.in +0.5i
.nf
struct mfc_dma_command {
int32_t pad; /* reserved */

View File

@ -62,7 +62,7 @@ The local address can be set using
When a socket is connected and it doesn't already have a local address a
unique address in the abstract namespace will be generated automatically.
.in +0.25i
.in +4n
.nf
#define UNIX_PATH_MAX 108
@ -71,7 +71,7 @@ struct sockaddr_un {
char sun_path[UNIX_PATH_MAX]; /* pathname */
};
.fi
.in -0.25i
.in
.I sun_family
always contains
@ -171,7 +171,7 @@ The credentials are passed as a
.I struct ucred
ancillary message.
.in +0.25i
.in +4n
.nf
struct ucred {
pid_t pid; /* process ID of the sending process */
@ -179,7 +179,7 @@ struct ucred {
gid_t gid; /* group ID of the sending process */
};
.fi
.in -0.25i
.in
The credentials which the sender specifies are checked by the kernel.
A process with effective user ID 0 is allowed to specify values that do

View File

@ -47,7 +47,7 @@ socket address family uses the
for representing network addresses as defined in ITU-T
recommendation X.121.
.PP
.RS
.RS 4
.nf
struct sockaddr_x25 {
sa_family_t sx25_family; /* must be AF_X25 */