mirror of https://github.com/mkerrisk/man-pages
CPU_SET.3: Add description of CPU_AND(), CPU_OR, CPU_XOR(), and CPU_EQUAL()
Plus a few other small clean-ups of the text Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
df79be827a
commit
94934ae71c
|
@ -24,7 +24,8 @@
|
|||
.\"
|
||||
.TH CPU_SET 2 2008-11-12 "Linux" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT \-
|
||||
CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT,
|
||||
CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL \-
|
||||
macros for manipulating CPU sets
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
|
@ -32,14 +33,21 @@ macros for manipulating CPU sets
|
|||
.B #include <sched.h>
|
||||
.sp
|
||||
.BI "void CPU_ZERO(cpu_set_t *" set );
|
||||
.br
|
||||
.sp
|
||||
.BI "void CPU_SET(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.BI "void CPU_CLR(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.BI "int CPU_ISSET(int " cpu ", cpu_set_t *" set );
|
||||
.br
|
||||
.sp
|
||||
.BI "void CPU_COUNT(cpu_set_t *" set );
|
||||
.sp
|
||||
.BI "void CPU_AND(cpu_set_t *" destset ,
|
||||
.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 );
|
||||
.BI "void CPU_OR(cpu_set_t *" destset ,
|
||||
.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 );
|
||||
.BI "void CPU_XOR(cpu_set_t *" destset ,
|
||||
.BI " cpu_set_t *" srcset1 ", cpu_set_t *" srcset2 );
|
||||
.sp
|
||||
.BI "int CPU_EQUAL(cpu_set_t *" set1 ", cpu_set_t *" set2 );
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
The
|
||||
|
@ -53,30 +61,30 @@ The following macros are provided to operate on the CPU set
|
|||
.IR set :
|
||||
.TP 16
|
||||
.BR CPU_ZERO ()
|
||||
clears
|
||||
.I set
|
||||
Clears
|
||||
.IR set ,
|
||||
so that it contains no CPUs.
|
||||
.TP
|
||||
.BR CPU_SET ()
|
||||
adds CPU
|
||||
Add CPU
|
||||
.I cpu
|
||||
to
|
||||
.IR set .
|
||||
.TP
|
||||
.BR CPU_CLR ()
|
||||
removes CPU
|
||||
Remove CPU
|
||||
.I cpu
|
||||
from
|
||||
.IR set .
|
||||
.TP
|
||||
.BR CPU_ISSET ()
|
||||
tests to see if CPU
|
||||
Test to see if CPU
|
||||
.I cpu
|
||||
is a member of
|
||||
.IR set .
|
||||
.TP
|
||||
.BR CPU_COUNT ()
|
||||
returns the number of CPUs in
|
||||
Return the number of CPUs in
|
||||
.IR set .
|
||||
.PP
|
||||
Where a
|
||||
|
@ -93,6 +101,38 @@ The constant
|
|||
.B CPU_SETSIZE
|
||||
(currently 1024) specifies a value one greater than the maximum CPU
|
||||
number that can be stored in a CPU set.
|
||||
|
||||
The following macros perform logical operations on SPU sets:
|
||||
.TP 16
|
||||
.BR CPU_AND ()
|
||||
Store the logical AND of the sets
|
||||
.I srcset1
|
||||
and
|
||||
.I srcset2
|
||||
in
|
||||
.I destset
|
||||
(which may be one of the source sets).
|
||||
.TP
|
||||
.BR CPU_OR ()
|
||||
Store the logical OR of the sets
|
||||
.I srcset1
|
||||
and
|
||||
.I srcset2
|
||||
in
|
||||
.I destset
|
||||
(which may be one of the source sets).
|
||||
.TP
|
||||
.BR CPU_XOR ()
|
||||
Store the logical XOR of the sets
|
||||
.I srcset1
|
||||
and
|
||||
.I srcset2
|
||||
in
|
||||
.I destset
|
||||
(which may be one of the source sets).
|
||||
.TP
|
||||
.BR CPU_EQUAL ()
|
||||
Tests whether two CPU set contain the same CPUs.
|
||||
.SH "RETURN VALUE"
|
||||
.BR CPU_ISSET ()
|
||||
returns non-zero if
|
||||
|
@ -105,6 +145,9 @@ otherwise, it returns 0.
|
|||
returns the number of CPUs in
|
||||
.IR set .
|
||||
|
||||
.BR CPU_EQUAL ()
|
||||
returns non-zero if the two CPU sets are equal; otherwise it returns 0.
|
||||
|
||||
The other functions do not return a value.
|
||||
.\" .SH ERRORS
|
||||
.\" AFAICT, no E* errors are occur.
|
||||
|
@ -119,6 +162,13 @@ macros were added in glibc 2.3.3.
|
|||
|
||||
.BR CPU_COUNT ()
|
||||
first appeared in glibc 2.6.
|
||||
|
||||
.BR CPU_AND (),
|
||||
.BR CPU_OR (),
|
||||
.BR CPU_XOR (),
|
||||
and
|
||||
.BR CPU_EQUAL ()
|
||||
first appeared in glibc 2.7.
|
||||
.SH "CONFORMING TO"
|
||||
These interfaces are Linux-specific.
|
||||
.SH "SEE ALSO"
|
||||
|
|
Loading…
Reference in New Issue