<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Bug][VM][OSProcessPlugin]Does not run on Solaris</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>> Sorry for the inconvenience. If you happen to know the </FONT>
<BR><FONT SIZE=2>> Solaris equivalent</FONT>
<BR><FONT SIZE=2>> of setenv(3), please let me know so I can fix it correctly.</FONT>
</P>
<P><FONT SIZE=2>It looks like Solaris supports getenv() and putenv().</FONT>
<BR><FONT SIZE=2>Man pages follow:</FONT>
</P>
<P><FONT SIZE=2>Standard C Library Functions getenv(3C)</FONT>
</P>
<P><FONT SIZE=2>NAME</FONT>
<BR><FONT SIZE=2> getenv - return value for environment name</FONT>
</P>
<P><FONT SIZE=2>SYNOPSIS</FONT>
<BR><FONT SIZE=2> #include <stdlib.h></FONT>
</P>
<P><FONT SIZE=2> char *getenv(const char *name);</FONT>
</P>
<P><FONT SIZE=2>DESCRIPTION</FONT>
<BR><FONT SIZE=2> The getenv() function searches the environment list (see</FONT>
<BR><FONT SIZE=2> environ(5)) for a string of the form name=value and, if the</FONT>
<BR><FONT SIZE=2> string is present, returns a pointer to the value in the</FONT>
<BR><FONT SIZE=2> current environment.</FONT>
</P>
<P><FONT SIZE=2>RETURN VALUES</FONT>
<BR><FONT SIZE=2> If successful, getenv() returns a pointer to the value in</FONT>
<BR><FONT SIZE=2> the current environment; otherwise, it returns a null</FONT>
<BR><FONT SIZE=2> pointer.</FONT>
</P>
<P><FONT SIZE=2>USAGE</FONT>
<BR><FONT SIZE=2> The getenv() function can be safely called from a mul-</FONT>
<BR><FONT SIZE=2> tithreaded application. Care must be exercised when using</FONT>
<BR><FONT SIZE=2> both getenv() and putenv(3C) in a multithreaded applica-</FONT>
<BR><FONT SIZE=2> tion. These functions examine and modify the environment</FONT>
<BR><FONT SIZE=2> list, which is shared by all threads in an application.</FONT>
<BR><FONT SIZE=2> The system prevents the list from being accessed simultane-</FONT>
<BR><FONT SIZE=2> ously by two different threads. It does not, however,</FONT>
<BR><FONT SIZE=2> prevent two threads from successively accessing the environ-</FONT>
<BR><FONT SIZE=2> ment list using getenv() or putenv(3C).</FONT>
</P>
<P><FONT SIZE=2>ATTRIBUTES</FONT>
<BR><FONT SIZE=2> See attributes(5) for descriptions of the following attri-</FONT>
<BR><FONT SIZE=2> butes:</FONT>
</P>
<P><FONT SIZE=2> ____________________________________________________________</FONT>
<BR><FONT SIZE=2> | ATTRIBUTE TYPE | ATTRIBUTE VALUE |</FONT>
<BR><FONT SIZE=2> |_____________________________|_____________________________|</FONT>
<BR><FONT SIZE=2> | MT-Level | Safe |</FONT>
<BR><FONT SIZE=2> |_____________________________|_____________________________|</FONT>
</P>
<P><FONT SIZE=2>SEE ALSO</FONT>
<BR><FONT SIZE=2> exec(2), putenv(3C), attributes(5), environ(5)</FONT>
</P>
<P><FONT SIZE=2>SunOS 5.8 Last change: 29 Dec 1996 1</FONT>
<BR><FONT SIZE=2>=================================================================</FONT>
<BR><FONT SIZE=2>Standard C Library Functions putenv(3C)</FONT>
</P>
<P><FONT SIZE=2>NAME</FONT>
<BR><FONT SIZE=2> putenv - change or add value to environment</FONT>
</P>
<P><FONT SIZE=2>SYNOPSIS</FONT>
<BR><FONT SIZE=2> #include <stdlib.h></FONT>
</P>
<P><FONT SIZE=2> int putenv(char *string);</FONT>
</P>
<P><FONT SIZE=2>DESCRIPTION</FONT>
<BR><FONT SIZE=2> The putenv() function makes the value of the environment</FONT>
<BR><FONT SIZE=2> variable name equal to value by altering an existing vari-</FONT>
<BR><FONT SIZE=2> able or creating a new one. In either case, the string</FONT>
<BR><FONT SIZE=2> pointed to by string becomes part of the environment, so</FONT>
<BR><FONT SIZE=2> altering the string will change the environment.</FONT>
</P>
<P><FONT SIZE=2> The string argument points to a string of the form</FONT>
<BR><FONT SIZE=2> name=value. The space used by string is no longer used once</FONT>
<BR><FONT SIZE=2> a new string-defining name is passed to putenv().</FONT>
</P>
<P><FONT SIZE=2> The putenv() function uses malloc(3C) to enlarge the</FONT>
<BR><FONT SIZE=2> environment.</FONT>
</P>
<P><FONT SIZE=2> After putenv() is called, environment variables are not in</FONT>
<BR><FONT SIZE=2> alphabetical order.</FONT>
</P>
<P><FONT SIZE=2>RETURN VALUES</FONT>
<BR><FONT SIZE=2> The putenv() functions returns a non-zero value if it was</FONT>
<BR><FONT SIZE=2> unable to obtain enough space using malloc(3C) for an</FONT>
<BR><FONT SIZE=2> expanded environment. Otherwise, 0 is returned.</FONT>
</P>
<P><FONT SIZE=2>ERRORS</FONT>
<BR><FONT SIZE=2> The putenv() function may fail if:</FONT>
</P>
<P><FONT SIZE=2> ENOMEM</FONT>
<BR><FONT SIZE=2> Insufficient memory was available.</FONT>
</P>
<P><FONT SIZE=2>USAGE</FONT>
<BR><FONT SIZE=2> The putenv() function can be safely called from mul-</FONT>
<BR><FONT SIZE=2> tithreaded programs. Caution must be exercised when using</FONT>
<BR><FONT SIZE=2> this function and getenv(3C) in multithreaded programs.</FONT>
<BR><FONT SIZE=2> These functions examine and modify the environment list,</FONT>
<BR><FONT SIZE=2> which is shared by all threads in a program. The system</FONT>
<BR><FONT SIZE=2> prevents the list from being accessed simultaneously by two</FONT>
<BR><FONT SIZE=2> different threads. It does not, however, prevent two</FONT>
<BR><FONT SIZE=2> threads from successively accessing the environment list</FONT>
<BR><FONT SIZE=2> using putenv() or getenv().</FONT>
</P>
<P><FONT SIZE=2>ATTRIBUTES</FONT>
<BR><FONT SIZE=2> See attributes(5) for descriptions of the following attri-</FONT>
<BR><FONT SIZE=2> butes:</FONT>
</P>
<P><FONT SIZE=2>SunOS 5.8 Last change: 12 Jan 1998 1</FONT>
</P>
<P><FONT SIZE=2>Standard C Library Functions putenv(3C)</FONT>
</P>
<P><FONT SIZE=2> ____________________________________________________________</FONT>
<BR><FONT SIZE=2> | ATTRIBUTE TYPE | ATTRIBUTE VALUE |</FONT>
<BR><FONT SIZE=2> |_____________________________|_____________________________|</FONT>
<BR><FONT SIZE=2> | MT-Level | Safe |</FONT>
<BR><FONT SIZE=2> |_____________________________|_____________________________|</FONT>
</P>
<P><FONT SIZE=2>SEE ALSO</FONT>
<BR><FONT SIZE=2> exec(2), getenv(3C), malloc(3C), attributes(5), environ(5)</FONT>
</P>
<P><FONT SIZE=2>WARNINGS</FONT>
<BR><FONT SIZE=2> The string argument should not be an automatic variable. It</FONT>
<BR><FONT SIZE=2> should be declared static if it is declared within a func-</FONT>
<BR><FONT SIZE=2> tion because it cannot be automatically declared. A poten-</FONT>
<BR><FONT SIZE=2> tial error is to call putenv() with a pointer to an</FONT>
<BR><FONT SIZE=2> automatic variable as the argument and to then exit the cal-</FONT>
<BR><FONT SIZE=2> ling function while string is still part of the environment.</FONT>
</P>
<P><FONT SIZE=2>SunOS 5.8 Last change: 12 Jan 1998 2</FONT>
</P>
<BR>
</BODY>
</HTML>