Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site persci.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!tikal!cholula!persci!bill From: bill@persci.UUCP Newsgroups: net.unix,net.unix-wizards Subject: Reading environments in C (I need some help) Message-ID: <177@persci.UUCP> Date: Wed, 15-May-85 19:29:00 EDT Article-I.D.: persci.177 Posted: Wed May 15 19:29:00 1985 Date-Received: Fri, 17-May-85 00:08:04 EDT Organization: Personal Scientific, Woodinville WA Lines: 17 Xref: watmath net.unix:4521 net.unix-wizards:13188 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