xref: /freebsd/lib/libutil/cpuset.3 (revision 5e3190f700637fcfc1a52daeaa4a031fdd2557c7)
1.\" Copyright (c) 2017 Baptiste Daroussin <bapt@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd October 31, 2017
26.Dt CPUSET 3
27.Os
28.Sh NAME
29.Nm cpuset_parselist
30.Nd utility functions for
31.Xr cpuset 2
32handling
33.Sh LIBRARY
34.Lb libutil
35.Sh SYNOPSIS
36.In sys/cpuset.h
37.In libutil.h
38.Ft int
39.Fn cpuset_parselist "const char *cpu-list" "cpuset_t *mask"
40.Sh DESCRIPTION
41The
42.Fn cpuset_parselist
43function parses a
44.Va cpu-list
45filling the
46.Va mask .
47.Pp
48The
49.Va cpu-list
50may include numbers separated by '-' for ranges and commas separating individual
51numbers.
52A special list of
53.Dq all
54may be specified in which case the list includes all CPUs from the root set.
55.Sh RETURN VALUES
56Return values can be the following
57.Bl -tag -width Er
58.It Dv CPUSET_PARSE_OK
59The parsing was successful
60.It Dv CPUSET_PARSE_ERROR
61The
62.Va cpu-list
63format is invalid
64.It Dv CPUSET_PARSE_GETAFFINITY
65The
66.Xr cpuset_getaffinity 2
67call has failed
68.It Dv CPUSET_PARSE_INVALID_CPU
69The number of supported CPUs has been exceeded.
70The maximum number being
71.Va CPU_SETSIZE .
72.El
73.Sh SEE ALSO
74.Xr cpuset 1 ,
75.Xr cpuset 2 ,
76.Xr cpuset 9
77.Sh AUTHORS
78.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org
79