From: Jonathan Rajotte Date: Tue, 29 Mar 2022 20:31:44 +0000 (-0400) Subject: Fix: compat: 'LTTNG_UST_ABI_PROCNAME_LEN' is undeclared X-Git-Tag: v2.13.7~9 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=27f2b8400c9db484cd195c4240c379e845b1413d;p=lttng-tools.git Fix: compat: 'LTTNG_UST_ABI_PROCNAME_LEN' is undeclared Observed issue ============== On old systems, the `lttng_pthread_setname_np` function fallsback to using the compat prctl version. In that context, `LTTNG_UST_ABI_PROCNAME_LEN` is indeed not declared. Solution ======== Use `LTTNG_PTHREAD_NAMELEN`. This mimics what is done in other versions of `lttng_pthread_setname_np`. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I73956cacd7b1e9400881b17b1cd89db2530d3a00 --- diff --git a/src/common/compat/pthread.h b/src/common/compat/pthread.h index dd30c8b9b..66e4ad97a 100644 --- a/src/common/compat/pthread.h +++ b/src/common/compat/pthread.h @@ -60,7 +60,7 @@ static inline int lttng_pthread_setname_np(const char *name) { /* Replicate pthread_setname_np's behavior. */ - if (strnlen(name, LTTNG_UST_ABI_PROCNAME_LEN) >= LTTNG_UST_ABI_PROCNAME_LEN) { + if (strnlen(name, LTTNG_PTHREAD_NAMELEN) >= LTTNG_PTHREAD_NAMELEN) { return ERANGE; } return prctl(PR_SET_NAME, name, 0, 0, 0);