Re: sysctl semantics for KERN_PROC_PID
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jan 29, 2009, at 1:50 PM, Rohitash Panda wrote: sysctl(mib, 4, &kp, &len, NULL, 0); Hello, Just use if(kill(somePid,0)==0) { //process for pid is running } You have a man 2 kill Cheers, M _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Hi, I am trying to check the existence of a process through sysctl ( CTL_KERN ) . I am using the below construct : mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; In the case that the pid is not around , what's the documented return value for sysctl , -1 or 0 , for Mac OS X 10.5 ? Is the behaviour same for Mac OS X 10.4 too ? This email sent to site_archiver@lists.apple.com
participants (1)
-
A.M.