Skip to content

Commit

Permalink
NUSE: remove the use of pthread_setname_np(), and add prctl(2) instead
Browse files Browse the repository at this point in the history
This should work fine with Travis CI test. more fix will follow.
  • Loading branch information
thehajime committed Nov 23, 2014
1 parent a839b3c commit 52e261d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arch/sim/nuse-fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sys/uio.h>
#include <sys/socket.h>
#include <stdint.h>
#include <sys/prctl.h>
#include "sim-assert.h"
#include "nuse.h"

Expand Down Expand Up @@ -81,7 +82,7 @@ void nuse_fiber_start(void *handler)
error = host_pthread_create(&fiber->pthread, NULL,
fiber->func, fiber->context);
sim_assert(error == 0);
pthread_setname_np(fiber->pthread, fiber->name);
prctl(PR_SET_NAME, fiber->name, 0, 0, 0);
}

int
Expand Down Expand Up @@ -156,7 +157,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
fiber->pthread = *thread;
fiber->name = "app_thread";
fiber->canceled = 0;
pthread_setname_np(fiber->pthread, fiber->name);
prctl(PR_SET_NAME, fiber->name, 0, 0, 0);


error = pthread_mutex_init(&fiber->mutex, NULL);
Expand Down

0 comments on commit 52e261d

Please sign in to comment.