Reading environments in C (I need some help)

bill at persci.UUCP bill at persci.UUCP
Thu May 16 09:29:00 AEST 1985


Here's a problem for you Unix (4.2BSD) gurus out there:

I would like to know how to create a utility (in C) that, given a
process i.d. number, is able to access (print) the environment for that
process. 'ps -e' does this, but the documentation is unclear as to how 
it does it. I have already spent some time on this, poring through code
I have examples for (ex: top.c) that appear to deal with related functions,
but there appears to be a gap in my available documentation (perhaps related
to the way 'csh' keeps the environment). We do not have sources for the
system's utilities like 'ps'.

Executing 'ps -e' is too slow for my purposes.

Any help you can provide, light you can shed, or pointers you can provide
will be gratefully accepted.
-- 
Bill Swan 	{ihnp4|decvax|allegra|...}!uw-beaver!tikal!persci!bill



More information about the Comp.unix mailing list