[BACK]Return to cpuset.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Annotation of src/lib/libc/gen/cpuset.3, Revision 1.2.2.3

1.2.2.3 ! wrstuden    1: .\"    $NetBSD: cpuset.3,v 1.2.2.2 2008/06/23 05:02:09 wrstuden Exp $
1.2.2.2   wrstuden    2: .\"
                      3: .\" Copyright (c) 2008 The NetBSD Foundation, Inc.
                      4: .\" All rights reserved.
                      5: .\"
                      6: .\" This code is derived from software contributed to The NetBSD Foundation
                      7: .\" by Mindaugas Rasiukevicius <rmind at NetBSD org>.
                      8: .\"
                      9: .\" Redistribution and use in source and binary forms, with or without
                     10: .\" modification, are permitted provided that the following conditions
                     11: .\" are met:
                     12: .\" 1. Redistributions of source code must retain the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer.
                     14: .\" 2. Redistributions in binary form must reproduce the above copyright
                     15: .\"    notice, this list of conditions and the following disclaimer in the
                     16: .\"    documentation and/or other materials provided with the distribution.
                     17: .\"
                     18: .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
                     19: .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
                     20: .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
                     21: .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
                     22: .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     23: .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     24: .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     25: .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     26: .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     27: .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
                     28: .\" POSSIBILITY OF SUCH DAMAGE.
                     29: .\"
1.2.2.3 ! wrstuden   30: .Dd September 12, 2008
1.2.2.2   wrstuden   31: .Dt CPUSET 3
                     32: .Os
                     33: .Sh NAME
                     34: .Nm cpuset_create ,
                     35: .Nm cpuset_destroy ,
                     36: .Nm cpuset_zero ,
                     37: .Nm cpuset_set ,
                     38: .Nm cpuset_clr ,
                     39: .Nm cpuset_isset ,
                     40: .Nm cpuset_size
                     41: .Nd dynamic CPU sets
                     42: .Sh SYNOPSIS
                     43: .In sched.h
                     44: .Ft cpuset_t
                     45: .Fn cpuset_create "void"
                     46: .Ft void
                     47: .Fn cpuset_destroy "cpuset_t *set"
                     48: .Ft void
                     49: .Fn cpuset_zero "cpuset_t *set"
                     50: .Ft int
1.2.2.3 ! wrstuden   51: .Fn cpuset_set "cpuid_t cpu" "cpuset_t *set"
1.2.2.2   wrstuden   52: .Ft int
1.2.2.3 ! wrstuden   53: .Fn cpuset_clr "cpuid_t cpu" "cpuset_t *set"
1.2.2.2   wrstuden   54: .Ft int
1.2.2.3 ! wrstuden   55: .Fn cpuset_isset "cpuid_t cpu" "const cpuset_t *set"
1.2.2.2   wrstuden   56: .Ft size_t
                     57: .Fn cpuset_size "const cpuset_t *set"
                     58: .Sh DESCRIPTION
                     59: This section describes the functions used to create, set, use and destroy
                     60: the dynamic CPU sets.
                     61: .Pp
                     62: This API can be used with the POSIX threads, see
                     63: .Xr pthread 3
                     64: and
                     65: .Xr affinity 3 .
                     66: .Pp
                     67: The ID of the primary CPU in the system is 0.
                     68: .Sh FUNCTIONS
                     69: .Bl -tag -width compact
                     70: .It Fn cpuset_create
                     71: Allocates and initializes a clean CPU-set.
                     72: Returns the pointer to the CPU-set, or
                     73: .Dv NULL
                     74: on failure.
                     75: .It Fn cpuset_destroy set
                     76: Destroy the CPU-set specified by
                     77: .Fa set .
                     78: .It Fn cpuset_zero set
                     79: Makes the CPU-set specified by
                     80: .Fa set
                     81: clean, that is, memory is initialized to zero bytes, and none of
                     82: the CPUs set.
1.2.2.3 ! wrstuden   83: .It Fn cpuset_set cpu set
1.2.2.2   wrstuden   84: Sets the CPU specified by
                     85: .Fa cpu
                     86: in
                     87: .Fa set .
                     88: Returns zero on success, and \-1 if
                     89: .Fa cpu
                     90: is invalid.
1.2.2.3 ! wrstuden   91: .It Fn cpuset_clr cpu set
1.2.2.2   wrstuden   92: Clears the CPU specified by
                     93: .Fa cpu
                     94: in the CPU-set
                     95: .Fa set .
                     96: Returns zero on success, and \-1 if
                     97: .Fa cpu
                     98: is invalid.
1.2.2.3 ! wrstuden   99: .It Fn cpuset_isset cpu set
1.2.2.2   wrstuden  100: Checks if CPU specified by
                    101: .Fa cpu
                    102: is set in the CPU-set
                    103: .Fa set .
                    104: Returns the positive number if set, zero if not set, and \-1 if
                    105: .Fa cpu
                    106: is invalid.
                    107: .It Fn cpuset_size set
                    108: Returns the size in bytes of CPU-set specified by
                    109: .Fa set .
                    110: .El
                    111: .Sh SEE ALSO
                    112: .Xr affinity 3 ,
                    113: .Xr pset 3 ,
                    114: .Xr sched 3 ,
                    115: .Xr schedctl 8
                    116: .Sh HISTORY
                    117: The dynamic CPU sets appeared in
                    118: .Nx 5.0 .

CVSweb <webmaster@jp.NetBSD.org>