Solved Is getenv a myth?

My final question for the year 2015 or (until next week). Would anyone have an example of how to use getenv for FreeBSD. It doesn’t seem to exist, other than for a few ports that creates its own. This is another dedicated search that turn up nothing for FreeBSD. I ask myself many times, why?
https://www.mirbsd.org/htman/i386/man3/getenv.htm

setenv and unsetenv are straight forward, but getenv seems to be a myth.

If I got many environment running, and I want to close a single environment; I first want to fetch the correct environment and operate on it before sunsetting that environment. How do I force getenv to show what it can do?
Code:
setenv /my_environment I might have 10 of env of all types  open and I want to use local commands, not global commands for each of them.  Hosing the system brings upon many unsolved issues.   I have been there to many times.

getenv /my_environment maybe I want to give the kernel some additional procedures before closing.

unsetenv /my_environment now it’s safer to close or at least it will provide me, peace of mind.
 
getenv(3) is a C library function and is used by a lot of programs. You can get the value of an environment variable in your shell with e.g. echo $PATH or printenv PATH. Your shell uses getenv(3) under the hood for this.
 
getenv(3) is a C library function and is used by a lot of programs. You can get the value of an environment variable in your shell with e.g. echo $PATH or printenv PATH. Your shell uses getenv(3) under the hood for this.

I knew there was a coding connection but could not figure things out. Sometimes I have to be told. Thanks you tobik. I'm going to try for the 21st time to figure out how to use the SOLVE button. (Like Superman, we can't defeat everything.)

PS: I also skim a link that was talking about writing your own syscall(2), hinting at getenv(3). An another about getenv(3) beings deep inside the kernel. Now I can't find them but now I got the rest to work it out. Thanks again. It's enough to finish my 10.1 off.
 
Back
Top