/[gnats]/gnats/libiberty/setenv.c
ViewVC logotype

Diff of /gnats/libiberty/setenv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pdm, Mon Dec 10 23:03:26 2001 UTC revision 1.3 by chewie, Sat Nov 13 05:14:17 2004 UTC
# Line 1  Line 1 
1  /* Copyright (C) 1992, 1995, 1996, 1997 Free Software Foundation, Inc.  /* Copyright (C) 1992, 1995, 1996, 1997, 2002 Free Software Foundation, Inc.
2     This file based on setenv.c in the GNU C Library.     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     The GNU C Library is free software; you can redistribute it and/or
# Line 16  Line 16 
16     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,     write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17     Boston, MA 02111-1307, USA.  */     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,
27    the new value will be stored only if @var{overwrite} is nonzero.
28    The companion @code{unsetenv} function removes @var{name} from the
29    environment.  This implementation is not safe for multithreaded code.
30    
31    @end deftypefn
32    
33    */
34    
35  #if HAVE_CONFIG_H  #if HAVE_CONFIG_H
36  # include <config.h>  # include <config.h>
37  #endif  #endif
38    
39    #define setenv libiberty_setenv
40    #define unsetenv libiberty_unsetenv
41    
42  #include "ansidecl.h"  #include "ansidecl.h"
43  #include <sys/types.h> /* For `size_t' */  #include <sys/types.h> /* For `size_t' */
44  #include <stdio.h>     /* For `NULL' */  #include <stdio.h>     /* For `NULL' */
# Line 45  extern int errno; Line 64  extern int errno;
64  extern char **environ;  extern char **environ;
65  #endif  #endif
66    
67    #undef setenv
68    #undef unsetenv
69    
70  /* LOCK and UNLOCK are defined as no-ops.  This makes the libiberty  /* LOCK and UNLOCK are defined as no-ops.  This makes the libiberty
71   * implementation MT-Unsafe. */   * implementation MT-Unsafe. */
72  #define LOCK  #define LOCK

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26