Subject: bug#36287: 26.2.90; On macOS, process-attributes returns truncated command name

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 18 Aug 2020 20:30:20 +0200

Robert Pluim <[email-masked]> writes:

> The sysctl interface will never return more than 16 characters. A
> quick google leads me to the following (there may well be utility
> functions in emacs for the full-path => command name munging already).
>

[...]

>  #ifdef __FreeBSD__
>  /* Sparc/ARM machine/frame.h has 'struct frame' which conflicts with Emacs's
>     'struct frame', so rename it.  */
> @@ -3819,8 +3823,21 @@ system_process_attributes (Lisp_Object pid)

[...]

> +  char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
> +  char *comm;
> +
> +  if (proc_pidpath (proc_id, pathbuf, sizeof(pathbuf)) > 0)
> +    {

I've tested this on Catalina now, and it fixes the problem, so I'll just
go ahead and apply it to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no