NAME
task_info - gets task machine independent information

SYNOPSIS
#include <mach.h>

/* the definition of task_info_t from mach.h - sys/task_info.h is */

typedef int *task_info_t; /* variable length array of int */

/* currently the only interpretation of info is */

struct task_basic_info {
int suspend_count; /* suspend count for task */
vm_size_t virtual_size; /* number of virtual pages */
vm_size_t resident_size; /* number of resident pages */
time_value_t user_time; /* total user run time for
terminated threads */
time_value_t system_time; /* total system run time for
terminated threads */
};
typedef struct task_basic_info *task_basic_info_t;

kern_return_t task_info(target_task, flavor, task_info, task_infoCnt)
task_t target_task;
int flavor;
task_info_t task_info; /* in and out */
unsigned int *task_infoCnt; /* in and out */

ARGUMENTS
target_task The task to be affected.

flavor The type of statistics that are wanted. Currently
only TASK_BASIC_INFO is implemented.

task_info Statistics about the task specified by target_task.

task_infoCnt Size of the info structure. Currently only
TASK_BASIC_INFO_COUNT is implemented.

DESCRIPTION
Returns the selected information array for a task, as specified by
flavor. task_info is an array of integers that is supplied by the
caller, and filled with specified information. task_infoCnt is
supplied as the maximum number of integers in task_info. On return,
it contains the actual number of integers in task_info.

Currently there is only one flavor of information which is defined
by TASK_BASIC_INFO. Its size is defined by TASK_BASIC_INFO_COUNT.

DIAGNOSTICS
KERN_SUCCESS The call succeeded.

KERN_INVALID_ARGUMENT target_task is not a task or flavor
is not recognized.

MIG_ARRAY_TOO_LARGE Returned info array is too large for
task_info. task_info is filled as
much as possible. task_infoCnt is
set to the number of elements that
would be returned if there were
enough room.

SEE ALSO
task_special_ports(2), task_threads(2), thread_info(2),
thread_state(2)