public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* How o acheive this in C++
@ 2004-11-04  7:31 Lalit Seth
  2004-11-04  7:43 ` Ramana Radhakrishnan
  2004-11-15 11:58 ` Alex Vinokur
  0 siblings, 2 replies; 6+ messages in thread
From: Lalit Seth @ 2004-11-04  7:31 UTC (permalink / raw)
  To: gcc-help

Hi,

1) how do i get the PID from a process of which i know the name only

2) how can i send a signal to a process of which I have the PID

I wanted this information from C++ Code not from shell.

Many Thanks

_________________________________________________________________
Send Money to India! Get a Mithai box.  
http://creative.mediaturf.net/creatives/icicibank/TOL.htm Win a FREE holiday 
in Goa.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How o acheive this in C++
  2004-11-04  7:31 How o acheive this in C++ Lalit Seth
@ 2004-11-04  7:43 ` Ramana Radhakrishnan
  2004-11-15 11:58 ` Alex Vinokur
  1 sibling, 0 replies; 6+ messages in thread
From: Ramana Radhakrishnan @ 2004-11-04  7:43 UTC (permalink / raw)
  To: Lalit Seth; +Cc: gcc-help

Hi,

<snip>

man proc
man kill
man raise
man signal

Also, not the right list to ask about Unix system programming. This is 
the place for more about using and building GCC .

cheers
Ramana

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How o acheive this in C++
  2004-11-04  7:31 How o acheive this in C++ Lalit Seth
  2004-11-04  7:43 ` Ramana Radhakrishnan
@ 2004-11-15 11:58 ` Alex Vinokur
  1 sibling, 0 replies; 6+ messages in thread
From: Alex Vinokur @ 2004-11-15 11:58 UTC (permalink / raw)
  To: gcc-help


"Lalit Seth" <laalit_seth@hotmail.com> wrote in message news:BAY2-F24coCru4efxId000194d6@hotmail.com...
> Hi,
>
> 1) how do i get the PID from a process of which i know the name only
>
> 2) how can i send a signal to a process of which I have the PID
>
> I wanted this information from C++ Code not from shell.
>
[snip]

Via popen().

-- 
 Alex Vinokur
     email: alex DOT vinokur AT gmail DOT com
     http://mathforum.org/library/view/10978.html
     http://sourceforge.net/users/alexvn




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How o acheive this in C++
  2004-11-04  7:53 Lalit Seth
@ 2004-11-04  8:39 ` Sriharsha Vedurmudi
  0 siblings, 0 replies; 6+ messages in thread
From: Sriharsha Vedurmudi @ 2004-11-04  8:39 UTC (permalink / raw)
  To: Lalit Seth, gcc-help

Absoultely, not the right list.

Anyway try it using the tee command and capture the output into a file. Alternatively, you can write it as a script and run the system on 
the script.

Harsha.

Lalit Seth wrote:
> 
> Thanks for Reply.
> 
> What i wanted is to make call from C++.
> like
> retval = System("ps -ale");
> 
> But this prints the result on console.
> 
> I wanted some how i can get that back in some variable/structure in C++.
> 
>> From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>> To: Lalit Seth <laalit_seth@hotmail.com>
>> CC: gcc-help@gcc.gnu.org
>> Subject: Re: How o acheive this in C++
>> Date: Thu, 04 Nov 2004 13:13:24 +0530
>>
>> Hi,
>>
>> <snip>
>>
>> man proc
>> man kill
>> man raise
>> man signal
>>
>> Also, not the right list to ask about Unix system programming. This is 
>> the place for more about using and building GCC .
>>
>> cheers
>> Ramana
>>
> 
> _________________________________________________________________
> Mergers, takeovers, buyouts. Get all the latest biz bytes. 
> http://www.msn.co.in/business/ Tune in to MSN Business!
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How o acheive this in C++
@ 2004-11-04  7:53 Lalit Seth
  2004-11-04  8:39 ` Sriharsha Vedurmudi
  0 siblings, 1 reply; 6+ messages in thread
From: Lalit Seth @ 2004-11-04  7:53 UTC (permalink / raw)
  To: ramana.radhakrishnan; +Cc: gcc-help


Thanks for Reply.

What i wanted is to make call from C++.
like
retval = System("ps -ale");

But this prints the result on console.

I wanted some how i can get that back in some variable/structure in C++.
>From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com>
>To: Lalit Seth <laalit_seth@hotmail.com>
>CC: gcc-help@gcc.gnu.org
>Subject: Re: How o acheive this in C++
>Date: Thu, 04 Nov 2004 13:13:24 +0530
>
>Hi,
>
><snip>
>
>man proc
>man kill
>man raise
>man signal
>
>Also, not the right list to ask about Unix system programming. This is the 
>place for more about using and building GCC .
>
>cheers
>Ramana
>

_________________________________________________________________
Mergers, takeovers, buyouts. Get all the latest biz bytes. 
http://www.msn.co.in/business/ Tune in to MSN Business!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How o acheive this in C++
@ 2004-11-04  7:31 Lalit Seth
  0 siblings, 0 replies; 6+ messages in thread
From: Lalit Seth @ 2004-11-04  7:31 UTC (permalink / raw)
  To: gcc-help

Hi,

1) how do i get the PID from a process of which i know the name only

2) how can i send a signal to a process of which I have the PID

I wanted this information from C++ Code not from shell.

Many Thanks

_________________________________________________________________
Millions of active and validated profiles.  
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Find your match on 
BharatMatrimony.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-15 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-04  7:31 How o acheive this in C++ Lalit Seth
2004-11-04  7:43 ` Ramana Radhakrishnan
2004-11-15 11:58 ` Alex Vinokur
  -- strict thread matches above, loose matches on Subject: below --
2004-11-04  7:53 Lalit Seth
2004-11-04  8:39 ` Sriharsha Vedurmudi
2004-11-04  7:31 Lalit Seth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).