It's not current_thread() (a pointer), it's a 64-bit non-repeating thread ID (thread_tid(current_thread())) What information are you trying to get? You can try using proc_info(PROC_PIDTHREADID64INFO). Shantonu On May 14, 2012, at 12:21 PM, James Boulton <james.boulton@eiconic.com> wrote:
I'm using sysctl / KERN_KDGETBUF to get some profiling information and arg5 of the kd_buf structure returned is the currently executing thread (as returned by current_thread() in the XNU kernel).
I'm trying to figure out how to use this thread id to get some useful details about the thread, but I cant seem to figure out how to do this.
If I try and use the value with any standard thread functions I get an error of MACH_SEND_INVALID_DEST. I assume this value is a kernel thread id of some kind (it doesnt appear to be a pointer) and not a mach port. It looks like I should be using something like thread_get_kernel_port to get the send right to the thread, but this also comes back with MACH_SEND_INVALID_DEST.
Any kernel guru's out there, I'd really appreciate some help! :o)
Cheers, -- James _______________________________________________ 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: https://lists.apple.com/mailman/options/darwin-kernel/ssen%40apple.com
This email sent to ssen@apple.com
_______________________________________________ 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: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com