.\" and Copyright (C) 2008 Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" 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.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH CPU_SET 3 2010-09-10 "Linux" "Linux Programmer's Manual"
+.TH CPU_SET 3 2012-03-15 "Linux" "Linux Programmer's Manual"
.SH NAME
CPU_SET, CPU_CLR, CPU_ISSET, CPU_ZERO, CPU_COUNT,
CPU_AND, CPU_OR, CPU_XOR, CPU_EQUAL,
The
.I cpu_set_t
-data type is implemented as a bitset.
+data type is implemented as a bit set.
However, the data structure treated as considered opaque:
all manipulation of CPU sets should be done via the macros
described in this page.
but operate on the dynamically allocated CPU set(s) whose size is
.I setsize
bytes.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
.BR CPU_ISSET ()
and
.BR CPU_ISSET_S ()
and
.BR CPU_EQUAL_S ()
first appeared in glibc 2.7.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
These interfaces are Linux-specific.
.SH NOTES
To duplicate a CPU set, use
.BR memcpy (3).
-Since CPU sets are bitsets allocated in units of long words,
+Since CPU sets are bit sets allocated in units of long words,
the actual number of CPUs in a dynamically
allocated CPU set will be rounded up to the next multiple of
.IR "sizeof(unsigned long)" .
.B CPU_SETSIZE
indicates the number of CPUs in the
.I cpu_set_t
-data type (thus, it is effectively a count of bits in the bitset),
+data type (thus, it is effectively a count of bits in the bit set),
while the
.I setsize
argument of the
However, since these interfaces are implemented as macros,
the compiler won't necessarily catch all type errors
if you violate the suggestions.
+.SH BUGS
+On 32-bit platforms with glibc 2.8 and earlier,
+.BR CPU_ALLOC ()
+allocates twice as much space as is required, and
+.BR CPU_ALLOC_SIZE ()
+returns a value twice as large as it should.
+This bug should not affect the semantics of a program,
+but does result in wasted memory
+and less efficient operation of the macros that
+operate on dynamically allocated CPU sets.
+These bugs are fixed in glibc 2.9.
+.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7029
.SH EXAMPLE
The following program demonstrates the use of some of the macros
used for dynamically allocated CPU sets.
exit(EXIT_SUCCESS);
}
.fi
-.SH BUGS
-On 32-bit platforms with glibc 2.8 and earlier,
-.BR CPU_ALLOC ()
-allocates twice as much space as is required, and
-.BR CPU_ALLOC_SIZE ()
-returns a value twice as large as it should.
-This bug should not affect the semantics of a program,
-but does result in wasted memory
-and less efficient operation of the macros that
-operate on dynamically allocated CPU sets.
-These bugs are fixed in glibc 2.9.
-.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7029
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR sched_setaffinity (2),
.BR pthread_attr_setaffinity_np (3),
.BR pthread_setaffinity_np (3),
.BR cpuset (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.