To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1555
1554  |  1556
Subject: 
Re: getpid?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 14 Dec 2000 16:57:57 GMT
Viewed: 
3468 times
  
On Thu, 14 Dec 2000, Pavel Petrovic wrote:

> this is not exactly what I meant. What I am looking for is how
> can a piece of code determine which process is currently executing
> it. something like:
[code snipped]

Ah, I understand. You could still use my method, but you'd have to pass
the pid in as a parameter to the functions that need to know it, which
would be ugly.

> the implementation of getpid() in the kernel should not
> be difficult, just return the id of currently executing
> process...?

Well, get hacking! ;)

--
"Say not, 'I have found the truth,' but rather, 'I have found a truth.'
"Say not, 'I have found the path of the soul.' Say rather, 'I have met the
soul walking upon my path.'" -- Khalil Gibran
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>



Message has 1 Reply:
  Re: getpid?
 
(...) The following patch will add both getpid() and getppid() to legOS: diff -u -r1.2 unistd.h --- include/unistd.h 2000/08/01 01:12:40 1.2 +++ include/unistd.h 2000/12/14 21:49:56 @@ -94,4 +94,7 @@ //! kill all processes with priority lower or (...) (26 years ago, 14-Dec-00, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: getpid?
 
(...) this is not exactly what I meant. What I am looking for is how can a piece of code determine which process is currently executing it. something like: main(...) ... create 2 processes with pid1, pid2 ... these processes occasionally call (...) (26 years ago, 14-Dec-00, to lugnet.robotics.rcx.legos)

7 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR