xref: /titanic_41/usr/src/lib/libumem/common/stub_stand.c (revision 70025d765b044c6d8594bb965a2247a61e991a99)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * Stubs for the standalone to reduce the dependence on external libraries
31  */
32 
33 #include <string.h>
34 #include <thread.h>
35 
36 #include "misc.h"
37 
38 /*ARGSUSED*/
39 int
40 _cond_init(cond_t *cvp, int type, void *arg)
41 {
42 	return (0);
43 }
44 
45 /*ARGSUSED*/
46 int
47 _cond_destroy(cond_t *cvp)
48 {
49 	return (0);
50 }
51 
52 /*ARGSUSED*/
53 int
54 _cond_wait(cond_t *cv, mutex_t *mutex)
55 {
56 	umem_panic("attempt to wait on standumem cv %p", cv);
57 
58 	/*NOTREACHED*/
59 	return (0);
60 }
61 
62 /*ARGSUSED*/
63 int
64 _cond_broadcast(cond_t *cvp)
65 {
66 	return (0);
67 }
68 
69 thread_t
70 _thr_self(void)
71 {
72 	return ((thread_t)1);
73 }
74 
75 static mutex_t _mp = DEFAULTMUTEX;
76 
77 /*ARGSUSED*/
78 int
79 __mutex_init(mutex_t *mp, int type, void *arg)
80 {
81 	(void) memcpy(mp, &_mp, sizeof (mutex_t));
82 	return (0);
83 }
84 
85 /*ARGSUSED*/
86 int
87 __mutex_destroy(mutex_t *mp)
88 {
89 	return (0);
90 }
91 
92 /*ARGSUSED*/
93 int
94 __mutex_held(mutex_t *mp)
95 {
96 	return (1);
97 }
98 
99 /*ARGSUSED*/
100 int
101 __mutex_lock(mutex_t *mp)
102 {
103 	return (0);
104 }
105 
106 /*ARGSUSED*/
107 int
108 __mutex_trylock(mutex_t *mp)
109 {
110 	return (0);
111 }
112 
113 /*ARGSUSED*/
114 int
115 __mutex_unlock(mutex_t *mp)
116 {
117 	return (0);
118 }
119 
120 int
121 issetugid(void)
122 {
123 	return (1);
124 }
125