Ant Pace(deleted)
|
Re: Current process printf
|
Ant Pace(deleted)
06/03/2008 12:55 PM
post8705
|
Re: Current process printf
Ah! I have found __progname which gives me a name. I think it is the name of the process.
|
|
|
Aleksandar Ristovski(deleted)
|
Re: Current process printf
|
Aleksandar Ristovski(deleted)
06/03/2008 12:56 PM
post8706
|
Re: Current process printf
Ant Pace wrote:
> No I am sure that the code is working as expected I just want to develop it further and don't know which process is
running that code. When I use pidin I see the short name, eg opt/bin/antcode. That is the information I want. If I
had written the code then I would know in which process it is running, but it is adopted code. I want to know which
process it is so that I can attach to the process with the debugger.
>
Then sorry, I do not understand what you are asking.
To try to just answer the question: in your main, you can do
printf("%s\n", argv[0])
and get the binary path.
But what confuses me is, if you can put printf in your code, compile it into a binary and run it, then how come you
don't know which process is running that piece of code... if you could clarify a bit what exactly you are trying to do,
maybe I could help.
|
|
|