Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rtech.ARPA Path: utzoo!utcs!lsuc!pesnta!hplabs!amdahl!rtech!jas From: jas@rtech.ARPA (Jim Shankland) Newsgroups: net.unix-wizards Subject: re: ps problem (update on my previous posting) Message-ID: <130@rtech.ARPA> Date: Mon, 4-Feb-85 18:54:55 EST Article-I.D.: rtech.130 Posted: Mon Feb 4 18:54:55 1985 Date-Received: Thu, 7-Feb-85 08:36:02 EST References: <125@rruxo.UUCP> <1079@amdahl.UUCP> <129@rtech.ARPA> Organization: Relational Technology, Berkeley CA Lines: 27 > > ... ps(1) looks at stderr to figure out what the "controlling > > terminal" is. > > Gordon A. Moffett ...!{ihnp4,hplabs,sun}!amdahl!gam > > If this is true, it seems like a horrible hack to me. Surely ps could > get its notion of the controlling terminal from the proc table entry > for the ps process itself (it is, after all, already rooting around > in the proc table)? The notion of a controlling terminal is an attribute > of a process, and need not have any connection with what files that > process has open. > > Anybody know whether (1) Gordon is wrong; (2) Gordon is right, and I'm > right, so ps is just ugly; or (3) I've missed something? Rather than just asking, I thought I'd check, myself. First, a minor inaccuracy in my above posting: the control terminal information is stored in a process's u area, not in the proc table. However, ps looks in the u area of every process it displays, anyway. Second, ps by default does indeed display all processes whose control terminal is the same as file descriptor 2 (a.k.a. stderr). For the reasons given above, this strikes me as stupid. By the way, the source for ps would gag a goat. Also, none of this applies to the Berklix ps's. Jim Shankland ..!ucbvax!mtxinu!jas