This commit is contained in:
Michael Kerrisk 2007-04-03 14:04:54 +00:00
parent ed9ed0f576
commit 521bf58405
28 changed files with 130 additions and 141 deletions

View File

@ -26,7 +26,6 @@
arch_prctl \- set architecture specific thread state
.SH SYNOPSIS
.B #include <asm/prctl.h>
.sp
.B #include <sys/prctl.h>
.sp
.BI "int arch_prctl(int code, unsigned long addr)"

View File

@ -67,12 +67,13 @@
.SH NAME
bind \- bind a name to a socket
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.br
.B #include <sys/socket.h>
.sp
.BI "int bind(int " sockfd ", const struct sockaddr *" my_addr \
", socklen_t " addrlen );
.fi
.SH DESCRIPTION
.BR bind ()
gives the socket

View File

@ -66,12 +66,14 @@
.SH NAME
connect \- initiate a connection on a socket
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.br
.B #include <sys/socket.h>
.sp
.BI "int connect(int " sockfd ", const struct sockaddr *" serv_addr ,
.BI "socklen_t " addrlen );
.BI " socklen_t " addrlen );
.fi
.SH DESCRIPTION
The
.BR connect ()

View File

@ -32,7 +32,8 @@ fstatat \- get file status relative to a directory file descriptor
.B #include <sys/stat.h>
.sp
.BI "int fstatat(int " dirfd ", const char *" pathname ", struct stat *" \
buf ", int " flags );
buf ,
.BI " int " flags );
.fi
.SH DESCRIPTION
The

View File

@ -19,7 +19,6 @@ futex \- Fast Userspace Locking system call
.nf
.sp
.B "#include <linux/futex.h>"
.sp
.B "#include <sys/time.h>"
.sp
.BI "int futex(int *" uaddr ", int " op ", int " val \

View File

@ -12,7 +12,6 @@ get_thread_area \- Get a Thread Local Storage (TLS) area
.B #include <asm/ldt.h>
.sp
.BI "int get_thread_area(struct user_desc *" u_info );
.SH "DESCRIPTION"
.BR get_thread_area ()
returns an entry in the current thread's Thread Local Storage (TLS) array.
@ -20,14 +19,12 @@ The index of the entry corresponds to the value
of \fIu_info->\fR\fIentry_number\fR, passed in by the user.
If the value is in bounds, \fBget_thread_info\fR copies the corresponding
TLS entry into the area pointed to by \fIu_info\fR.
.SH "RETURN VALUE"
.BR get_thread_area ()
returns 0 on success.
Otherwise, it returns \-1 and sets
.I errno
appropriately.
.SH ERRORS
.TP
.B EFAULT
@ -39,12 +36,10 @@ appropriately.
.BR get_thread_area ()
is Linux specific and should not be used in programs
that are intended to be portable.
.SH AVAILABILITY
A version of
.BR get_thread_area ()
first appeared in Linux 2.5.32.
.SH "SEE ALSO"
.BR modify_ldt (2),
.BR set_thread_area (2)

View File

@ -43,15 +43,17 @@
.SH NAME
getsockopt, setsockopt \- get and set options on sockets
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.br
.B #include <sys/socket.h>
.sp 2
.sp
.BI "int getsockopt(int " s ", int " level ", int " optname ,
.BI "void *" optval ", socklen_t *" optlen );
.BI " void *" optval ", socklen_t *" optlen );
.sp
.BI "int setsockopt(int " s ", int " level ", int " optname ,
.BI "const void *" optval ", socklen_t " optlen );
.BI " const void *" optval ", socklen_t " optlen );
.fi
.SH DESCRIPTION
.BR getsockopt ()
and

View File

@ -27,8 +27,11 @@
.SH NAME
ipc \- System V IPC system calls
.SH SYNOPSIS
.BI "int ipc(unsigned int " call ", int " first ", int " second ,
.BI "int " third ", void *" ptr ", long " fifth );
.nf
.BI "int ipc(unsigned int " call ", int " first ", int " second \
", int " third ,
.BI " void *" ptr ", long " fifth );
.fi
.SH DESCRIPTION
.BR ipc ()
is a common kernel entry point for the System V IPC calls

View File

@ -29,11 +29,8 @@ _llseek \- reposition read/write file offset
.SH SYNOPSIS
.nf
.B #include <unistd.h>
.sp
.B #include <sys/types.h>
.sp
.B #include <linux/unistd.h>
.sp
.B #include <errno.h>
.sp
.B _syscall5(int, _llseek, unsigned int, fd, unsigned long, hi,

View File

@ -23,13 +23,15 @@
.SH NAME
mbind \- Set memory policy for a memory range
.SH SYNOPSIS
.nf
.B "#include <numaif.h>"
.sp
.BI "int mbind(void *" start ", unsigned long " len ,
.BI "int " policy ", unsigned long *" nodemask ,
.BI "unsigned long " maxnode ", unsigned " flags );
.BI "int mbind(void *" start ", unsigned long " len ", int " policy ,
.BI " unsigned long *" nodemask ", unsigned long " maxnode ,
.BI " unsigned " flags );
.sp
.BI cc ... -lnuma
.BI "cc ... -lnuma"
.fi
.SH DESCRIPTION
.BR mbind ()
sets the NUMA memory

View File

@ -39,26 +39,17 @@
msgop \- message operations
.SH SYNOPSIS
.nf
.B
#include <sys/types.h>
.br
.B
#include <sys/ipc.h>
.br
.B
#include <sys/msg.h>
.B #include <sys/types.h>
.B #include <sys/ipc.h>
.B #include <sys/msg.h>
.sp
.BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
", int " msgflg );
.sp
.BI "ssize_t msgrcv(int " msqid ", void *" msgp ", size_t " msgsz \
", long " msgtyp ,
.BI " int " msgflg );
.fi
.sp
.BI "int msgsnd(int " msqid ,
.BI "const void *" msgp ,
.BI "size_t " msgsz ,
.BI "int " msgflg );
.sp
.BI "ssize_t msgrcv(int " msqid ,
.BI "void *" msgp ,
.BI "size_t " msgsz ,
.BI "long " msgtyp ,
.BI "int " msgflg );
.SH DESCRIPTION
The
.BR msgsnd ()

View File

@ -8,30 +8,31 @@ nfsservctl \- syscall interface to kernel nfs daemon
.SH SYNOPSIS
.B #include <linux/nfsd/syscall.h>
.sp
.BI "nfsservctl(int " cmd ", struct nfsctl_arg *" argp ", union nfsctl_res *" resp );
.BI "nfsservctl(int " cmd ", struct nfsctl_arg *" argp \
", union nfsctl_res *" resp );
.SH DESCRIPTION
.nf
/*
* These are the commands understood by nfsctl().
*/
#define NFSCTL_SVC 0 /* This is a server process. */
#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
#define NFSCTL_EXPORT 3 /* export a file system. */
#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
#define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */
#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */
#define NFSCTL_SVC 0 /* This is a server process. */
#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
#define NFSCTL_EXPORT 3 /* export a file system. */
#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
#define NFSCTL_UGIDUPDATE 5 /* update a client's UID/GID map. */
#define NFSCTL_GETFH 6 /* get an fh (used by mountd) */
struct nfsctl_arg {
int ca_version; /* safeguard */
union {
struct nfsctl_svc u_svc;
struct nfsctl_client u_client;
struct nfsctl_export u_export;
struct nfsctl_uidmap u_umap;
struct nfsctl_fhparm u_getfh;
unsigned int u_debug;
} u;
int ca_version; /* safeguard */
union {
struct nfsctl_svc u_svc;
struct nfsctl_client u_client;
struct nfsctl_export u_export;
struct nfsctl_uidmap u_umap;
struct nfsctl_fhparm u_getfh;
unsigned int u_debug;
} u;
}
union nfsctl_res {

View File

@ -30,7 +30,6 @@
outb, outw, outl, outsb, outsw, outsl,
inb, inw, inl, insb, insw, insl,
outb_p, outw_p, outl_p, inb_p, inw_p, inl_p \- port I/O
.sp
.SH DESCRIPTION
This family of functions is used to do low level port input and output.
The out* functions do port output, the in* functions do port input;
@ -54,7 +53,6 @@ or alternatively
to tell the kernel to allow the user space application to access the
I/O ports in question. Failure to do this will cause the application
to receive a segmentation fault.
.SH "CONFORMING TO"
\fBoutb\fP() and friends are hardware specific. The
.I value

View File

@ -36,10 +36,12 @@
.SH NAME
prctl \- operations on a process
.SH SYNOPSIS
.nf
.B #include <sys/prctl.h>
.sp
.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3
.BI ", unsigned long " arg4 ", unsigned long " arg5 );
.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 ,
.BI " unsigned long " arg4 ", unsigned long " arg5 );
.fi
.SH DESCRIPTION
.BR prctl ()
is called with a first argument describing what to do

View File

@ -88,7 +88,6 @@ quotactl \- manipulate disk quota
", caddr_t " addr );
.sp
.B #include <linux/unistd.h>
.sp
.B #include <errno.h>
.sp
.BI "_syscall4(int, quotactl, int, " cmd ", const char *, " special ,

View File

@ -33,9 +33,9 @@ removexattr, lremovexattr, fremovexattr \- remove an extended attribute
.B #include <sys/types.h>
.B #include <attr/xattr.h>
.sp
.BI "int removexattr (const char\ *" path ", const char\ *" name );
.BI "int lremovexattr (const char\ *" path ", const char\ *" name );
.BI "int fremovexattr (int " filedes ", const char\ *" name );
.BI "int removexattr(const char\ *" path ", const char\ *" name );
.BI "int lremovexattr(const char\ *" path ", const char\ *" name );
.BI "int fremovexattr(int " filedes ", const char\ *" name );
.fi
.fam T
.SH DESCRIPTION

View File

@ -60,7 +60,6 @@ POSIX systems on which
is available define
.I _POSIX_PRIORITY_SCHEDULING
in <unistd.h>.
.SH "RETURN VALUE"
On success,
.BR sched_rr_get_interval ()

View File

@ -51,7 +51,6 @@ POSIX systems on which
is available define
.I _POSIX_PRIORITY_SCHEDULING
in <unistd.h>.
.SH "RETURN VALUE"
On success,
.BR sched_yield ()
@ -59,7 +58,6 @@ returns 0.
On error, \-1 is returned, and
.I errno
is set appropriately.
.SH "CONFORMING TO"
POSIX.1-2001.
.SH "SEE ALSO"

View File

@ -58,7 +58,7 @@ synchronous I/O multiplexing
.sp
.BI "void FD_CLR(int " fd ", fd_set *" set );
.br
.BI "int FD_ISSET(int " fd ", fd_set *" set );
.BI "int FD_ISSET(int " fd ", fd_set *" set );
.br
.BI "void FD_SET(int " fd ", fd_set *" set );
.br

View File

@ -40,16 +40,12 @@ semop, semtimedop \- semaphore operations
#include <sys/ipc.h>
.B
#include <sys/sem.h>
.sp
.BI "int semop(int " semid ", struct sembuf *" sops ", unsigned " nsops );
.sp
.BI "int semtimedop(int " semid ", struct sembuf *" sops ", unsigned " nsops ,
.BI " struct timespec *" timeout );
.fi
.sp
.BI "int semop(int " semid ,
.BI "struct sembuf *" sops ,
.BI "unsigned " nsops );
.sp
.BI "int semtimedop(int " semid ,
.BI "struct sembuf *" sops ,
.BI "unsigned " nsops ,
.BI "struct timespec *" timeout );
.SH DESCRIPTION
Each semaphore in a semaphore set has the following associated values:
.sp

View File

@ -39,18 +39,20 @@
.SH NAME
send, sendto, sendmsg \- send a message on a socket
.SH SYNOPSIS
.nf
.B #include <sys/types.h>
.br
.B #include <sys/socket.h>
.sp
.BI "ssize_t send(int " s ", const void *" buf ", size_t " len ,
.BI "int " flags );
.BI "ssize_t send(int " s ", const void *" buf ", size_t " len \
", int " flags );
.br
.BI "ssize_t sendto(int " s ", const void *" buf ", size_t " len ,
.BI "int " flags ", const struct sockaddr *" to ", socklen_t " tolen );
.BI "ssize_t sendto(int " s ", const void *" buf ", size_t " len \
", int " flags ,
.BI " const struct sockaddr *" to ", socklen_t " tolen );
.br
.BI "ssize_t sendmsg(int " s ", const struct msghdr *" msg ,
.BI "int " flags );
.BI "ssize_t sendmsg(int " s ", const struct msghdr *" msg \
", int " flags );
.fi
.SH DESCRIPTION
The system calls
.BR send (),

View File

@ -21,13 +21,14 @@
.\"
.TH SET_MEMPOLICY 2 "2006-02-07" "SuSE Labs" "Linux Programmer's Manual"
.SH NAME
set_mempolicy \- Set default NUMA memory policy for a process and its children.
set_mempolicy \- set default NUMA memory policy for a process and its children.
.SH SYNOPSIS
.nf
.B "#include <numaif.h>"
.sp
.BI "int set_mempolicy(int " policy ", unsigned long *" nodemask ,
.BI "unsigned long " maxnode );
.sp
.BI " unsigned long " maxnode );
.fi
.SH DESCRIPTION
.BR set_mempolicy ()
sets the NUMA memory policy of the calling process to

View File

@ -39,7 +39,6 @@ shmget \- allocates a shared memory segment
.SH SYNOPSIS
.ad l
.B #include <sys/ipc.h>
.sp
.B #include <sys/shm.h>
.sp
.BI "int shmget(key_t " key ", size_t " size ", int " shmflg );

View File

@ -44,10 +44,12 @@
.SH NAME
sigaction \- examine and change a signal action
.SH SYNOPSIS
.nf
.B #include <signal.h>
.sp
.BI "int sigaction(int " signum ", const struct sigaction *" act ,
.BI "struct sigaction *" oldact );
.BI " struct sigaction *" oldact );
.fi
.SH DESCRIPTION
The
.BR sigaction ()
@ -78,11 +80,11 @@ structure is defined as something like
.RS
.nf
struct sigaction {
void (*sa_handler)(int);
void (*sa_sigaction)(int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
void (*sa_restorer)(void);
void (*sa_handler)(int);
void (*sa_sigaction)(int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
void (*sa_restorer)(void);
}
.fi
.RE

View File

@ -23,46 +23,48 @@ Until Linux 2.3.16,
.BR sysinfo ()
used to return information in the following structure:
.RS
.nf
.in +0.25i
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
char _f[22]; /* Pads structure to 64 bytes */
};
.in -0.25i
.fi
.RE
.PP
and the sizes were given in bytes.
and the sizes were given in bytes. Since Linux 2.3.23 (i386), 2.3.48
(all architectures) the structure is
Since Linux 2.3.23 (i386), 2.3.48
(all architectures) the structure is:
.RS
.nf
.in +0.25i
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20\-2*sizeof(long)\-sizeof(int)]; /* Padding for libc5 */
};
.in -0.25i
.fi
.RE
.PP
and the sizes are given as multiples of \fImem_unit\fP bytes.
.BR sysinfo ()

View File

@ -35,24 +35,22 @@ The
.I utsname
struct is defined in
.IR <sys/utsname.h> :
.RS
.in +0.5i
.nf
struct utsname {
.in +8
char sysname[];
char nodename[];
char release[];
char version[];
char machine[];
.in -8
char sysname[];
char nodename[];
char release[];
char version[];
char machine[];
#ifdef _GNU_SOURCE
.in +8
char domainname[];
.in -8
char domainname[];
#endif
};
.fi
.RE
.in -0.5i
The length of the arrays in a
.I struct utsname
is unspecified; the fields are terminated by a null byte (''\0').

View File

@ -38,7 +38,7 @@ utime, utimes \- change access and/or modification times of an inode
.B #include <utime.h>
.sp
.BI "int utime(const char *" filename ", const struct utimbuf *" buf );
.sp 2
.sp
.B #include <sys/time.h>
.sp
.BI "int utimes(const char *" filename ", const struct timeval " times [2]);

View File

@ -44,10 +44,10 @@ wait3, wait4 \- wait for process to change state, BSD style
.B #include <sys/wait.h>
.sp
.BI "pid_t wait3(int *" "status" ", int " options ,
.BI " struct rusage *" rusage );
.BI " struct rusage *" rusage );
.sp
.BI "pid_t wait4(pid_t " pid ", int *" status ", int " options ,
.BI " struct rusage *" rusage );
.BI " struct rusage *" rusage );
.fi
.SH DESCRIPTION
The