xref: /netbsd-src/lib/libc/include/env.h (revision 26ba80487baf540a03edf0f75a16a427b5c4c9ab)
1*26ba8048Schristos /*	$NetBSD: env.h,v 1.3 2015/01/20 18:31:25 christos Exp $	*/
2fbf4aa16Stron 
3fbf4aa16Stron /*-
4fbf4aa16Stron  * Copyright (c) 2010 The NetBSD Foundation, Inc.
5fbf4aa16Stron  * All rights reserved.
6fbf4aa16Stron  *
7fbf4aa16Stron  * This code is derived from software contributed to The NetBSD Foundation
8fbf4aa16Stron  * by Matthias Scheler.
9fbf4aa16Stron  *
10fbf4aa16Stron  * Redistribution and use in source and binary forms, with or without
11fbf4aa16Stron  * modification, are permitted provided that the following conditions
12fbf4aa16Stron  * are met:
13fbf4aa16Stron  * 1. Redistributions of source code must retain the above copyright
14fbf4aa16Stron  *    notice, this list of conditions and the following disclaimer.
15fbf4aa16Stron  * 2. Redistributions in binary form must reproduce the above copyright
16fbf4aa16Stron  *    notice, this list of conditions and the following disclaimer in the
17fbf4aa16Stron  *    documentation and/or other materials provided with the distribution.
18fbf4aa16Stron  *
19fbf4aa16Stron  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20fbf4aa16Stron  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21fbf4aa16Stron  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22fbf4aa16Stron  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23fbf4aa16Stron  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24fbf4aa16Stron  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25fbf4aa16Stron  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26fbf4aa16Stron  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27fbf4aa16Stron  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28fbf4aa16Stron  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29fbf4aa16Stron  * POSSIBILITY OF SUCH DAMAGE.
30fbf4aa16Stron  */
31fbf4aa16Stron 
32fbf4aa16Stron #include <sys/types.h>
33fbf4aa16Stron 
34fbf4aa16Stron #include <stdbool.h>
35fbf4aa16Stron 
36fbf4aa16Stron #include "reentrant.h"
37fbf4aa16Stron 
38fbf4aa16Stron extern ssize_t __getenvslot(const char *name, size_t l_name, bool allocate);
392f85740eStron extern char *__findenvvar(const char *name, size_t l_name);
40fbf4aa16Stron 
41fbf4aa16Stron #ifdef _REENTRANT
42fbf4aa16Stron extern bool __readlockenv(void);
43fbf4aa16Stron extern bool __writelockenv(void);
44fbf4aa16Stron extern bool __unlockenv(void);
45fbf4aa16Stron #else
46fbf4aa16Stron static __inline bool
__readlockenv(void)47fbf4aa16Stron __readlockenv(void)
48fbf4aa16Stron {
49fbf4aa16Stron 	return true;
50fbf4aa16Stron }
51fbf4aa16Stron 
52fbf4aa16Stron static __inline bool
__writelockenv(void)53fbf4aa16Stron __writelockenv(void)
54fbf4aa16Stron {
55fbf4aa16Stron 	return true;
56fbf4aa16Stron }
57fbf4aa16Stron 
58fbf4aa16Stron static __inline bool
__unlockenv(void)59*26ba8048Schristos __unlockenv(void)
60fbf4aa16Stron {
61fbf4aa16Stron 	return true;
62fbf4aa16Stron }
63fbf4aa16Stron #endif
64fbf4aa16Stron 
65fbf4aa16Stron extern char **environ;
66