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]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
28 #include <sys/types.h>
37 #define NOTID 0xffffffff
40 * This file is meant to contain support functions
41 * for interceptors. They are built into the auditing
42 * object making the namespace available to "children"
46 static lwp_mutex_t abi_stdio_mutex
= DEFAULTMUTEX
;
47 static volatile thread_t locktid
= NOTID
;
48 static volatile int count
;
50 /* Return true on empty */
52 is_empty_string(char const *s
)
54 if (s
!= NULL
&& *s
!= '\0')
61 abilock(sigset_t
*mask
)
65 if ((*abi_thr_main
)() != -1) {
66 tid
= (*abi_thr_self
)();
71 (void) _lwp_mutex_lock(&abi_stdio_mutex
);
72 (void) sigprocmask(SIG_BLOCK
, &abisigset
, mask
);
80 abiunlock(sigset_t
*mask
)
84 (void) fflush(ABISTREAM
);
86 if ((*abi_thr_main
)() != -1) {
87 tid
= (*abi_thr_self
)();
88 assert(tid
== locktid
);
93 (void) sigprocmask(SIG_SETMASK
, mask
, NULL
);
94 (void) _lwp_mutex_unlock(&abi_stdio_mutex
);