[Git][ghc/ghc][master] rts: Check for program_invocation_short_name via autoconf

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Nov 11 18:17:02 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
430eccef by Ben Gamari at 2022-11-11T13:16:45-05:00
rts: Check for program_invocation_short_name via autoconf

Instead of assuming support on all Linuxes.

- - - - -


2 changed files:

- configure.ac
- rts/Task.c


Changes:

=====================================
configure.ac
=====================================
@@ -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],


=====================================
rts/Task.c
=====================================
@@ -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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/430eccefaef1bc78a00a5327e6e485299be674a5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/430eccefaef1bc78a00a5327e6e485299be674a5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221111/68a3369f/attachment-0001.html>


More information about the ghc-commits mailing list