Perform a ThreadCtl() on another process/thread. The argument is a pointer to a procfs_threadctl structure. For example:
procfs_threadctl tctl; tctl.tid = tid; tctl.cmd = _NTO_TCTL_NAME; tn = (struct _thread_name *)(&tctl.data); tn->name_buf_len = sizeof(tctl.data) - sizeof(*tn); //We can only communicate a maximum buffer size via devctl if( newname_len > tn->name_buf_len || prevname_len > tn->name_buf_len) { return E2BIG; } tn->new_name_len = newname_len; if(newname_len > 0) { memcpy(tn->name_buf, newname, newname_len); } devctl(fd, DCMD_PROC_THREADCTL, &tctl, sizeof(tctl), NULL);