X-Git-Url: http://git.osdn.net/view?p=linuxjm%2FLDP_man-pages.git;a=blobdiff_plain;f=original%2Fman3%2Fpthread_setaffinity_np.3;h=624ec94278b39981e4468e2d0d86b2adf07a9c34;hp=6f3e488175ec3d5328075b3af64f6565d56b2617;hb=4ea6bb24817f6f049d6bbc90ecd77a869876f9b0;hpb=633a2252e0be3c867dce264a180a89ce8181d36f diff --git a/original/man3/pthread_setaffinity_np.3 b/original/man3/pthread_setaffinity_np.3 index 6f3e4881..624ec942 100644 --- a/original/man3/pthread_setaffinity_np.3 +++ b/original/man3/pthread_setaffinity_np.3 @@ -1,6 +1,7 @@ .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" +.\" %%%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. @@ -20,14 +21,15 @@ .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. +.\" %%%LICENSE_END .\" -.TH PTHREAD_SETAFFINITY_NP 3 2008-11-27 "Linux" "Linux Programmer's Manual" +.TH PTHREAD_SETAFFINITY_NP 3 2014-05-23 "Linux" "Linux Programmer's Manual" .SH NAME pthread_setaffinity_np, pthread_getaffinity_np \- set/get CPU affinity of a thread .SH SYNOPSIS .nf -.B #define _GNU_SOURCE +.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include .BI "int pthread_setaffinity_np(pthread_t " thread ", size_t " cpusetsize , @@ -36,6 +38,7 @@ CPU affinity of a thread .BI " cpu_set_t *" cpuset ); .sp Compile and link with \fI\-pthread\fP. +.fi .SH DESCRIPTION The .BR pthread_setaffinity_np () @@ -96,7 +99,7 @@ specified a CPU that was outside the set supported by the kernel. .BR CONFIG_NR_CPUS .\" FIXME . ? .\" Loic Domaigne commented: it seems that in the future the -.\" kernel developers want to make cpumask-t dynamic, so +.\" kernel developers want to make cpumask_t dynamic, so .\" CONFIG_NR_CPUS might become obsolete in the future. defines the range of the set supported by the kernel data type .\" cpumask_t @@ -115,6 +118,13 @@ No thread with the ID could be found. .SH VERSIONS These functions are provided by glibc since version 2.3.4. +.SH ATTRIBUTES +.SS Multithreading (see pthreads(7)) +The +.BR pthread_setaffinity_np () +and +.BR pthread_getaffinity_np () +functions are thread-safe. .SH CONFORMING TO These functions are nonstandard GNU extensions; hence the suffix "_np" (nonportable) in the names. @@ -146,7 +156,7 @@ Instead the CPU set size given to the underlying system calls was always .IR sizeof(cpu_set_t) . A new thread created by -.BR pthread_create () +.BR pthread_create (3) inherits a copy of its creator's CPU affinity mask. .SH EXAMPLE In the following program, the main thread uses @@ -201,10 +211,19 @@ main(int argc, char *argv[]) } .fi .SH SEE ALSO -.BR sched_getcpu (3), .BR sched_setaffinity (2), -.BR sched_setscheduler (2), .BR pthread_attr_setaffinity_np (3), .BR pthread_self (3), +.BR sched_getcpu (3), .BR cpuset (7), -.BR pthreads (7) +.BR pthreads (7), +.BR sched (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/.