eal: get unique thread id
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_thread.c
index 80a985f..0288b22 100644 (file)
@@ -39,6 +39,7 @@
 #include <pthread.h>
 #include <sched.h>
 #include <sys/queue.h>
+#include <sys/syscall.h>
 
 #include <rte_debug.h>
 #include <rte_atomic.h>
@@ -231,3 +232,9 @@ eal_thread_loop(__attribute__((unused)) void *arg)
        /* pthread_exit(NULL); */
        /* return NULL; */
 }
+
+/* require calling thread tid by gettid() */
+int rte_sys_gettid(void)
+{
+       return (int)syscall(SYS_gettid);
+}