Commit fe4f1382 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

ntdll: Add native thread renaming for FreeBSD.

parent a542400d
......@@ -62,6 +62,9 @@
#ifdef __APPLE__
#include <mach/mach.h>
#endif
#ifdef __FreeBSD__
#include <sys/thr.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
......@@ -1935,6 +1938,36 @@ static void set_native_thread_name( HANDLE handle, const UNICODE_STRING *name )
len = ntdll_wcstoumbs( name->Buffer, name->Length / sizeof(WCHAR), nameA, sizeof(nameA) - 1, FALSE );
nameA[len] = '\0';
pthread_setname_np( nameA );
#elif defined(__FreeBSD__)
unsigned int status;
char nameA[64];
int unix_pid, unix_tid, len;
SERVER_START_REQ( get_thread_times )
{
req->handle = wine_server_obj_handle( handle );
status = wine_server_call( req );
if (status == STATUS_SUCCESS)
{
unix_pid = reply->unix_pid;
unix_tid = reply->unix_tid;
}
}
SERVER_END_REQ;
if (status != STATUS_SUCCESS || unix_pid == -1 || unix_tid == -1)
return;
if (unix_pid != getpid())
{
static int once;
if (!once++) FIXME("cross-process native thread naming not supported\n");
return;
}
len = ntdll_wcstoumbs( name->Buffer, name->Length / sizeof(WCHAR), nameA, sizeof(nameA), FALSE );
nameA[len] = '\0';
thr_set_name( unix_tid, nameA );
#else
static int once;
if (!once++) FIXME("not implemented on this platform\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment