Permalink
Browse files

use ParrotInterpreter.getpid for PID

Fixes [perl #77850] and TT #1817 if no problem arises from it
  • Loading branch information...
1 parent 500089c commit 2865b9d7109cfb58e9ff47a7087b85a0d22e271e @moritz moritz committed Dec 15, 2010
Showing with 7 additions and 18 deletions.
  1. +3 −0 docs/ChangeLog
  2. +4 −18 src/cheats/process.pm
View
@@ -1,3 +1,6 @@
+New in 2010.12 release
++ fixed $*PID on MacOS X
+
New in 2010.11 release
+ now works with parrot on git
+ implemented qw//
View
@@ -44,26 +44,12 @@ package PROCESS {
$P0 = info
set_hll_global ['PROCESS'], '$OS', $P0
- ## Set up $*PID. Parrot doesn't give us the PID for now.
- ## idea: http://irclog.perlgeek.de/parrot/2010-04-19#i_2242900
- ## Well, this file *is* in the cheats directory... :-)
- .local pmc library
- .local string getpid_func
- null library
- getpid_func = 'getpid'
- if info != 'MSWin32' goto setup_io_non_MSWin32
- ## Do it differently on Windows
- library = loadlib 'kernel32'
- getpid_func = 'GetCurrentProcessId'
- setup_io_non_MSWin32:
- $P0 = dlfunc library, getpid_func, 'i'
- $I0 = 0
- unless $P0 goto setup_io_no_getpid_func
- $I0 = $P0()
- setup_io_no_getpid_func:
+ # getpid() is still experimental:
+ # http://trac.parrot.org/parrot/ticket/1564
+ $P1 = getinterp
+ $I0 = $P1.'getpid'()
$P0 = box $I0
set_hll_global ['PROCESS'], '$PID', $P0
- ## Parrot request: http://trac.parrot.org/parrot/ticket/1564
}
}
}

0 comments on commit 2865b9d

Please sign in to comment.