[Git][ghc/ghc][wip/program-invocation-short-name] rts: Check for program_invocation_short_name via autoconf

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Oct 31 13:43:01 UTC 2022



Ben Gamari pushed to branch wip/program-invocation-short-name at Glasgow Haskell Compiler / GHC


Commits:
b3cebbf3 by Ben Gamari at 2022-10-31T09:42:48-04: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/b3cebbf31cb96c1ef402a4dbd617805423b51593

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b3cebbf31cb96c1ef402a4dbd617805423b51593
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/20221031/7c60655b/attachment-0001.html>


More information about the ghc-commits mailing list