mirror of https://github.com/mkerrisk/man-pages
CPU_SET.3: Document CPU_ALLOC()/CPU_ALLOC_SIZE() bug
These macros return twice what they should because of thinko in glibc 2.8 and earlier. The bug is fixed for glibc 2.9. http://sourceware.org/bugzilla/show_bug.cgi?id=7029 Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
d69305f691
commit
b62e354822
|
@ -177,12 +177,6 @@ in the range 0 to
|
||||||
Return the size in bytes of the CPU set that would be needed to
|
Return the size in bytes of the CPU set that would be needed to
|
||||||
hold CPUs in the range 0 to
|
hold CPUs in the range 0 to
|
||||||
.IR num_cpus-1 .
|
.IR num_cpus-1 .
|
||||||
.\" FIXME . track this bug
|
|
||||||
.\" Currently (glibc 2.8), CPU_ALLOC_SIZE() returns double the
|
|
||||||
.\" value that it should. This also causes CPU_ALLOC() to allocate
|
|
||||||
.\" twice as much memory as is required.
|
|
||||||
.\" http://sourceware.org/bugzilla/show_bug.cgi?id=7029
|
|
||||||
.\" Eventually, write this up in BUGS.
|
|
||||||
This macro provides the value that can be used for
|
This macro provides the value that can be used for
|
||||||
.I setsize
|
.I setsize
|
||||||
in the
|
in the
|
||||||
|
@ -305,6 +299,17 @@ main(int argc, char *argv[])
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
.fi
|
.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.
|
||||||
|
The only consequences for most programs is wasted space,
|
||||||
|
and slightly 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 sched_setaffinity (2),
|
||||||
.BR pthread_attr_setaffinity_np (3),
|
.BR pthread_attr_setaffinity_np (3),
|
||||||
|
|
Loading…
Reference in New Issue