1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
10 #include <sys/syscall.h>
12 #include <rte_debug.h>
13 #include <rte_launch.h>
16 #include <rte_lcore.h>
17 #include <rte_string_fns.h>
19 #include "eal_private.h"
20 #include "eal_thread.h"
22 /* require calling thread tid by gettid() */
23 int rte_sys_gettid(void)
25 return (int)syscall(SYS_gettid);
28 int rte_thread_setname(pthread_t id, const char *name)
31 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
32 #if __GLIBC_PREREQ(2, 12)
35 strlcpy(truncated, name, sizeof(truncated));
36 ret = pthread_setname_np(id, truncated);
44 int rte_thread_getname(pthread_t id, char *name, size_t len)
47 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
48 #if __GLIBC_PREREQ(2, 12)
49 ret = pthread_getname_np(id, name, len);