sched_setattr.2: Use syscall(SYS_...); for system calls without a wrapper

Document also why each header is required

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-05-15 20:20:28 +02:00 committed by Michael Kerrisk
parent d4d006687d
commit 65dfda3dd1
1 changed files with 10 additions and 6 deletions

View File

@ -29,17 +29,21 @@ sched_setattr, sched_getattr \-
set and get scheduling policy and attributes set and get scheduling policy and attributes
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sched.h> .BR "#include <sched.h>" " /* Definition of " SCHED_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP .PP
.BI "int sched_setattr(pid_t " pid ", struct sched_attr *" attr , .BI "int syscall(SYS_sched_setattr, pid_t " pid ", struct sched_attr *" attr ,
.BI " unsigned int " flags ); .BI " unsigned int " flags );
.BI "int sched_getattr(pid_t " pid ", struct sched_attr *" attr , .BI "int syscall(SYS_sched_getattr, pid_t " pid ", struct sched_attr *" attr ,
.BI " unsigned int " size ", unsigned int " flags ); .BI " unsigned int " size ", unsigned int " flags );
.fi .fi
.\" FIXME . Add feature test macro requirements .\" FIXME . Add feature test macro requirements
.PP .PP
.IR Note : .IR Note :
There are no glibc wrappers for these system calls; see NOTES. glibc provides no wrappers for these system calls,
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION .SH DESCRIPTION
.SS sched_setattr() .SS sched_setattr()
The The