>I have been studying ptrace(2) on the Unix systems (I have studied it on >Debian and OpenBSD so far). On all the systems I have tried there is a >request flag that allows for a given process to attach itself to some >other running process (given that other process is not setuid and has >the same uid as the attacher). Opensolaris' manual pages doesn't say >anything about such a request.
Ptrace is dead in Solaris; truss doesn't use ptrace neither does mdb/dbx. >Opensolaris' ptrace(3C) manual page says that ptrace isn't even a system >call in solaris. It is build using some /proc interface. Further >investigation showed me that gdb is able to attach itself to a running >process (actually, two gdbs are able to attach itself to the same >process, something that's impossible on Linux and OpenBSD). Where can I >read up on that /proc interface? So, it allows for more than one process >attach to a single process? See proc(4). You open the appropriate files under /proc/<pid>, particularly, "ctl" and /proc/<pid>/lwp/<tid>/lwpctl >On a related topic, is it possible to change the behaviour of programs >using dtrace (like you can with ptrace) or is it read-only? Does it use >those /proc features as well? Use /proc which doesn't require any privileges; dtrace, especially when you want to modify data, requires privileges. Modifying data is easy through the "as" file; to change registers you'll need to write a specific control message. Casper _______________________________________________ opensolaris-discuss mailing list [email protected]
