Copyright (c) 2016 The FreeBSD Foundation, Inc. All rights reserved. This documentation was written by Konstantin Belousov <kib@FreeBSD.org> under sponsorship from the FreeBSD Foundation. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form...
NAMEthr_set_name - set user-visible thread name
SYNOPSISIn sys/thr.h Ft int Fn thr_set_name long id const char *name
DESCRIPTIONThe Fn thr_set_name sets the user-visible name for the kernel thread with the identifier id in the current process, to the NUL-terminated string name The thread name can be seen in the output of the ps(1) and top(1) commands, in the kernel debuggers and kernel tracing facility outputs, also in userland debuggers and program core files, as notes.
RETURN VALUESIf successful, Fn thr_set_name will return zero, otherwise -1 is returned, and errno is set to indicate the error.
ERRORSThe Fn thr_set_name operation may return the following errors:
- Bq Er EFAULT
- The memory pointed to by the Fa name argument is not valid.
- Bq Er ENAMETOOLONG
- The string pointed to by the Fa name argument exceeds MAXCOMLEN + 1 bytes in length.
- Bq Er ESRCH
- The thread with the identifier Fa id does not exist in the current process.