Changeset 638927a in mainline for uspace/app/top/ps.c
- Timestamp:
- 2010-04-09T11:18:08Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e43cdac
- Parents:
- faf38b2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/ps.c
rfaf38b2 r638927a 58 58 }; 59 59 60 unsigned int get_tasks(task_info_t **out_infos)60 size_t get_tasks(task_info_t **out_infos) 61 61 { 62 int task_count = TASK_COUNT;62 size_t task_count = TASK_COUNT; 63 63 task_id_t *tasks = malloc(task_count * sizeof(task_id_t)); 64 int result = get_task_ids(tasks, sizeof(task_id_t) * task_count);64 size_t result = get_task_ids(tasks, sizeof(task_id_t) * task_count); 65 65 66 66 while (result > task_count) { … … 70 70 } 71 71 72 int i;72 size_t i; 73 73 task_info_t *taskinfos = malloc(result * sizeof(task_info_t)); 74 74 for (i = 0; i < result; ++i) { … … 82 82 } 83 83 84 thread_info_t *get_threads(task_id_t taskid)84 size_t get_threads(thread_info_t **thread_infos) 85 85 { 86 int thread_count = THREAD_COUNT;86 size_t thread_count = THREAD_COUNT; 87 87 thread_info_t *threads = malloc(thread_count * sizeof(thread_info_t)); 88 int result = get_task_threads(threads, sizeof(thread_info_t) * thread_count);88 size_t result = get_task_threads(threads, sizeof(thread_info_t) * thread_count); 89 89 90 90 while (result > thread_count) { … … 94 94 } 95 95 96 return threads; 96 *thread_infos = threads; 97 return result; 97 98 } 98 99
Note:
See TracChangeset
for help on using the changeset viewer.