[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 6/8] kern: implement task_set_name
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 6/8] kern: implement task_set_name |
Date: |
Sat, 1 Feb 2014 15:27:42 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Sat 01 Feb 2014 15:09:26 +0100, a écrit :
> @@ -1071,6 +1072,21 @@ task_priority(
> }
>
> /*
> + * task_set_name
> + *
> + * Set the name of task TASK to NAME. This is a debugging aid.
> + * NAME will be used in error messages printed by the kernel.
> + */
> +kern_return_t
> +task_set_name(
> + task_t task,
> + kernel_debug_name_t name)
> +{
> + strncpy(task->name, name, sizeof task->name);
Rather make sure that there is a trailing \0, so the rest of the source
code doesn't have to take care about that.
> + return KERN_SUCCESS;
> +}
> +
> +/*
> * task_collect_scan:
> *
> * Attempt to free resources owned by tasks.
> diff --git a/kern/task.h b/kern/task.h
> index 7ae10cd..3c10dc0 100644
> --- a/kern/task.h
> +++ b/kern/task.h
> @@ -39,6 +39,7 @@
> #include <mach/time_value.h>
> #include <mach/mach_param.h>
> #include <mach/task_info.h>
> +#include <mach_debug/mach_debug_types.h>
> #include <kern/kern_types.h>
> #include <kern/lock.h>
> #include <kern/queue.h>
> @@ -169,6 +170,9 @@ extern kern_return_t task_assign(
> extern kern_return_t task_assign_default(
> task_t task,
> boolean_t assign_threads);
> +extern kern_return_t task_set_name(
> + task_t task,
> + kernel_debug_name_t name);
> extern void consider_task_collect(void);
>
> /*
> --
> 1.8.5.2
>
--
Samuel
>bah moi j'aime bien le flash et je cherche plus a comprendre
>crosoft. Ca plante : je reinstalle
Ca à le mérite de créer des emplois jeunes : "réinstalleur de crosoft"
-+- BD in NPC : Bill Gates au secours de l'emploi -+-
- Re: [PATCH 2/8] kern: add snprintf, (continued)
- [PATCH 4/8] ipc: use the name of the task for error messages, Justus Winter, 2014/02/01
- [PATCH 3/8] kern: add a name field to struct task, Justus Winter, 2014/02/01
- [PATCH 7/8] include: add task_set_name, Justus Winter, 2014/02/01
- [PATCH 5/8] include: add a fixed-size string type for debugging purposes, Justus Winter, 2014/02/01
- [PATCH 6/8] kern: implement task_set_name, Justus Winter, 2014/02/01
- Re: [PATCH 6/8] kern: implement task_set_name,
Samuel Thibault <=
[PATCH 8/8] doc: document task_set_name, Justus Winter, 2014/02/01
Re: [PATCH 1/8] kern: fix printing of kmem_cache names, Samuel Thibault, 2014/02/01