Skip to content

Commit d7edd05

Browse files
committed
EVL: Finally got EVL thread
1 parent a592d09 commit d7edd05

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

src/rtapi/uspace_xenomai_evl.cc

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ struct XenomaiApp : RtapiApp {
6767
int nprocs = sysconf( _SC_NPROCESSORS_ONLN );
6868
CPU_SET(nprocs-1, &cpuset); // assumes processor numbers are contiguous
6969

70-
fprintf(stderr,
71-
"Start. getuid()=%d geteuid()=%d\n",
72-
getuid(), geteuid());
73-
7470
int ret;
7571
pthread_attr_t attr;
7672
if((ret = pthread_attr_init(&attr)) != 0)
@@ -96,15 +92,14 @@ struct XenomaiApp : RtapiApp {
9692
auto task = reinterpret_cast<RtaiTask*>(arg);
9793
pthread_setspecific(key, arg);
9894

99-
fprintf(stderr,
100-
"Wrapper. getuid()=%d geteuid()=%d\n",
101-
getuid(), geteuid());
102-
103-
/* Attach to the core. */
104-
rtapi_print("linuxcnc-thread:%d\n", gettid());
105-
int tfd = evl_attach_self("linuxcnc-thread:%d", gettid());
106-
if (tfd < 0){
107-
rtapi_print("evl_attach_self() failed ret %i errno %i\n", tfd, errno);
95+
{
96+
WithRoot r;
97+
/* Attach to the core. */
98+
rtapi_print("linuxcnc-thread:%d\n", gettid());
99+
int tfd = evl_attach_self("linuxcnc-thread:%d", gettid());
100+
if (tfd < 0){
101+
rtapi_print("evl_attach_self() failed ret %i errno %i\n", tfd, errno);
102+
}
108103
}
109104

110105
struct timespec now;

0 commit comments

Comments
 (0)