MCPcopy Create free account
hub / github.com/apache/nuttx / nxtask_setup_name

Function nxtask_setup_name

sched/task/task_setup.c:737–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735
736#if CONFIG_TASK_NAME_SIZE > 0
737void nxtask_setup_name(FAR struct tcb_s *tcb, FAR const char *name)
738{
739 FAR char *dst = tcb->name;
740 int i;
741
742 /* Give a name to the unnamed tasks */
743
744 if (!name)
745 {
746 name = (FAR char *)g_noname;
747 }
748
749 /* Copy the name into the TCB */
750
751 for (i = 0; i < CONFIG_TASK_NAME_SIZE; i++)
752 {
753 char c = *name++;
754
755 if (c == '\0')
756 {
757 break;
758 }
759
760 *dst++ = isspace(c) ? '_' : c;
761 }
762
763 *dst = '\0';
764}
765#endif /* CONFIG_TASK_NAME_SIZE */

Callers 2

nxtask_setup_forkFunction · 0.85
nxtask_initFunction · 0.85

Calls 1

isspaceFunction · 0.50

Tested by

no test coverage detected