17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
5a574db8raf * Common Development and Distribution License (the "License").
6a574db8raf * You may not use this file except in compliance with the License.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
107c478bdstevel@tonic-gate * See the License for the specific language governing permissions
117c478bdstevel@tonic-gate * and limitations under the License.
127c478bdstevel@tonic-gate *
137c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
147c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
167c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
177c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bdstevel@tonic-gate *
197c478bdstevel@tonic-gate * CDDL HEADER END
207c478bdstevel@tonic-gate */
21e8031f0raf
227c478bdstevel@tonic-gate/*
232d08521Garrett D'Amore * Copyright 2014 Garrett D'Amore <garrett@damore.org>
2453f3aeaRoger A. Faulkner * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
257c478bdstevel@tonic-gate * Use is subject to license terms.
267c478bdstevel@tonic-gate */
274f364e7Robert Mustacchi/*
284f364e7Robert Mustacchi * Copyright (c) 2012, Joyent, Inc.  All rights reserved.
294f364e7Robert Mustacchi */
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate/*
327c478bdstevel@tonic-gate * Stubs for the standalone to reduce the dependence on external libraries
337c478bdstevel@tonic-gate */
347c478bdstevel@tonic-gate
357c478bdstevel@tonic-gate#include <string.h>
367c478bdstevel@tonic-gate#include "misc.h"
377c478bdstevel@tonic-gate
387c478bdstevel@tonic-gate/*ARGSUSED*/
397c478bdstevel@tonic-gateint
407257d1brafcond_init(cond_t *cvp, int type, void *arg)
417c478bdstevel@tonic-gate{
427c478bdstevel@tonic-gate	return (0);
437c478bdstevel@tonic-gate}
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate/*ARGSUSED*/
467c478bdstevel@tonic-gateint
477257d1brafcond_destroy(cond_t *cvp)
487c478bdstevel@tonic-gate{
497c478bdstevel@tonic-gate	return (0);
507c478bdstevel@tonic-gate}
517c478bdstevel@tonic-gate
527c478bdstevel@tonic-gate/*ARGSUSED*/
537c478bdstevel@tonic-gateint
547257d1brafcond_wait(cond_t *cv, mutex_t *mutex)
557c478bdstevel@tonic-gate{
567c478bdstevel@tonic-gate	umem_panic("attempt to wait on standumem cv %p", cv);
577c478bdstevel@tonic-gate
587c478bdstevel@tonic-gate	/*NOTREACHED*/
597c478bdstevel@tonic-gate	return (0);
607c478bdstevel@tonic-gate}
617c478bdstevel@tonic-gate
627c478bdstevel@tonic-gate/*ARGSUSED*/
637c478bdstevel@tonic-gateint
647257d1brafcond_broadcast(cond_t *cvp)
657c478bdstevel@tonic-gate{
667c478bdstevel@tonic-gate	return (0);
677c478bdstevel@tonic-gate}
687c478bdstevel@tonic-gate
69a574db8raf/*ARGSUSED*/
70a574db8rafint
717257d1brafpthread_setcancelstate(int state, int *oldstate)
72a574db8raf{
73a574db8raf	return (0);
74a574db8raf}
75a574db8raf
767c478bdstevel@tonic-gatethread_t
777257d1brafthr_self(void)
787c478bdstevel@tonic-gate{
797c478bdstevel@tonic-gate	return ((thread_t)1);
807c478bdstevel@tonic-gate}
817c478bdstevel@tonic-gate
827c478bdstevel@tonic-gatestatic mutex_t _mp = DEFAULTMUTEX;
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gate/*ARGSUSED*/
857c478bdstevel@tonic-gateint
867257d1brafmutex_init(mutex_t *mp, int type, void *arg)
877c478bdstevel@tonic-gate{
887c478bdstevel@tonic-gate	(void) memcpy(mp, &_mp, sizeof (mutex_t));
897c478bdstevel@tonic-gate	return (0);
907c478bdstevel@tonic-gate}
917c478bdstevel@tonic-gate
927c478bdstevel@tonic-gate/*ARGSUSED*/
937c478bdstevel@tonic-gateint
947257d1brafmutex_destroy(mutex_t *mp)
957c478bdstevel@tonic-gate{
967c478bdstevel@tonic-gate	return (0);
977c478bdstevel@tonic-gate}
987c478bdstevel@tonic-gate
997c478bdstevel@tonic-gate/*ARGSUSED*/
1007c478bdstevel@tonic-gateint
10153f3aeaRoger A. Faulkner_mutex_held(void *mp)
1027c478bdstevel@tonic-gate{
1037c478bdstevel@tonic-gate	return (1);
1047c478bdstevel@tonic-gate}
1057c478bdstevel@tonic-gate
1067c478bdstevel@tonic-gate/*ARGSUSED*/
1077c478bdstevel@tonic-gateint
1087257d1brafmutex_lock(mutex_t *mp)
1097c478bdstevel@tonic-gate{
1107c478bdstevel@tonic-gate	return (0);
1117c478bdstevel@tonic-gate}
1127c478bdstevel@tonic-gate
1137c478bdstevel@tonic-gate/*ARGSUSED*/
1147c478bdstevel@tonic-gateint
1157257d1brafmutex_trylock(mutex_t *mp)
1167c478bdstevel@tonic-gate{
1177c478bdstevel@tonic-gate	return (0);
1187c478bdstevel@tonic-gate}
1197c478bdstevel@tonic-gate
1207c478bdstevel@tonic-gate/*ARGSUSED*/
1217c478bdstevel@tonic-gateint
1227257d1brafmutex_unlock(mutex_t *mp)
1237c478bdstevel@tonic-gate{
1247c478bdstevel@tonic-gate	return (0);
1257c478bdstevel@tonic-gate}
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gateint
1287257d1brafissetugid(void)
1297c478bdstevel@tonic-gate{
1307c478bdstevel@tonic-gate	return (1);
1317c478bdstevel@tonic-gate}
1324f364e7Robert Mustacchi
1334f364e7Robert Mustacchiint
1344f364e7Robert Mustacchi_tmem_get_nentries(void)
1354f364e7Robert Mustacchi{
1364f364e7Robert Mustacchi	return (0);
1374f364e7Robert Mustacchi}
1384f364e7Robert Mustacchi
1394f364e7Robert Mustacchiuintptr_t
1404f364e7Robert Mustacchi_tmem_get_base(void)
1414f364e7Robert Mustacchi{
1424f364e7Robert Mustacchi	return (0);
1434f364e7Robert Mustacchi}
1444f364e7Robert Mustacchi
1454f364e7Robert Mustacchi/*ARGSUSED*/
1464f364e7Robert Mustacchivoid
1474f364e7Robert Mustacchi_tmem_set_cleanup(void (*f)(int, void *))
1484f364e7Robert Mustacchi{
1494f364e7Robert Mustacchi}
1502d08521Garrett D'Amore
1512d08521Garrett D'Amoreint
1522d08521Garrett D'Amoreisspace(int c)
1532d08521Garrett D'Amore{
1542d08521Garrett D'Amore	switch (c) {
1552d08521Garrett D'Amore	case ' ':
1562d08521Garrett D'Amore	case '\t':
1572d08521Garrett D'Amore	case '\n':
1582d08521Garrett D'Amore	case '\r':
1592d08521Garrett D'Amore	case '\f':
1602d08521Garrett D'Amore	case '\v':
1612d08521Garrett D'Amore		return (1);
1622d08521Garrett D'Amore	}
1632d08521Garrett D'Amore	return (0);
1642d08521Garrett D'Amore}
165