diff -ur Proc-ProcessTable-0.41.orig/ProcessTable.pm Proc-ProcessTable-0.41/ProcessTable.pm --- Proc-ProcessTable-0.41.orig/ProcessTable.pm 2006-06-30 21:16:54.000000000 -0700 +++ Proc-ProcessTable-0.41/ProcessTable.pm 2006-09-04 17:48:25.375000000 -0700 @@ -4,7 +4,7 @@ use strict; use Carp; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); +use vars qw($XS_VERSION $VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); require Exporter; require DynaLoader; @@ -16,7 +16,9 @@ @EXPORT = qw( ); -$VERSION = '0.41'; +$VERSION = '0.41_01'; +$XS_VERSION = $VERSION; +$VERSION = eval $VERSION; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() @@ -39,7 +41,7 @@ goto &$AUTOLOAD; } -bootstrap Proc::ProcessTable $VERSION; +bootstrap Proc::ProcessTable $XS_VERSION; # Preloaded methods go here. use Proc::ProcessTable::Process; diff -ur Proc-ProcessTable-0.41.orig/os/cygwin.c Proc-ProcessTable-0.41/os/cygwin.c --- Proc-ProcessTable-0.41.orig/os/cygwin.c 2006-06-28 21:05:54.000000000 -0700 +++ Proc-ProcessTable-0.41/os/cygwin.c 2006-09-04 17:44:24.859375000 -0700 @@ -26,6 +26,8 @@ #include "os/cygwin.h" +#define ARG_MAX 4096 + typedef BOOL (WINAPI *ENUMPROCESSMODULES)( HANDLE hProcess, // handle to the process HMODULE * lphModule, // array to receive the module handles @@ -250,12 +252,32 @@ p->uid32 : p->uid)); } + char fields[] = "iiiiisIisS"; + if (query == CW_GETPINFO) { - fields = "iiiiisiis"; - } else { - fields = "iiiiisIis"; + fields[6] = tolower(fields[6]); } + char cmndline[ARG_MAX] = ""; + FILE *fp; + char pathbuf[MAX_PATH]; + + /* get stuff out of /proc/PROC_ID/cmdline */ + sprintf(pathbuf, "%s%s%s", "/proc/", p->pid, "/cmdline"); + if( (fp = fopen( pathbuf, "r" )) != NULL ){ + size_t got; + if( (got = fread(cmndline, sizeof(char), ARG_MAX, fp)) > 0 ){ + size_t i; + for(i = 0; i < got; i++){ + if( cmndline[i] == '\0' ) cmndline[i] = ' '; + } + cmndline[got] = '\0'; /* necessary? */ + + fields[9] = tolower(fields[9]); + } + fclose(fp); + } + bless_into_proc(fields, Fields, p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? p->uid32 : p->uid, @@ -266,7 +288,8 @@ pname, p->start_time, p->ctty, - pstate + pstate, + cmndline ); } @@ -280,4 +303,3 @@ return NULL; } - diff -ur Proc-ProcessTable-0.41.orig/os/cygwin.h Proc-ProcessTable-0.41/os/cygwin.h --- Proc-ProcessTable-0.41.orig/os/cygwin.h 2003-05-19 09:35:17.000000000 -0700 +++ Proc-ProcessTable-0.41/os/cygwin.h 2006-09-04 17:01:39.328125000 -0700 @@ -8,4 +8,5 @@ "start", "ttynum", "state", + "cmndline", };