dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libumem / common / stub_stand.c
blob7a26ea8b7f6d015e39ad85890a4f00f8a380e88b
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 * Copyright (c) 2012, Joyent, Inc. All rights reserved.
32 * Stubs for the standalone to reduce the dependence on external libraries
35 #include <string.h>
36 #include "misc.h"
38 /*ARGSUSED*/
39 int
40 cond_init(cond_t *cvp, int type, void *arg)
42 return (0);
45 /*ARGSUSED*/
46 int
47 cond_destroy(cond_t *cvp)
49 return (0);
52 /*ARGSUSED*/
53 int
54 cond_wait(cond_t *cv, mutex_t *mutex)
56 umem_panic("attempt to wait on standumem cv %p", cv);
58 /*NOTREACHED*/
59 return (0);
62 /*ARGSUSED*/
63 int
64 cond_broadcast(cond_t *cvp)
66 return (0);
69 /*ARGSUSED*/
70 int
71 pthread_setcancelstate(int state, int *oldstate)
73 return (0);
76 thread_t
77 thr_self(void)
79 return ((thread_t)1);
82 static mutex_t _mp = DEFAULTMUTEX;
84 /*ARGSUSED*/
85 int
86 mutex_init(mutex_t *mp, int type, void *arg)
88 (void) memcpy(mp, &_mp, sizeof (mutex_t));
89 return (0);
92 /*ARGSUSED*/
93 int
94 mutex_destroy(mutex_t *mp)
96 return (0);
99 /*ARGSUSED*/
101 _mutex_held(void *mp)
103 return (1);
106 /*ARGSUSED*/
108 mutex_lock(mutex_t *mp)
110 return (0);
113 /*ARGSUSED*/
115 mutex_trylock(mutex_t *mp)
117 return (0);
120 /*ARGSUSED*/
122 mutex_unlock(mutex_t *mp)
124 return (0);
128 issetugid(void)
130 return (1);
134 _tmem_get_nentries(void)
136 return (0);
139 uintptr_t
140 _tmem_get_base(void)
142 return (0);
145 /*ARGSUSED*/
146 void
147 _tmem_set_cleanup(void (*f)(int, void *))
152 isspace(int c)
154 switch (c) {
155 case ' ':
156 case '\t':
157 case '\n':
158 case '\r':
159 case '\f':
160 case '\v':
161 return (1);
163 return (0);