On Wed, 2006-06-28 at 16:01 +0200, Petr Uzel wrote:
> Dne středa 28 červen 2006 15:51 Petr Uzel napsal(a):
> > Dne středa 28 červen 2006 15:04 Iain Buchanan napsal(a):
> > > Hi again :)
> > >
> > > I have been googling for this one for a little while, and trying various
> > > options, but I can't seem to find it:  How do I get the process from
> > > within a process in c or c++?
> > >
> > > I don't want to use argv[0], because the particular place is deep within
> > > classes, and there are too many (I'm doing some porting) to edit all of
> > > their constructors, for example, to pass argv[0].

> file /proc/self/status is a link pointing to the 
> directory /proc/pid_of_process. And by parsing status file in this directory 
> you should get all the informations you want.

great idea, thanks!
-- 
Iain Buchanan <iaindb at netspace dot net dot au>

In every non-trivial program there is at least one bug.

-- 
gentoo-user@gentoo.org mailing list

Reply via email to