Skip to content
Snippets Groups Projects
Commit 430eccef authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

rts: Check for program_invocation_short_name via autoconf

Instead of assuming support on all Linuxes.
parent 707d5651
No related branches found
No related tags found
No related merge requests found
Pipeline #58890 canceled
......@@ -918,6 +918,11 @@ AC_CHECK_DECLS([ctime_r], , ,
#define _POSIX_C_SOURCE 199506L
#include <time.h>])
dnl On Linux we should have program_invocation_short_name
AC_CHECK_DECLS([program_invocation_short_name], , ,
[#define _GNU_SOURCE 1
#include <errno.h>])
dnl ** check for mingwex library
AC_CHECK_LIB(
[mingwex],
......
......@@ -477,7 +477,7 @@ startWorkerTask (Capability *cap)
// Set the name of the worker thread to the original process name followed by
// ":w", but only if we're on Linux where the program_invocation_short_name
// global is available.
#if defined(linux_HOST_OS)
#if defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME)
size_t procname_len = strlen(program_invocation_short_name);
char worker_name[16];
// The kernel only allocates 16 bytes for thread names, so we truncate if the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment