Clint Adams wrote: >>- During the preload stage, fakeroot opens a socket/whatever to the >> daemon, and asks it to ptrace the process. It also passes the daemon >> the address of the symbol table. >> >> > >Is there a reason to preload a library for this instead of having a >program which establishes communication with faked and then ptraces its >child? > > It's theoretically possible to do it without a preload, but some things become much more difficult:
1. Without a "local agent", i.e. - without our code running in the program's context, several things become much more difficult and platform dependent. Things like changing parameters, calling the syscall and then changing the results back are somewhat hairy to do from another process. Things like turning a single syscall into several become an exercise in agility that will be very hard to perform in a cross-platform way. 2. Making sure we remain attached after fork and exec isn't trivial (though possible, I guess). As things stand, most of the cross-platform work we need to do can be copied, almost verbatim, from "strace". -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

