From c12fd10dcb84885a2db43940a19683f8de03fb63 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 26 May 2007 15:22:28 +0000 Subject: [PATCH] Update these pages to reflect the fact that the _syscallN() macros have gone away. --- man2/clone.2 | 2 +- man2/getdents.2 | 8 +++---- man2/gettid.2 | 14 ++++------- man2/ioprio_set.2 | 13 ++++------- man2/llseek.2 | 13 ++++------- man2/mmap2.2 | 13 ++++------- man2/modify_ldt.2 | 13 ++++------- man2/mq_getsetattr.2 | 14 +++++------ man2/pivot_root.2 | 12 ++++------ man2/quotactl.2 | 9 +------- man2/readdir.2 | 11 ++++----- man2/sysctl.2 | 55 ++++++++++++++++++++++---------------------- man2/syslog.2 | 22 +++++------------- man2/tkill.2 | 21 +++++------------ 14 files changed, 82 insertions(+), 138 deletions(-) diff --git a/man2/clone.2 b/man2/clone.2 index 6b56be275..f2d0847c3 100644 --- a/man2/clone.2 +++ b/man2/clone.2 @@ -32,7 +32,7 @@ .\" 2005-05-10, mtk, added CLONE_SYSVSEM, CLONE_UNTRACED, CLONE_STOPPED. .\" 2005-05-17, mtk, Substantially enhanced discussion of CLONE_THREAD. .\" -.TH CLONE 2 2005-05-17 "Linux 2.6" "Linux Programmer's Manual" +.TH CLONE 2 2007-06-01 "Linux 2.6" "Linux Programmer's Manual" .SH NAME clone \- create a child process .SH SYNOPSIS diff --git a/man2/getdents.2 b/man2/getdents.2 index 05a4e7c63..44bb16152 100644 --- a/man2/getdents.2 +++ b/man2/getdents.2 @@ -24,7 +24,7 @@ .\" Modified 22 July 1995 by Michael Chastain : .\" Derived from 'readdir.2'. .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond -.TH GETDENTS 2 1995-07-22 "Linux 1.3.6" "Linux Programmer's Manual" +.TH GETDENTS 2 2007-06-01 "Linux 1.3.6" "Linux Programmer's Manual" .SH NAME getdents \- get directory entries .SH SYNOPSIS @@ -35,9 +35,6 @@ getdents \- get directory entries .B #include .B #include .sp -.B _syscall3(int, getdents, uint, fd, struct dirent *, dirp, uint, count) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp .BI "int getdents(unsigned int " fd ", struct dirent *" dirp ", unsigned int " count ); .fi .SH DESCRIPTION @@ -114,6 +111,9 @@ File descriptor does not refer to a directory. .SH "CONFORMING TO" SVr4. .\" SVr4 documents additional ENOLINK, EIO error conditions. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR readdir (2), .BR readdir (3) diff --git a/man2/gettid.2 b/man2/gettid.2 index b871d34ee..8445ae729 100644 --- a/man2/gettid.2 +++ b/man2/gettid.2 @@ -21,22 +21,15 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH GETTID 2 2003-02-01 "Linux 2.4.20" "Linux Programmer's Manual" +.TH GETTID 2 2007-06-01 "Linux 2.4.20" "Linux Programmer's Manual" .SH NAME gettid \- get thread identification .SH SYNOPSIS .nf .B #include -.br -.B #include -.br -.B #include .sp -.B _syscall0(pid_t, gettid) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp -.fi .B pid_t gettid(void); +.fi .SH DESCRIPTION .BR gettid () returns the thread ID of the current process. @@ -57,6 +50,9 @@ This call is always successful. .BR gettid () is Linux specific and should not be used in programs that are intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR clone (2), .BR fork (2), diff --git a/man2/ioprio_set.2 b/man2/ioprio_set.2 index fc006706f..4bbc23541 100644 --- a/man2/ioprio_set.2 +++ b/man2/ioprio_set.2 @@ -22,19 +22,11 @@ .\" with various additions by Michael Kerrisk .\" .\" -.TH IOPRIO_GET 2 2006-04-27 "Linux" "Linux Programmer's Manual" +.TH IOPRIO_GET 2 2007-06-01 "Linux" "Linux Programmer's Manual" .SH NAME ioprio_get, ioprio_set \- get/set I/O scheduling class and priority .SH SYNOPSIS .nf -.B #include -.B #include -.sp -.B _syscall2(int, ioprio_get, int, which, int, who); -.B _syscall3(int, ioprio_set, int, which, int, who, int, ioprio); -.RB " /* Using " syscall "(2) might be preferable; see " intro \ -"(2) */" -.sp .BI "int ioprio_get(int " which ", int " who ); .BI "int ioprio_set(int " which ", int " who ", int " ioprio ); .fi @@ -192,6 +184,9 @@ kernel 2.6.13. .SH "CONFORMING TO" These system calls are Linux specific. .SH NOTES +Glibc does not provide wrapper for these system calls; call them using +.BR syscall (2). + These system calls only have an effect when used in conjunction with an I/O scheduler that supports I/O priorities. As at kernel 2.6.17 the only such scheduler is the Completely Fair Queuing diff --git a/man2/llseek.2 b/man2/llseek.2 index 02354198a..cb1637fc3 100644 --- a/man2/llseek.2 +++ b/man2/llseek.2 @@ -23,19 +23,13 @@ .\" Written 10 June 1995 by Andries Brouwer .\" Modified Thu Oct 31 15:16:23 1996 by Eric S. Raymond .\" -.TH LLSEEK 2 1995-06-10 "Linux 1.2.9" "Linux Programmer's Manual" +.TH LLSEEK 2 2007-06-01 "Linux 1.2.9" "Linux Programmer's Manual" .SH NAME _llseek \- reposition read/write file offset .SH SYNOPSIS .nf -.B #include .B #include -.B #include -.B #include -.sp -.B _syscall5(int, _llseek, unsigned int, fd, unsigned long, hi, -.B " " unsigned long, lo, loff_t *, res, unsigned int, wh) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ +.B #include .sp .BI "int _llseek(unsigned int " fd ", unsigned long " offset_high , .BI " unsigned long " offset_low ", loff_t *" result , @@ -81,6 +75,9 @@ is invalid. .SH "CONFORMING TO" This function is Linux specific, and should not be used in programs intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR lseek (2), .BR lseek64 (3) diff --git a/man2/mmap2.2 b/man2/mmap2.2 index 2be801f1b..1c663c82d 100644 --- a/man2/mmap2.2 +++ b/man2/mmap2.2 @@ -26,20 +26,12 @@ .\" Added description of mmap2 .\" Modified, 2004-11-25, mtk -- removed stray #endif in prototype .\" -.TH MMAP2 2 2002-01-31 "Linux 2.3.31" "Linux Programmer's Manual" +.TH MMAP2 2 2007-06-01 "Linux 2.3.31" "Linux Programmer's Manual" .SH NAME mmap2 \- map files or devices into memory .SH SYNOPSIS .nf .B #include -.br -.B #include -.br -.B #include -.sp -.BI "_syscall6(void *, " mmap2 ", void *, " start ", size_t, " length , -.BI " int, " prot ", int, " flags ", int, " fd ", off_t, " pgoffset ) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ .sp .BI "void *mmap2(void *" start ", size_t " length ", int " prot , .BI " int " flags ", int " fd ", off_t " pgoffset ); @@ -71,6 +63,9 @@ data from userspace. .SH "CONFORMING TO" This system call is Linux specific. .SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). + .BR mmap2 () is available since Linux 2.3.31. It is Linux specific, and should be avoided in portable applications. diff --git a/man2/modify_ldt.2 b/man2/modify_ldt.2 index acc99c989..74eea350d 100644 --- a/man2/modify_ldt.2 +++ b/man2/modify_ldt.2 @@ -22,20 +22,12 @@ .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, .\" USA. .\" -.TH MODIFY_LDT 2 1995-07-22 "Linux 1.3.6" "Linux Programmer's Manual" +.TH MODIFY_LDT 2 2007-06-01 "Linux 1.3.6" "Linux Programmer's Manual" .SH NAME modify_ldt \- get or set ldt .SH SYNOPSIS .nf .B #include -.br -.B #include -.br -.B #include -.sp -.BI "_syscall3(int, modify_ldt, int, " func ", void *, " ptr , -.BI " unsigned long, " bytecount ) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ .sp .BI "int modify_ldt(int " "func" ", void *" "ptr" ", unsigned long " "bytecount" ); .fi @@ -106,5 +98,8 @@ is neither 0 nor 1. .SH "CONFORMING TO" This call is Linux specific and should not be used in programs intended to be portable. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR vm86 (2) diff --git a/man2/mq_getsetattr.2 b/man2/mq_getsetattr.2 index c0e4c8561..76199074c 100644 --- a/man2/mq_getsetattr.2 +++ b/man2/mq_getsetattr.2 @@ -20,20 +20,14 @@ .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" -.TH MQ_GETSETATTR 2 2006-05-14 "Linux 2.6.16" "Linux Programmer's Manual" +.TH MQ_GETSETATTR 2 2007-06-01 "Linux 2.6.16" "Linux Programmer's Manual" .SH NAME mq_getsetattr \- get/set message queue attributes .SH SYNOPSIS .nf .B #include -.br -.B #include -.br -.B #include +.B #include .sp -.B "_syscall3(mqd_t, mqdes, struct mq_attr *, newattr, -.B " struct mq_attr *, oldattr); - /* Or use \fBsyscall\fP(2); see \fBintro\fP(2) */ .BI "mqd_t mq_getsetattr(mqd_t " mqdes ", struct mq_attr *" newattr "," .BI " struct mq_attr *" oldattr ); .fi @@ -49,6 +43,10 @@ see the description of .BR mq_setattr (3). .SH CONFORMING TO This interface is non-standard; avoid its use. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). +(Actually, never call it unless you are writing a libc!) .SH "SEE ALSO" .BR mq_getattr (3), .BR mq_overview (7) diff --git a/man2/pivot_root.2 b/man2/pivot_root.2 index 3913dfbf7..ad4e7c115 100644 --- a/man2/pivot_root.2 +++ b/man2/pivot_root.2 @@ -4,17 +4,10 @@ .\" Written 2000-02-23 by Werner Almesberger .\" Modified 2004-06-17 Michael Kerrisk .\" -.TH PIVOT_ROOT 2 2004-06-17 "Linux 2.6.7" "Linux Programmer's Manual" +.TH PIVOT_ROOT 2 2007-06-01 "Linux 2.6.7" "Linux Programmer's Manual" .SH NAME pivot_root \- change the root file system .SH SYNOPSIS -.B #include -.br -.B #include -.sp -.B _syscall2(int,pivot_root,const char *,new_root,const char *,put_old) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp .BI "int pivot_root(const char *" new_root ", const char *" put_old ); .SH DESCRIPTION .BR pivot_root () @@ -137,6 +130,9 @@ Some of the more obscure uses of .BR pivot_root () may quickly lead to insanity. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR chdir (2), .BR chroot (2), diff --git a/man2/quotactl.2 b/man2/quotactl.2 index b5b3b3000..4897e332a 100644 --- a/man2/quotactl.2 +++ b/man2/quotactl.2 @@ -75,7 +75,7 @@ .\" Q_XQUOTASYNC .\" Q_XSETQLIM .\" -.TH QUOTACTL 2 1996-04-14 "Linux 1.3.88" "Linux Programmer's Manual" +.TH QUOTACTL 2 2007-06-01 "Linux 1.3.88" "Linux Programmer's Manual" .SH NAME quotactl \- manipulate disk quota .SH SYNOPSIS @@ -86,13 +86,6 @@ quotactl \- manipulate disk quota .sp .BI "int quotactl(int " cmd ", const char *" special ", int " id \ ", caddr_t " addr ); -.sp -.B #include -.B #include -.sp -.BI "_syscall4(int, quotactl, int, " cmd ", const char *, " special , -.BI " int, " id ", caddr_t, " addr ) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ .fi .SH DESCRIPTION The quota system defines for each user and/or group a soft limit diff --git a/man2/readdir.2 b/man2/readdir.2 index b6e4f4e9b..8a0b9d2e1 100644 --- a/man2/readdir.2 +++ b/man2/readdir.2 @@ -25,19 +25,13 @@ .\" In 1.3.X, returns only one entry each time; return value is different. .\" Modified 2004-12-01, mtk, fixed headers listed in SYNOPSIS .\" -.TH READDIR 2 1995-07-22 "Linux 1.3.6" "Linux Programmer's Manual" +.TH READDIR 2 2007-06-01 "Linux 1.3.6" "Linux Programmer's Manual" .SH NAME readdir \- read directory entry .SH SYNOPSIS .nf .B #include .B #include -.B #include -.B #include -.sp -.B _syscall3(int, readdir, unsigned int, fd, struct dirent *, dirp, -.B " unsigned int, count)" - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ .sp .BI "int readdir(unsigned int " fd ", struct dirent *" dirp "," .BI " unsigned int " count ); @@ -115,6 +109,9 @@ No such directory. File descriptor does not refer to a directory. .SH "CONFORMING TO" This system call is Linux specific. +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR getdents (2), .BR readdir (3) diff --git a/man2/sysctl.2 b/man2/sysctl.2 index 51f7ada21..e2cfb1b3a 100644 --- a/man2/sysctl.2 +++ b/man2/sysctl.2 @@ -25,21 +25,14 @@ .\" Modified Tue Oct 22 22:28:41 1996 by Eric S. Raymond .\" Modified Mon Jan 5 20:31:04 1998 by aeb. .\" -.TH SYSCTL 2 1996-04-11 "Linux 1.3.85" "Linux Programmer's Manual" +.TH SYSCTL 2 2007-06-01 "Linux 1.3.85" "Linux Programmer's Manual" .SH NAME sysctl \- read/write system parameters .SH SYNOPSIS .nf .B #include .br -.B #include -.br .B #include -.br -.B #include -.sp -.B _syscall1(int, _sysctl, struct __sysctl_args *, args) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ .sp .BI "int _sysctl(struct __sysctl_args *" args ); .fi @@ -123,36 +116,44 @@ It is not yet possible to change operating system by writing to .IR /proc/sys/kernel/ostype . .SH EXAMPLE .nf -#include -#include +#define _GNU_SOURCE +#include +#include +#include +#include +#include #include -_syscall1(int, _sysctl, struct __sysctl_args *, args); -int sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, - void *newval, size_t newlen) -{ - struct __sysctl_args args = { name, nlen, oldval, oldlenp, - newval, newlen }; - return _sysctl(&args); -} +int _sysctl(struct __sysctl_args *args ); -#define SIZE(x) sizeof(x)/sizeof(x[0]) #define OSNAMESZ 100 -char osname[OSNAMESZ]; -int osnamelth; -int name[] = { CTL_KERN, KERN_OSTYPE }; - int main(void) { + struct __sysctl_args args; + char osname[OSNAMESZ]; + size_t osnamelth; + int name[] = { CTL_KERN, KERN_OSTYPE }; + + memset(&args, 0, sizeof(struct __sysctl_args)); + args.name = name; + args.nlen = sizeof(name)/sizeof(name[0]); + args.oldval = osname; + args.oldlenp = &osnamelth; + osnamelth = sizeof(osname); - if (sysctl(name, SIZE(name), osname, &osnamelth, 0, 0)) - perror("sysctl"); - else - printf("This machine is running %*s\en", osnamelth, osname); + + if (syscall(SYS__sysctl, &args) == -1) { + perror("_sysctl"); + exit(EXIT_FAILURE); + } + printf("This machine is running %*s\n", osnamelth, osname); exit(EXIT_SUCCESS); } .fi +.SH NOTES +Glibc does not provide a wrapper for this system call; call it using +.BR syscall (2). .SH "SEE ALSO" .BR proc (5) diff --git a/man2/syslog.2 b/man2/syslog.2 index 24a80e203..16431c120 100644 --- a/man2/syslog.2 +++ b/man2/syslog.2 @@ -21,35 +21,25 @@ .\" the source, must acknowledge the copyright and authors of this work. .\" .\" Written 11 June 1995 by Andries Brouwer -.TH SYSLOG 2 2001-11-25 "Linux 1.2.9" "Linux Programmer's Manual" +.TH SYSLOG 2 2007-06-01 "Linux 1.2.9" "Linux Programmer's Manual" .SH NAME syslog, klogctl \- read and/or clear kernel message ring buffer; set console_loglevel .SH SYNOPSIS .nf +.BI "int syslog(int " type ", char *" bufp ", int " len ); +.B " /* No wrapper provided in glibc */ +.sp /* The glibc interface */ .br .B "#include " .sp .BI "int klogctl(int " type ", char *" bufp ", int " len ); -.sp -/* The handcrafted system call */ -.br -.B #include -.br -.B #include -.br -.B #include -.sp -.B _syscall3(int, syslog, int, type, char *, bufp, int, len) - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp -.BI "int syslog(int " type ", char *" bufp ", int " len ); .fi .SH DESCRIPTION If you need the libc function -.BR syslog (), -(that talks to +.BR syslog () +(which talks to .BR syslogd (8)), then look at .BR syslog (3). diff --git a/man2/tkill.2 b/man2/tkill.2 index 783807e7d..eaa82d286 100644 --- a/man2/tkill.2 +++ b/man2/tkill.2 @@ -23,26 +23,14 @@ .\" .\" 2004-05-31, added tgkill, ahu, aeb .\" -.TH TKILL 2 2004-05-31 "Linux 2.6.6" "Linux Programmer's Manual" +.TH TKILL 2 2007-06-01 "Linux 2.6.6" "Linux Programmer's Manual" .SH NAME tkill, tgkill \- send a signal to a single process .SH SYNOPSIS .nf -.B #include -.br -.B #include -.br -.B #include +.BI "int tkill(int " tid ", int " sig ); .sp -.B "_syscall2(int, tkill, int, tid, int, sig)" - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp -.B int tkill(int tid, int sig); -.sp -.B "_syscall3(int, tgkill, int, tgid, int, tid, int, sig)" - /* Using \fBsyscall\fP(2) may be preferable; see \fBintro\fP(2) */ -.sp -.B int tgkill(int tgid, int tid, int sig); +.BI "int tgkill(int " tgid ", int " tid ", int " sig ); .fi .SH DESCRIPTION The @@ -101,6 +89,9 @@ and .BR tgkill () are Linux specific and should not be used in programs that are intended to be portable. +.SH NOTES +Glibc does not provide wrapper for these system calls; call them using +.BR syscall (2). .SH "SEE ALSO" .BR gettid (2), .BR kill (2)