site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On Mar 20, 2008, at 2:08 AM, Praveen Kumar wrote: The following code gives the current process name. struct proc *p = current_proc(); p->p_comm // contains current process name = Mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Tiger, it is working fine, but on leopard, p_comm is empty. Please let me know if there are alternate ways to get the current process name. Some unsolicited advice: do not use the process name for anything other than debugging purposes. In particular, do not make any decisions whatsoever based on the name that a given process might have. The name is not guaranteed to be unique, and it can be changed trivially. This email sent to site_archiver@lists.apple.com