Imported Upstream version 16.07-rc1
[deb_dpdk.git] / lib / librte_eal / linuxapp / eal / eal_thread.c
index 18bd8e0..9f88530 100644 (file)
@@ -197,3 +197,16 @@ int rte_sys_gettid(void)
 {
        return (int)syscall(SYS_gettid);
 }
+
+int rte_thread_setname(pthread_t id, const char *name)
+{
+       int ret = -1;
+#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+#if __GLIBC_PREREQ(2, 12)
+       ret = pthread_setname_np(id, name);
+#endif
+#endif
+       RTE_SET_USED(id);
+       RTE_SET_USED(name);
+       return ret;
+}