[comp.unix.wizards] ptrace question

hartman@m.cs.uiuc.edu (07/24/88)

What is (is there) a difference between 'ptrace' under Berkeley UNIX and
under System V?  My SVR3 man page says something like "provides a means
by which a PARENT process may control the execution of a CHILD process".
The BSD entry says something more like "the execution of ANOTHER process".

I like the less restrictive, BSD definition better -- but is there really
a difference in functionality, and if so, why?

Also, any short examples demonstrating the use of 'ptrace' would be
appreciated.  Thanks.

-- 
Mark Hartman                    hartman@cs.uiuc.edu
                                ..uiucdcs!hartman

guy@gorodish.Sun.COM (Guy Harris) (07/26/88)

> What is (is there) a difference between 'ptrace' under Berkeley UNIX and
> under System V?

Little, if any.

> My SVR3 man page says something like "provides a means by which a PARENT
> process may control the execution of a CHILD process".  The BSD entry says
> something more like "the execution of ANOTHER process".
> 
> I like the less restrictive, BSD definition better -- but is there really
> a difference in functionality, and if so, why?

Yes, I like it too, but the only "other" processes that can be "ptrace"d in
4BSD are child processes; there really is no difference in functionality.
SunOS has an "attach" request that can be used to attach to other processes and
trace them, which comes in handy when debugging daemons, for instance.