mirror of https://github.com/mkerrisk/man-pages
CPU_SET.3: New page documenting CPU_* macros
This page contains material moved out of sched_setscheduler(2). It overwrites a previously existing link file with the same name. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
ad3f4748db
commit
a9cdb1db67
116
man3/CPU_SET.3
116
man3/CPU_SET.3
|
@ -1 +1,115 @@
|
|||
.so man2/sched_setaffinity.2
|
||||
.\" Copyright (C) 2006 Michael Kerrisk
|
||||
.\" and Copyright (C) 2008 Linux Foundation, written by Michael Kerrisk
|
||||
.\" <mtk.manpages@gmail.com>
|
||||
.\"
|
||||
.\" Permission is granted to make and distribute verbatim copies of this
|
||||
.\" manual provided the copyright notice and this permission notice are
|
||||
.\" preserved on all copies.
|
||||
.\"
|
||||
.\" Permission is granted to copy and distribute modified versions of this
|
||||
.\" manual under the conditions for verbatim copying, provided that the
|
||||
.\" entire resulting derived work is distributed under the terms of a
|
||||
.\" permission notice identical to this one.
|
||||
.\"
|
||||
.\" Since the Linux kernel and libraries are constantly changing, this
|
||||
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
||||
.\" responsibility for errors or omissions, or for damages resulting from
|
||||
.\" the use of the information contained herein. The author(s) may not
|
||||
.\" have taken the same level of care in the production of this manual,
|
||||
.\" which is licensed free of charge, as they might when working
|
||||
.\" professionally.
|
||||
.\"
|
||||
.\" Formatted or processed versions of this manual, if unaccompanied by
|
||||
.\" the source, must acknowledge the copyright and authors of this work.
|
||||
.\"
|
||||
.TH CPU_SET 2 2008-11-12 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
CPU_CLR, CPU_ISSET, CPU_SET, CPU_ZERO \-
|
||||
macros for manipulating CPU sets
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #define _GNU_SOURCE
|
||||
.B #include <sched.h>
|
||||
.sp
|
||||
.BI "void CPU_CLR(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.BI "int CPU_ISSET(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.BI "void CPU_SET(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.BI "void CPU_ZERO(cpu_set_t *" set );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
.I cpu_set_t
|
||||
data structure represents a set of CPUs.
|
||||
CPU sets are used by
|
||||
.BR sched_setaffinity (2)
|
||||
and similar interfaces.
|
||||
|
||||
The following macros are provided to operate on the CPU set
|
||||
.IR set :
|
||||
.TP 16
|
||||
.BR CPU_ZERO ()
|
||||
clears
|
||||
.I set
|
||||
so that it contains no CPUs.
|
||||
.TP
|
||||
.BR CPU_SET ()
|
||||
adds CPU
|
||||
.I cpu
|
||||
to
|
||||
.IR set .
|
||||
.TP
|
||||
.BR CPU_CLR ()
|
||||
removes CPU
|
||||
.I cpu
|
||||
from
|
||||
.IR set .
|
||||
.TP
|
||||
.BR CPU_ISSET ()
|
||||
tests to see if CPU
|
||||
.I cpu
|
||||
is a member of
|
||||
.IR set .
|
||||
.PP
|
||||
Where a
|
||||
.I cpu
|
||||
argument is specified, it should not produce side effects,
|
||||
since the above macros may evaluate the argument more than once.
|
||||
.PP
|
||||
The first available CPU on the system corresponds to a
|
||||
.I cpu
|
||||
value of 0, the next CPU corresponds to a
|
||||
.I cpu
|
||||
value of 1, and so on.
|
||||
The constant
|
||||
.B CPU_SETSIZE
|
||||
(1024) specifies a value one greater than the maximum CPU
|
||||
number that can be stored in a CPU set.
|
||||
.SH "RETURN VALUE"
|
||||
.BR CPU_ISSET ()
|
||||
returns non-zero if
|
||||
.I cpu
|
||||
is in
|
||||
.IR set ;
|
||||
otherwise, it returns 0.
|
||||
The other functions do not return a value.
|
||||
.\" .SH ERRORS
|
||||
.\" AFAICT, no E* errors are occur.
|
||||
.SH VERSIONS
|
||||
The
|
||||
.BR CPU_ZERO (),
|
||||
.BR CPU_CLR (),
|
||||
.BR CPU_SET (),
|
||||
and
|
||||
.BR CPU_ISSET ()
|
||||
macros were added in glibc 2.3.3.
|
||||
.SH "CONFORMING TO"
|
||||
These interfaces are Linux-specific.
|
||||
.SH "SEE ALSO"
|
||||
.BR sched_setaffinity (2),
|
||||
.BR CPU_SET (3),
|
||||
.BR pthread_attr_setaffinity_np (3),
|
||||
.BR pthread_setaffinity_np (3),
|
||||
.BR cpuset (7)
|
||||
|
|
Loading…
Reference in New Issue