Date: Mon, 31 Aug 1998 19:08:58 -0500 (CDT) From: Joel Ray Holveck <joelh@gnu.org> To: bright@hotjobs.com Cc: matthew@wolfepub.com, hackers@FreeBSD.ORG Subject: Re: Environment of a process Message-ID: <199809010008.TAA11460@detlev.UUCP> In-Reply-To: <Pine.BSF.3.96.980831153925.17400E-100000@bright.fx.genx.net> (message from Alfred Perlstein on Mon, 31 Aug 1998 15:41:29 -0500 (EST)) References: <Pine.BSF.3.96.980831153925.17400E-100000@bright.fx.genx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>> Where does a process get its environment if it is not executed from the >> command line? I have a program that connects to a database and relies on >> several ENV VARS to be set. > man exec, look at: > int exect(const char *path, char *const argv[], char *const envp[]) > also note getenv(3), man 3 getenv You can also use setenv, preferably between the fork and exec. (There was recently a thread about a memory leak if this is done frequently, tho. I don't know the details.) Best, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809010008.TAA11460>