xref: /freebsd/lib/libutil/cpuset.3 (revision 7ef62cebc2f965b0f640263e179276928885e33d)
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.\" $FreeBSD$
26.\"
27.Dd October 31, 2017
28.Dt CPUSET 3
29.Os
30.Sh NAME
31.Nm cpuset_parselist
32.Nd utility functions for
33.Xr cpuset 2
34handling
35.Sh LIBRARY
36.Lb libutil
37.Sh SYNOPSIS
38.In sys/cpuset.h
39.In libutil.h
40.Ft int
41.Fn cpuset_parselist "const char *cpu-list" "cpuset_t *mask"
42.Sh DESCRIPTION
43The
44.Fn cpuset_parselist
45function parses a
46.Va cpu-list
47filling the
48.Va mask .
49.Pp
50The
51.Va cpu-list
52may include numbers separated by '-' for ranges and commas separating individual
53numbers.
54A special list of
55.Dq all
56may be specified in which case the list includes all CPUs from the root set.
57.Sh RETURN VALUES
58Return values can be the following
59.Bl -tag -width Er
60.It Dv CPUSET_PARSE_OK
61The parsing was successful
62.It Dv CPUSET_PARSE_ERROR
63The
64.Va cpu-list
65format is invalid
66.It Dv CPUSET_PARSE_GETAFFINITY
67The
68.Xr cpuset_getaffinity 2
69call has failed
70.It Dv CPUSET_PARSE_INVALID_CPU
71The number of supported CPUs has been exceeded.
72The maximum number being
73.Va CPU_SETSIZE .
74.El
75.Sh SEE ALSO
76.Xr cpuset 1 ,
77.Xr cpuset 2 ,
78.Xr cpuset 9
79.Sh AUTHORS
80.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org
81