[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107988: * src/sysdep.c (list_system_
From: |
Leo Liu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107988: * src/sysdep.c (list_system_processes): Support Darwin. |
Date: |
Sun, 22 Apr 2012 10:58:23 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107988
fixes bug(s): http://debbugs.gnu.org/5725
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Sun 2012-04-22 10:58:23 +0800
message:
* src/sysdep.c (list_system_processes): Support Darwin.
modified:
src/ChangeLog
src/sysdep.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-04-22 01:27:10 +0000
+++ b/src/ChangeLog 2012-04-22 02:58:23 +0000
@@ -1,3 +1,7 @@
+2012-04-22 Leo Liu <address@hidden>
+
+ * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
+
2012-04-22 Paul Eggert <address@hidden>
* sysdep.c [__FreeBSD__]: Minor cleanups.
=== modified file 'src/sysdep.c'
--- a/src/sysdep.c 2012-04-22 01:27:10 +0000
+++ b/src/sysdep.c 2012-04-22 02:58:23 +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,12 +2540,16 @@
return proclist;
}
-#elif defined __FreeBSD__
+#elif defined BSD_SYSTEM
Lisp_Object
list_system_processes (void)
{
+#ifdef DARWIN_OS
+ int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
+#else
int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
+#endif
size_t len;
struct kinfo_proc *procs;
size_t i;
@@ -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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107988: * src/sysdep.c (list_system_processes): Support Darwin.,
Leo Liu <=