.\" Copyright (c) 2007 The DragonFly Project. All rights reserved. .\" .\" This code is derived from software contributed to The DragonFly Project .\" by Matthew Dillon .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $DragonFly: src/lib/libc/sys/usched_set.2,v 1.4 2007/12/23 15:31:28 swildner Exp $ .\" .Dd February 26, 2009 .Dt USCHED_SET 2 .Os .Sh NAME .Nm usched_set .Nd setting up a proc's usched .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In sys/types.h .In sys/usched.h .Ft int .Fn usched_set "pid_t pid" "int cmd" "void *data" "int bytes" .Sh DESCRIPTION The .Fn usched_set function is used to perform several user scheduler tasks. These tasks include: setting the user scheduler, assigning an LWP to a specific CPU, adding a CPU to the available CPUs for an LWP, and removing a CPU from the list of available CPUs for an LWP. The .Fn usched_set function requires superuser privileges for all commands except .Dv USCHED_GET_CPU . .Pp The .Fa cmd argument specifies the action for .Fn usched_set to take. .Dv USCHED_SET_SCHEDULER sets the user scheduler where .Fa data is a .Vt char * that contains the name of the user scheduler. .Dv USCHED_SET_CPU assigns the LWP to the cpuid pointed to by .Fa data . .Dv USCHED_GET_CPU copies the LWP's CPU ID to the cpuid pointed to by .Fa data . .Dv USCHED_ADD_CPU adds the cpuid specified by .Fa data to the list of available CPUs for the LWP. .Dv USCHED_DEL_CPU removes the cpuid specified by .Fa data from the list of available CPUs for the LWP. .Sh RETURN VALUES .Rv -std .Sh ERRORS The function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The user scheduler to set is not in the list of available user schedulers. The .Fa bytes argument is not the correct size .Vt ( int ) for a cpuid. The specified cpuid is not set in .Va smp_active_mask . .Fa Cmd contains an unknown value. .It Bq Er EFBIG The specified cpuid is not a valid cpuid for the system. .It Bq Er EPERM Deleting the specified cpuid leaves the LWP without a CPU to run on. .El .\".Sh SEE ALSO .Sh HISTORY The .Fn usched_set function call was added in .Dx 1.9 . .Sh AUTHORS .An -nosplit .Fn Usched_set was written by .An Matt Dillon . This manual page was written by .An Joe Talbott .