xref: /dragonfly/lib/libc/sys/usched_set.2 (revision 8a7bdfea)
1.\" Copyright (c) 2007 The DragonFly Project.  All rights reserved.
2.\"
3.\" This code is derived from software contributed to The DragonFly Project
4.\" by Matthew Dillon <dillon@backplane.com>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in
14.\"    the documentation and/or other materials provided with the
15.\"    distribution.
16.\" 3. Neither the name of The DragonFly Project nor the names of its
17.\"    contributors may be used to endorse or promote products derived
18.\"    from this software without specific, prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
24.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
26.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\" $DragonFly: src/lib/libc/sys/usched_set.2,v 1.4 2007/12/23 15:31:28 swildner Exp $
34.\"
35.Dd July 5, 2007
36.Dt USCHED_SET 2
37.Os
38.Sh NAME
39.Nm usched_set
40.Nd setting up a proc's usched
41.Sh LIBRARY
42.Lb libc
43.Sh SYNOPSIS
44.In sys/usched.h
45.Ft int
46.Fn usched_set "pid_t pid" "int cmd" "void *data" "int bytes"
47.Sh DESCRIPTION
48The
49.Fn usched_set
50function is used to perform several user scheduler tasks.
51These tasks include: setting the user scheduler, assigning an LWP to a
52specific CPU, adding a CPU to the available CPUs for an LWP,
53and removing a CPU from the list of available CPUs for an LWP.
54.Pp
55The
56.Fa cmd
57argument specifies the action for
58.Fn usched_set
59to take.
60.Dv USCHED_SET_SCHEDULER
61sets the user scheduler where
62.Fa data
63is a
64.Vt char *
65that contains the name of the user scheduler.
66.Dv USCHED_SET_CPU
67assigns the LWP to the cpuid pointed to by
68.Fa data .
69.Dv USCHED_ADD_CPU
70adds the cpuid specified by
71.Fa data
72to the list of available CPUs for the LWP.
73.Dv USCHED_DEL_CPU
74removes the cpuid specified by
75.Fa data
76from the list of available CPUs for the LWP.
77.Sh RETURN VALUES
78.Rv -std
79.Sh ERRORS
80The function will fail if:
81.Bl -tag -width Er
82.It Bq Er EINVAL
83The user scheduler to set is not in the list of available user schedulers.
84The
85.Fa bytes
86argument does is not the correct size
87.Vt ( int )
88for a cpuid.
89The specified cpuid is not set in
90.Va smp_active_mask .
91.Fa Cmd
92contains an unknown value.
93.It Bq Er EFBIG
94The specified cpuid is not a valid cpuid for the system.
95.It Bq Er EPERM
96Deleting the specified cpuid leaves the LWP without a CPU to run on.
97.El
98.\".Sh SEE ALSO
99.Sh HISTORY
100The
101.Fn usched_set
102function call was added in
103.Dx 1.9 .
104.Sh AUTHORS
105.An -nosplit
106.Fn Usched_set
107was written by
108.An Matt Dillon .
109This manual page was written by
110.An Joe Talbott .
111