Add config time check for new gettid API
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 1 line · Khem Raj
glibc 2.30 introdoced this function see [1]
introduced
Quoted 1 line
so its best to detect it
it's
Quoted 1 line
and provide fallbacks only if its not present
fallback
it's
Quoted 3 lines
That's interesting for the thread identifier context field.
Thanks
Quoted 42 lines
Signed-off-by Khem Raj <[email protected]>--- configure.ac | 1 + include/lttng/ust-tid.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-)configure.ac +1
-0@@ -137,6 +137,7 @@ AC_CHECK_FUNCS([ \ clock_gettime \ ftruncate \ getpagesize \ + gettid \ gettimeofday \ localeconv \ memchr \include/lttng/ust-tid.h +5
-2@@ -26,7 +26,10 @@* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - +#include <config.h> +#if HAVE_GETTID +#include <unistd.h> +#else #ifdef __linux__#include <syscall.h> #endif @@ -49,5 +52,5 @@ static inline pid_t gettid(void)return getpid (); }#endif - +#endif /* HAVE_GETTID */ #endif /* _LTTNG_UST_TID_H */