Home | History | Annotate | Line # | Download | only in libpthread
 $NetBSD: pthread_attr_getinheritsched.3,v 1.5 2025/02/27 06:27:35 andvar Exp $

Copyright (c) 2010 Jukka Ruohonen <jruohonen (at] iki.fi>
All rights reserved.

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.

THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.

.Dd May 10, 2013 .Dt PTHREAD_ATTR_GETINHERITSCHED 3 .Os .Sh NAME .Nm pthread_attr_getinheritsched , .Nm pthread_attr_setinheritsched .Nd get and set .Dq inheritsched attribute .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS n pthread.h .Ft int .Fn pthread_attr_getinheritsched \ "const pthread_attr_t * restrict attr" "int * restrict inheritsched" .Ft int .Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched" .Sh DESCRIPTION The .Fn pthread_attr_getinheritsched and .Fn pthread_attr_setinheritsched functions get and set, respectively, the inherit scheduler attribute, .Fa inheritsched , in the .Fa attr object. The .Fa inheritsched parameter specifies whether a thread created by using .Fa attr will obtain its scheduling attributes directly from .Fa attr or whether it will inherit these from the calling thread.

p Two values are possible for .Fa inheritsched : l -tag -width PTHREAD_EXPLICIT_SCHED -offset indent t Dv PTHREAD_INHERIT_SCHED The thread scheduling attributes will be inherited from the creating thread and the ones in .Fa attr are ignored. t Dv PTHREAD_EXPLICIT_SCHED The thread scheduling attributes will be set to the corresponding values in .Fa attr . .El

p The following thread scheduling attributes are affected by .Fa inheritsched : l -bullet -offset indent t Scheduling policy; see .Xr pthread_attr_setschedpolicy 3 . t Scheduling parameter; see .Xr pthread_attr_getschedparam 3 . t Scheduling contention scope; see .Xr pthread_attr_getscope 3 . .El .Sh RETURN VALUES If successful, both functions return 0. Otherwise, an error number is returned to indicate the error. .Sh COMPATIBILITY The standard leaves it unspecified which (if any) is the default inherit scheduler attribute in a newly initialized attribute object. .Sh ERRORS No errors are defined for .Fn pthread_attr_getinheritsched .

p The .Fn pthread_attr_setinheritsched function may fail if: l -tag -width Er t Bq Er EINVAL The value specified by .Fa inheritsched is invalid. .El .Sh SEE ALSO .Xr pthread_attr 3 .Sh STANDARDS Both functions conform to .St -p1003.1-2008 .