setenv.c (77298) | setenv.c (89857) |
---|---|
1/* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc. | 1/* Copyright (C) 1992, 1995, 1996, 1997, 2002 Free Software Foundation, Inc. |
2 This file based on setenv.c in the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Library General Public License as 6 published by the Free Software Foundation; either version 2 of the 7 License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Library General Public License for more details. 13 14 You should have received a copy of the GNU Library General Public 15 License along with the GNU C Library; see the file COPYING.LIB. If not, 16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Boston, MA 02111-1307, USA. */ 18 | 2 This file based on setenv.c in the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Library General Public License as 6 published by the Free Software Foundation; either version 2 of the 7 License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Library General Public License for more details. 13 14 You should have received a copy of the GNU Library General Public 15 License along with the GNU C Library; see the file COPYING.LIB. If not, 16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Boston, MA 02111-1307, USA. */ 18 |
19 20/* 21 22@deftypefn Supplemental int setenv (const char *@var{name}, const char *@var{value}, int @var{overwrite}) 23@deftypefnx Supplemental void unsetenv (const char *@var{name}) 24 25@code{setenv} adds @var{name} to the environment with value 26@var{value}. If the name was already present in the environment, 27the new value will be stored only if @var{overwrite} is nonzero. 28The companion @code{unsetenv} function removes @var{name} from the 29environment. This implementation is not safe for multithreaded code. 30 31@end deftypefn 32 33*/ 34 |
|
19#if HAVE_CONFIG_H 20# include <config.h> 21#endif 22 | 35#if HAVE_CONFIG_H 36# include <config.h> 37#endif 38 |
39#define setenv libiberty_setenv 40#define unsetenv libiberty_unsetenv 41 |
|
23#include "ansidecl.h" 24#include <sys/types.h> /* For `size_t' */ 25#include <stdio.h> /* For `NULL' */ 26 27#include <errno.h> 28#if !defined(errno) && !defined(HAVE_ERRNO_DECL) 29extern int errno; 30#endif --- 9 unchanged lines hidden (view full) --- 40# include <unistd.h> 41#endif 42 43#define __environ environ 44#ifndef HAVE_ENVIRON_DECL 45extern char **environ; 46#endif 47 | 42#include "ansidecl.h" 43#include <sys/types.h> /* For `size_t' */ 44#include <stdio.h> /* For `NULL' */ 45 46#include <errno.h> 47#if !defined(errno) && !defined(HAVE_ERRNO_DECL) 48extern int errno; 49#endif --- 9 unchanged lines hidden (view full) --- 59# include <unistd.h> 60#endif 61 62#define __environ environ 63#ifndef HAVE_ENVIRON_DECL 64extern char **environ; 65#endif 66 |
67#undef setenv 68#undef unsetenv 69 |
|
48/* LOCK and UNLOCK are defined as no-ops. This makes the libiberty 49 * implementation MT-Unsafe. */ 50#define LOCK 51#define UNLOCK 52 53/* Below this point, it's verbatim code from the glibc-2.0 implementation */ 54 55/* If this variable is not a null pointer we allocated the current --- 110 unchanged lines hidden --- | 70/* LOCK and UNLOCK are defined as no-ops. This makes the libiberty 71 * implementation MT-Unsafe. */ 72#define LOCK 73#define UNLOCK 74 75/* Below this point, it's verbatim code from the glibc-2.0 implementation */ 76 77/* If this variable is not a null pointer we allocated the current --- 110 unchanged lines hidden --- |