1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
9 #include <sys/syscall.h>
12 #include <rte_lcore.h>
13 #include <rte_string_fns.h>
15 /* require calling thread tid by gettid() */
16 int rte_sys_gettid(void)
18 return (int)syscall(SYS_gettid);
21 int rte_thread_setname(pthread_t id, const char *name)
24 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
25 #if __GLIBC_PREREQ(2, 12)
28 strlcpy(truncated, name, sizeof(truncated));
29 ret = pthread_setname_np(id, truncated);
37 int rte_thread_getname(pthread_t id, char *name, size_t len)
40 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
41 #if __GLIBC_PREREQ(2, 12)
42 ret = pthread_getname_np(id, name, len);