[plt-scheme] current process id

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Feb 5 14:32:55 EST 2004

On Feb  5, David J. Neu wrote:
> Hi all,
> I'm wondering if there is a way to determine the current process id
> from within a mzscheme program?

I don't think that there is any way to do it completely from inside
MzScheme (it would probably be a useful extension).  Anyway, if you're
using Linux, a simple way to get the current pid is:

  (string->number (resolve-path "/proc/self"))

I found similar tricks for Sun (cd into /proc/self, then check the
current directory), and FreeBSD (use "/proc/curproc").

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.