/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright 2016 Joyent, Inc.
*/
#include "lint.h"
#include "thr_uberdata.h"
/*
* pthread_once related data
* This structure is exported as pthread_once_t in pthread.h.
* We export only the size of this structure. so check
* pthread_once_t in pthread.h before making a change here.
*/
typedef struct __once {
union {
} oflag;
} __once_t;
static int
{
int error = 0;
} else {
}
return (error);
}
static int
{
int error = 0;
} else {
/*
* Don't change the ceiling priority,
* just the base priority.
*/
else
} else {
}
}
return (error);
}
/*
* pthread_create: creates a thread in the current process.
* calls common _thrp_create() after copying the attributes.
*/
int
void * (*start_routine)(void *), void *arg)
{
long flag;
int error;
return (EINVAL);
/* validate explicit scheduling attributes */
return (EINVAL);
if (error == 0) {
/*
* Record the original inheritence value for
* pthread_getattr_np(). We should always be able to find the
* thread.
*/
/*
* The SUSv3 specification requires pthread_create()
* to fail with EPERM if it cannot set the scheduling
* policy and parameters on the new thread.
*/
}
if (error) {
/*
* We couldn't determine this error before
* actually creating the thread. To recover,
* mark the thread detached and cancel it.
* It is as though it was never created.
*/
if (ulwp->ul_detached == 0) {
(void) __lwp_detach(tid);
}
ulwp->ul_cancel_disabled = 0;
} else if (thread) {
}
(void) thr_continue(tid);
}
/* posix version expects EAGAIN for lack of memory */
return (error);
}
/*
* pthread_once: calls given function only once.
* it synchronizes via mutex in pthread_once_t structure
*/
int
{
return (EINVAL);
(*init_routine)();
}
}
return (0);
}
/*
* pthread_equal: equates two thread ids.
*/
int
{
}
/*
* pthread_getschedparam: get the thread's sched parameters.
*/
int
{
int error = 0;
} else {
if (cid == -1) {
/*
* Return the defined priority, not the effective
* priority from priority ceiling mutexes.
*/
} else {
}
}
return (error);
}
int
{
int policy;
int error;
return (error);
}
/*
* pthread_setschedparam: sets the sched parameters for a thread.
*/
int
{
}
int
{
int policy;
int error;
/*
* pthread_getschedparam() has the side-effect of setting
* the target thread's ul_policy, ul_pri and ul_cid correctly.
*/
return (error);
return (0);
}