comp.lang.ada
 help / color / mirror / Atom feed
From: demer@hc17031.hcsd.ca (David Emery)
Subject: Re: How to query active processes from Ada
Date: 1997/01/06
Date: 1997-01-06T00:00:00+00:00	[thread overview]
Message-ID: <c4loa6mz6x.fsf@hc17031.hcsd.ca> (raw)
In-Reply-To: 5aj97p$a9m@news.spar.ca


The short answer is to send SIGNULL to the process with kill().  

Naturally this is supported by POSIX/Ada:
	
	with POSIX, POSIX_Signals, POSIX_Process_Identification;
	function Process_Exists 
	  (Pid : in Posix_Process_Identification.Process_Id) 
		return Boolean is
        begin
	   POSIX_Signals.Send_Signal
	     (Process => Pid,
	      Sig => POSIX_Signals.Signal_Null);
	   -- returns normally if Process exists.  
	   -- if process does not exist, or is not 'killable' by the
	   -- caller, raises POSIX_Error.
	   return True;
	exception
           when POSIX.POSIX_Error =>
	       return False;
	   when others =>
	        raise;
 	end Process_Exists;
	

				dave
-- 
<.sig is away on vacation>





      parent reply	other threads:[~1997-01-06  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-03  0:00 How to query active processes from Ada James d'Eon
1997-01-03  0:00 ` Ted Dennison
1997-01-03  0:00 ` Christopher Green
1997-01-06  0:00 ` David Emery [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox