Path: utzoo!mnetor!uunet!mcvax!enea!zyx!aj From: aj@zyx.UUCP (Arndt Jonasson) Newsgroups: comp.unix.wizards Subject: Re: ptrace in unix tracing non-child processes Message-ID: <2475@zyx.UUCP> Date: 14 Apr 88 09:39:42 GMT References: <352@tandem.UUCP> <10996@mimsy.UUCP> <10224@tut.cis.ohio-state.edu> <49161@sun.uucp> Reply-To: aj@zyx.UUCP (Arndt Jonasson) Organization: ZYX Sweden AB, Stockholm, Sweden Lines: 22 In article <49161@sun.uucp> brent%terra@Sun.COM (Brent Callaghan) writes: >SunOs ptrace() has this facility. You can give it a pid with >the PTRACE_ATTACH request and attach to another process. The other >process must be one of "yours" i.e. same uid/gid. The process gets >a SIGSTOP. A PTRACE_DETACH is used to send the traced process on >it's way when you've lost interest. The HP-UX system for HP 9000 series 800 also has that facility (though the symbols are named PT_ATTACH and PT_DETACH). Btw, I recently posted my file openings trapper to comp.sources.misc (though it doesn't seem to have shown up yet). It also includes (undocumented) the current state of my options parser (which started the interesting discussion about option parsing). If anyone feels like porting the trapper to something other than HP-UX or Vax/4.2BSD, please send the changes back to me. [By writing this program, I got quite acquainted with the 'ptrace' call. Brrr, what a kludge it is..] -- Arndt Jonasson, ZYX Sweden AB, Styrmansgatan 6, 114 54 Stockholm, Sweden email address: aj@zyx.SE or !mcvax!enea!zyx!aj