|
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 (...) (24 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 (...) (24 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
|
|
|
|