all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: Chong Yidong <cyd@gnu.org>
Cc: 5725@debbugs.gnu.org
Subject: bug#5725: 23.1.94; list_system_processes for BSD_SYSTEM (with patch)
Date: Sat, 21 Apr 2012 23:29:09 +0800	[thread overview]
Message-ID: <m1r4vh3xyy.fsf@gmail.com> (raw)
In-Reply-To: <87mx65o00f.fsf@gnu.org> (Chong Yidong's message of "Sat, 21 Apr 2012 18:24:48 +0800")

On 2012-04-21 18:24 +0800, Chong Yidong wrote:
> [Disconnecting Bug#5725 from Bug#5243]
>
> I committed Eduard Wiebe's patch in Bug#5243 to trunk.  If his
> implementation of system_process_attributes does not compile on Darwin,
> and you have a separate one that works, could you add yours under a
> different #elif?
>
> Also, if the list_system_processes part works on Darwin, the relevant
> #elif, from his patch, should be changed to BSD_SYSTEM; please check
> that if you can, and amend as necessary.
>
> Thanks.

The difference is small. Are you happy with this change? I have tested
it in Snow Leopard 10.6.8.

=== modified file 'src/sysdep.c'
--- src/sysdep.c	2012-04-21 10:11:51 +0000
+++ src/sysdep.c	2012-04-21 15:25:18 +0000
@@ -44,6 +44,10 @@
 #include <math.h>
 #endif
 
+#ifdef DARWIN_OS
+#include <sys/sysctl.h>
+#endif
+
 #ifdef WINDOWSNT
 #define read sys_read
 #define write sys_write
@@ -2536,7 +2540,11 @@
   return proclist;
 }
 
-#elif defined (__FreeBSD__)
+#elif defined (BSD_SYSTEM)
+
+#ifdef DARWIN_OS
+#define KERN_PROC_PROC KERN_PROC_ALL
+#endif
 
 Lisp_Object
 list_system_processes ()
@@ -2562,7 +2570,13 @@
   GCPRO1 (proclist);
   len /= sizeof (struct kinfo_proc);
   for (i = 0; i < len; i++)
-    proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist);
+    {
+#ifdef DARWIN_OS
+      proclist = Fcons (make_fixnum_or_float (procs[i].kp_proc.p_pid), proclist);
+#else
+      proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist);
+#endif
+    }
   UNGCPRO;
   
   xfree (procs);






  reply	other threads:[~2012-04-21 15:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15 17:01 bug#5725: 23.1.94; list_system_processes for BSD_SYSTEM (with patch) Leo
2010-04-03  8:37 ` Eduard Wiebe
2010-04-03 13:42   ` Leo
2010-04-03 15:57   ` Leo
2010-04-04 17:15     ` Eduard Wiebe
2012-04-21 10:24 ` Chong Yidong
2012-04-21 15:29   ` Leo [this message]
2012-04-22  5:52     ` Chong Yidong
2012-04-22  3:05   ` Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1r4vh3xyy.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=5725@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.