mirror of https://github.com/mkerrisk/man-pages
Conver to -man format; some rewrites; added an EXAMPLE.
This commit is contained in:
parent
248e047e8c
commit
c046a64128
|
@ -35,34 +35,47 @@
|
|||
.\" 2002-03-20 Christoph Hellwig <hch@infradead.org>
|
||||
.\" - adopted for Linux
|
||||
.\"
|
||||
.Dd June 16, 1993
|
||||
.Dt SYSCALL 2
|
||||
.Os 4BSD
|
||||
.Sh NAME
|
||||
.Nm syscall
|
||||
.Nd indirect system call
|
||||
.Sh SYNOPSIS
|
||||
.Fd #include <sys/syscall.h>
|
||||
.Fd #include <unistd.h>
|
||||
.Ft int
|
||||
.Fn syscall "int number" "..."
|
||||
.Sh DESCRIPTION
|
||||
.Fn Syscall
|
||||
.TH SYSCALL 2 2007-06-01 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
syscall \- indirect system call
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B "#define _BSD_SOURCE /* or _GNU_SOURCE or _SVID_SOURCE */"
|
||||
.B #include <unistd.h>
|
||||
.B "#include <sys/syscall.h> /* For SYS_xxx definitons */"
|
||||
|
||||
.BI "int syscall(int " number ", ...);"
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
.BR syscall ()
|
||||
performs the system call whose assembly language
|
||||
interface has the specified
|
||||
.Fa number
|
||||
.I number
|
||||
with the specified arguments.
|
||||
Symbolic constants for system calls can be found in the header file
|
||||
.Ao Pa sys/syscall.h Ac .
|
||||
.Sh RETURN VALUE
|
||||
.IR <sys/syscall.h> .
|
||||
.SH RETURN VALUE
|
||||
The return value is defined by the system call being invoked.
|
||||
In general, a 0 return value indicates success.
|
||||
A \-1 return value indicates an error,
|
||||
and an error code is stored in
|
||||
.Va errno .
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn syscall
|
||||
function call appeared in
|
||||
.Bx 4.0 .
|
||||
.\" dummy comment without newline
|
||||
.IR errno .
|
||||
.SH NOTES
|
||||
.BR syscall ()
|
||||
first appeared in
|
||||
4BSD.
|
||||
.SH EXAMPLE
|
||||
|
||||
.nf
|
||||
#define _GNU_SOURCE
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
pid_t tid;
|
||||
tid = (long) syscall(SYS_gettid);
|
||||
}
|
||||
.fi
|
||||
|
|
Loading…
Reference in New Issue