Reading Environment Variables

I get the idea that after the process reads and creates the environ
variable, I can’t make any command-line changes to environment variables
propagate into the process. Is that right? It looks like only the program
calls like setenv() will update environ. I’m using QNX 6.1.

Thanks,
David Kuechenmeister

P.S. I’ve had a hard time connecting to the news server over the past
several weeks. Should I be checking my end, or have others had the same
problem?
…drk

Something similar to this came up for me recently wrt changing the cwd of a
process after it had started. If it were to be possible, the kernel would
have to supply a debug interface to do this. Currently there is no
mechanism for either thing. If you were to look at the source code to
pidin, you would see how the environment and args can be read from a running
process (see Environment and Arguments in pidin_proc.c). I don’t know if
it’s possible but you MIGHT be able to open the fd read/write and modify the
environment in a running process. I wouldn’t bet on it and it would be a
huge hack…pretty cool if it worked though.

cheers,

Kris

“David Kuechenmeister” <david.kuechenmeister@viasat.com> wrote in message
news:b83v5u$cuf$1@inn.qnx.com

I get the idea that after the process reads and creates the environ
variable, I can’t make any command-line changes to environment variables
propagate into the process. Is that right? It looks like only the program
calls like setenv() will update environ. I’m using QNX 6.1.

Thanks,
David Kuechenmeister

P.S. I’ve had a hard time connecting to the news server over the past
several weeks. Should I be checking my end, or have others had the same
problem?
.drk

Thanks, sounds like it would be worth a look.

David

“Kris Warkentin” <kewarken@qnx.com> wrote in message
news:b84184$p3r$1@nntp.qnx.com

Something similar to this came up for me recently wrt changing the cwd of
a
process after it had started. If it were to be possible, the kernel would
have to supply a debug interface to do this. Currently there is no
mechanism for either thing. If you were to look at the source code to
pidin, you would see how the environment and args can be read from a
running
process (see Environment and Arguments in pidin_proc.c). I don’t know if
it’s possible but you MIGHT be able to open the fd read/write and modify
the
environment in a running process. I wouldn’t bet on it and it would be a
huge hack…pretty cool if it worked though.

cheers,

Kris

“David Kuechenmeister” <> david.kuechenmeister@viasat.com> > wrote in message
news:b83v5u$cuf$> 1@inn.qnx.com> …
I get the idea that after the process reads and creates the environ
variable, I can’t make any command-line changes to environment variables
propagate into the process. Is that right? It looks like only the
program
calls like setenv() will update environ. I’m using QNX 6.1.

Thanks,
David Kuechenmeister

P.S. I’ve had a hard time connecting to the news server over the past
several weeks. Should I be checking my end, or have others had the same
problem?
.drk
\