pthr_attr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "lint.h"
#include "thr_uberdata.h"
#include <sched.h>
/*
* pthread_attr_init: allocates the attribute object and initializes it
* with the default values.
*/
int
{
if (_lpagesize == 0)
return (0);
}
return (ENOMEM);
}
/*
* pthread_attr_destroy: frees the attribute object and invalidates it
* with NULL value.
*/
int
{
return (EINVAL);
return (0);
}
/*
* pthread_attr_setstacksize: sets the user stack size, minimum should
* be PTHREAD_STACK_MIN (MINSTACK).
* This is equivalent to stksize argument in thr_create().
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getstacksize: gets the user stack size.
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setstackaddr: sets the user stack addr.
* This is equivalent to stkaddr argument in thr_create().
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getstackaddr: gets the user stack addr.
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setdetachstate: sets the detach state to JOINABLE or
* DETACHED.
* This is equivalent to setting THR_DETACHED flag in thr_create().
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getdetachstate: gets the detach state.
*/
int
{
detachstate != NULL) {
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setscope: sets the scope to SYSTEM or PROCESS.
* This is equivalent to setting THR_BOUND flag in thr_create().
*/
int
{
(scope == PTHREAD_SCOPE_SYSTEM ||
scope == PTHREAD_SCOPE_PROCESS)) {
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getscope: gets the scheduling scope.
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setinheritsched: sets the scheduling parameters to be
* EXPLICIT or INHERITED from parent thread.
*/
int
{
(inherit == PTHREAD_EXPLICIT_SCHED ||
inherit == PTHREAD_INHERIT_SCHED)) {
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getinheritsched: gets the scheduling inheritance.
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setschedpolicy: sets the scheduling policy to SCHED_RR,
* SCHED_FIFO or SCHED_OTHER.
*/
int
{
(policy == SCHED_OTHER ||
policy == SCHED_FIFO ||
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getpolicy: gets the scheduling policy.
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setschedparam: sets the scheduling parameters.
* Currently, we support priority only.
*/
int
const struct sched_param *param)
{
int policy;
int pri;
return (EINVAL);
if (policy == SCHED_OTHER) {
return (EINVAL);
return (EINVAL);
}
return (0);
}
/*
* pthread_attr_getschedparam: gets the scheduling parameters.
* Currently, only priority is defined as sched parameter.
*/
int
struct sched_param *param)
{
return (0);
}
return (EINVAL);
}
/*
* UNIX98
* pthread_attr_setguardsize: sets the guardsize
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* UNIX98
* pthread_attr_getguardsize: gets the guardsize
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_setstack: sets the user stack addr and stack size.
* This is equivalent to the stack_base and stack_size arguments
* to thr_create().
*/
int
{
return (0);
}
return (EINVAL);
}
/*
* pthread_attr_getstack: gets the user stack addr and stack size.
*/
int
{
return (0);
}
return (EINVAL);
}