[plt-scheme] Re: current process id
David J. Neu wrote:
> I thought I'd try to write an extension to get the current process id.
> Here's what I came up with by adapting one of the examples provided in
> the mzscheme distribution. I've also included a test program.
You could save some typing using the C-FFI.
;; getpid.ss
(module getpid mzscheme
(require (lib "cffi.ss" "compiler"))
(provide getpid) ;; () -> integer
(define getpid
(c-lambda () int "getpid")))
mzc --auto-dir $PLTHOME/collects/getpid/getpid.ss
mzscheme -L getpid.ss getpid -e '(display (getpid))'
David