10Sstevel@tonic-gate /*
20Sstevel@tonic-gate * CDDL HEADER START
30Sstevel@tonic-gate *
40Sstevel@tonic-gate * The contents of this file are subject to the terms of the
55891Sraf * Common Development and Distribution License (the "License").
65891Sraf * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate *
80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate * See the License for the specific language governing permissions
110Sstevel@tonic-gate * and limitations under the License.
120Sstevel@tonic-gate *
130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate *
190Sstevel@tonic-gate * CDDL HEADER END
200Sstevel@tonic-gate */
211219Sraf
220Sstevel@tonic-gate /*
23*11466SRoger.Faulkner@Sun.COM * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
240Sstevel@tonic-gate * Use is subject to license terms.
250Sstevel@tonic-gate */
260Sstevel@tonic-gate
270Sstevel@tonic-gate /*
280Sstevel@tonic-gate * Stubs for the standalone to reduce the dependence on external libraries
290Sstevel@tonic-gate */
300Sstevel@tonic-gate
310Sstevel@tonic-gate #include <string.h>
320Sstevel@tonic-gate #include "misc.h"
330Sstevel@tonic-gate
340Sstevel@tonic-gate /*ARGSUSED*/
350Sstevel@tonic-gate int
cond_init(cond_t * cvp,int type,void * arg)366812Sraf cond_init(cond_t *cvp, int type, void *arg)
370Sstevel@tonic-gate {
380Sstevel@tonic-gate return (0);
390Sstevel@tonic-gate }
400Sstevel@tonic-gate
410Sstevel@tonic-gate /*ARGSUSED*/
420Sstevel@tonic-gate int
cond_destroy(cond_t * cvp)436812Sraf cond_destroy(cond_t *cvp)
440Sstevel@tonic-gate {
450Sstevel@tonic-gate return (0);
460Sstevel@tonic-gate }
470Sstevel@tonic-gate
480Sstevel@tonic-gate /*ARGSUSED*/
490Sstevel@tonic-gate int
cond_wait(cond_t * cv,mutex_t * mutex)506812Sraf cond_wait(cond_t *cv, mutex_t *mutex)
510Sstevel@tonic-gate {
520Sstevel@tonic-gate umem_panic("attempt to wait on standumem cv %p", cv);
530Sstevel@tonic-gate
540Sstevel@tonic-gate /*NOTREACHED*/
550Sstevel@tonic-gate return (0);
560Sstevel@tonic-gate }
570Sstevel@tonic-gate
580Sstevel@tonic-gate /*ARGSUSED*/
590Sstevel@tonic-gate int
cond_broadcast(cond_t * cvp)606812Sraf cond_broadcast(cond_t *cvp)
610Sstevel@tonic-gate {
620Sstevel@tonic-gate return (0);
630Sstevel@tonic-gate }
640Sstevel@tonic-gate
655891Sraf /*ARGSUSED*/
665891Sraf int
pthread_setcancelstate(int state,int * oldstate)676812Sraf pthread_setcancelstate(int state, int *oldstate)
685891Sraf {
695891Sraf return (0);
705891Sraf }
715891Sraf
720Sstevel@tonic-gate thread_t
thr_self(void)736812Sraf thr_self(void)
740Sstevel@tonic-gate {
750Sstevel@tonic-gate return ((thread_t)1);
760Sstevel@tonic-gate }
770Sstevel@tonic-gate
780Sstevel@tonic-gate static mutex_t _mp = DEFAULTMUTEX;
790Sstevel@tonic-gate
800Sstevel@tonic-gate /*ARGSUSED*/
810Sstevel@tonic-gate int
mutex_init(mutex_t * mp,int type,void * arg)826812Sraf mutex_init(mutex_t *mp, int type, void *arg)
830Sstevel@tonic-gate {
840Sstevel@tonic-gate (void) memcpy(mp, &_mp, sizeof (mutex_t));
850Sstevel@tonic-gate return (0);
860Sstevel@tonic-gate }
870Sstevel@tonic-gate
880Sstevel@tonic-gate /*ARGSUSED*/
890Sstevel@tonic-gate int
mutex_destroy(mutex_t * mp)906812Sraf mutex_destroy(mutex_t *mp)
910Sstevel@tonic-gate {
920Sstevel@tonic-gate return (0);
930Sstevel@tonic-gate }
940Sstevel@tonic-gate
950Sstevel@tonic-gate /*ARGSUSED*/
960Sstevel@tonic-gate int
_mutex_held(void * mp)97*11466SRoger.Faulkner@Sun.COM _mutex_held(void *mp)
980Sstevel@tonic-gate {
990Sstevel@tonic-gate return (1);
1000Sstevel@tonic-gate }
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate /*ARGSUSED*/
1030Sstevel@tonic-gate int
mutex_lock(mutex_t * mp)1046812Sraf mutex_lock(mutex_t *mp)
1050Sstevel@tonic-gate {
1060Sstevel@tonic-gate return (0);
1070Sstevel@tonic-gate }
1080Sstevel@tonic-gate
1090Sstevel@tonic-gate /*ARGSUSED*/
1100Sstevel@tonic-gate int
mutex_trylock(mutex_t * mp)1116812Sraf mutex_trylock(mutex_t *mp)
1120Sstevel@tonic-gate {
1130Sstevel@tonic-gate return (0);
1140Sstevel@tonic-gate }
1150Sstevel@tonic-gate
1160Sstevel@tonic-gate /*ARGSUSED*/
1170Sstevel@tonic-gate int
mutex_unlock(mutex_t * mp)1186812Sraf mutex_unlock(mutex_t *mp)
1190Sstevel@tonic-gate {
1200Sstevel@tonic-gate return (0);
1210Sstevel@tonic-gate }
1220Sstevel@tonic-gate
1230Sstevel@tonic-gate int
issetugid(void)1246812Sraf issetugid(void)
1250Sstevel@tonic-gate {
1260Sstevel@tonic-gate return (1);
1270Sstevel@tonic-gate }
128