setenv/putenv/unsetenv.

Jim Rosenberg jr at oglvee.UUCP
Thu Aug 25 04:43:23 AEST 1988


>From article <23335 at labrea.Stanford.EDU>, by karish at denali.stanford.edu (Chuck Karish):
> As of Draft 12.3, the POSIX 1003.1 standard includes only getenv().
> It's pretty simple to write the others; all you have to do is to
  ^^^^ ^^^^^^ ^^^^^^ ^^ ^^^^^ ^^^ ^^^^^^
> change the contents of the strings pointed to by the `environ' pointers.
> This may entail using realloc() where strings get longer, and re-
> assigning pointers to pointers (unsetenv()).

OPINION ON:

Sure it's simple, but that's not the point.  The environment is something
pretty basic.  Isn't it about time we started dealing with as many such basic
things as possible through a layer of primitives??  It is quite surprising how
many vendors of quite diverse operating systems are either talking about or
actually promising POSIX compatibility, even though the underlying kernels
don't look even vaguely like UNIX.  (VMS, OS/2, ...)  What are these people
supposed to do?  If the primitive to set an environment variable isn't in the
standard then you will get just the kind of problems with variant versions and
portability troubles that the standard is supposed to prevent.
-- 
Jim Rosenberg                        pitt
Oglevee Computer Systems                 >--!amanue!oglvee!jr
151 Oglevee Lane                      cgh
Connellsville, PA 15425                                #include <disclaimer.h>



More information about the Comp.unix.questions mailing list