X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_lcore.h;fp=lib%2Flibrte_eal%2Fcommon%2Finclude%2Frte_lcore.h;h=fe7b5865f7f53c46c10e1e9f7aac52841fc45545;hb=8b25d1ad5d2264bdfc2818c7bda74ee2697df6db;hp=ac15130201c47c7092393fa965b59e9141faa4f6;hpb=97f17497d162afdb82c8704bf097f0fee3724b2e;p=deb_dpdk.git diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h index ac151302..fe7b5865 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -250,23 +250,16 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); /** * Set thread names. * - * Macro to wrap `pthread_setname_np()` with a glibc version check. - * Only glibc >= 2.12 supports this feature. + * @note It fails with glibc < 2.12. * - * This macro only used for Linux, BSD does direct libc call. - * BSD libc version of function is `pthread_set_name_np()`. + * @param id + * Thread id. + * @param name + * Thread name to set. + * @return + * On success, return 0; otherwise return a negative value. */ -#if defined(__DOXYGEN__) -#define rte_thread_setname(...) pthread_setname_np(__VA_ARGS__) -#endif - -#if defined(__GLIBC__) && defined(__GLIBC_PREREQ) -#if __GLIBC_PREREQ(2, 12) -#define rte_thread_setname(...) pthread_setname_np(__VA_ARGS__) -#else -#define rte_thread_setname(...) 0 -#endif -#endif +int rte_thread_setname(pthread_t id, const char *name); #ifdef __cplusplus }