----- Original Message ----- From: "Sampath Ravindhran" <[EMAIL PROTECTED]> To: <vmsperl@perl.org> Sent: 09 January 2005 02:47 Subject: use of waitpid
> > > I have a perl script that calls waitpid, that doesn't seem to work at > all on VMS. A simple test case like the following: > ---- > use POSIX ":sys_wait_h"; > > my $reap1 = waitpid("53CCDA08",&WNOHANG); > print "Exit = $?\n"; > print "REAP = $reap1\n"; > ------- > > simply prints out > --- > Exit = 256 > REAP = 53 > --- > regardless of whether the process with PID 53CCDA08 (in example above) > exists or not. Is it required that the targeted waitpid process be a > subprocess of the current process calling waitpid() ? > > On Unix platforms, they are able to 'reap' a process that has already > exited and get its final exit status? Is this feasible on VMS? If not, > how do I emulate this situation, other than the ugly method of having > the exiting application write it's status to a file on disk which I can > go in and check? (This is ugly because there's potential for this to > cause confusion, when sometimes the process could crash and can't write > out the exit status.) There is another factor on VMS. The privilege mask restricts access to other processes on the system. If the process has GROUP, it can operate on (and kill) processes in the same groupid. If it has SYSTEM, it can operate on any process. Hope this helps, Ivor.