Get the current status of the current thread in the process associated with the file descriptor. The argument is a pointer to a procfs_status structure (see debug_thread_t in <sys/debug.h>) that's filled in with the required information on return. For example:

procfs_status my_status;

devctl( fd, DCMD_PROC_STATUS, &my_status, sizeof(my_status),
Note: If the current thread no longer exists, the process manager returns information about the one with the next higher thread ID. If all the process's threads have exited, the tid member of the procfs_status structure is set to 0.

For more information about the contents of this structure, see "Thread information," earlier in this chapter.