#15492: pthread_setname_np support
-------------------------------+------------------------------
Reporter: cocobean | Owner: nobody
Type: enhancement | Status: new
Priority: normal | Milestone: Unscheduled
Component: System/libroot.so | Version: R1/Development
Keywords: | Blocked By:
Blocking: | Has a Patch: 0
Platform: All |
-------------------------------+------------------------------
Provide kernel support of pthread_setname_np and pthread_getname_np -
set/get the name of a thread.
By default, all the threads created using pthread_create() inherit
the program name. The pthread_setname_np() function can be used to
set a unique name for a thread, which can be useful for debugging
multithreaded applications. The thread name is a meaningful C
language string, whose length is restricted to 16 characters,
including the terminating null byte ('\0'). The thread argument
specifies the thread whose name is to be changed; name specifies
the
new name.
The pthread_getname_np() function can be used to retrieve the name
of
the thread. The thread argument specifies the thread whose name is
to be retrieved. The buffer name is used to return the thread
name;
len specifies the number of bytes available in name. The buffer
specified by name should be at least 16 characters in length. The
returned thread name in the output buffer will be null terminated.
RETURN VALUE
On success, these functions return 0; on error, they return a
nonzero
error number.
--
Ticket URL: <https://dev.haiku-os.org/ticket/15492>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.