Re: Time Travel v1.0.

Anders Chrigstrom (ac@netg.se)
17 Jun 1998 15:49:00 +0200


In article <Pine.LNX.3.96.980611222949.2153A-100000$einstein.london.sco.com@lists.netg.se>,
Tigran Aivazian <tigran@sco.COM> wrote:
...
>Second, how are you going to discover that you are *the* particular
>program, i.e. the user-space version of current->comm?
>
>The only way I know of is argv[0] argument of main(), but assuming you
>have no source of the application how your time() patched libc is going to
>know who called it?

How about this:

char procname[40], current_comm[1024];

sprintf(procname, "/proc/%d/exe", getpid());
readlink(procname, current_comm, sizeof(current_comm));

/AndersC

-- 
--
Anders Chrigstrom               Email: ac@netg.se
TerraTel AB                       Tfn: +46 (0)31 50 79 40

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu