summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/setenv.c
diff options
context:
space:
mode:
authorguenther <>2015-09-13 08:31:48 +0000
committerguenther <>2015-09-13 08:31:48 +0000
commit37a8e8e2fe93b45ab3b39108d9af4b75cf4dd663 (patch)
tree97578b890ec56dd23cc1e63d9bb8ef626aa1e803 /src/lib/libc/stdlib/setenv.c
parent3ab8135e9f87e6a6b3e4d7790fce947888eab2f8 (diff)
downloadopenbsd-37a8e8e2fe93b45ab3b39108d9af4b75cf4dd663.tar.gz
openbsd-37a8e8e2fe93b45ab3b39108d9af4b75cf4dd663.tar.bz2
openbsd-37a8e8e2fe93b45ab3b39108d9af4b75cf4dd663.zip
Wrap <stdlib.h> so that calls go direct and the symbols not in the
C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
Diffstat (limited to 'src/lib/libc/stdlib/setenv.c')
-rw-r--r--src/lib/libc/stdlib/setenv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/setenv.c b/src/lib/libc/stdlib/setenv.c
index 10b55445f7..e55a1feb6f 100644
--- a/src/lib/libc/stdlib/setenv.c
+++ b/src/lib/libc/stdlib/setenv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: setenv.c,v 1.15 2014/10/08 05:33:31 deraadt Exp $ */ 1/* $OpenBSD: setenv.c,v 1.16 2015/09/13 08:31:47 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 1987 Regents of the University of California. 3 * Copyright (c) 1987 Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
@@ -32,8 +32,6 @@
32#include <stdlib.h> 32#include <stdlib.h>
33#include <string.h> 33#include <string.h>
34 34
35char *__findenv(const char *name, int len, int *offset);
36
37extern char **environ; 35extern char **environ;
38static char **lastenv; /* last value of environ */ 36static char **lastenv; /* last value of environ */
39 37
@@ -81,6 +79,7 @@ putenv(char *str)
81 environ[cnt + 1] = NULL; 79 environ[cnt + 1] = NULL;
82 return (0); 80 return (0);
83} 81}
82DEF_WEAK(putenv);
84 83
85/* 84/*
86 * setenv -- 85 * setenv --
@@ -147,6 +146,7 @@ setenv(const char *name, const char *value, int rewrite)
147 ; 146 ;
148 return (0); 147 return (0);
149} 148}
149DEF_WEAK(setenv);
150 150
151/* 151/*
152 * unsetenv(name) -- 152 * unsetenv(name) --
@@ -178,3 +178,4 @@ unsetenv(const char *name)
178 } 178 }
179 return (0); 179 return (0);
180} 180}
181DEF_WEAK(unsetenv);