GNU bug report logs - #36287
26.2.90; On macOS, process-attributes returns truncated command name

Previous Next

Package: emacs;

Reported by: Xu Chunyang <mail <at> xuchunyang.me>

Date: Wed, 19 Jun 2019 07:47:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 26.2.90

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 36287 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Xu Chunyang <mail <at> xuchunyang.me>,  36287 <at> debbugs.gnu.org
Subject: Re: bug#36287: 26.2.90; On macOS, process-attributes returns
 truncated command name
Date: Tue, 18 Aug 2020 20:30:20 +0200
Robert Pluim <rpluim <at> gmail.com> 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




This bug report was last modified 4 years and 281 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.