Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View ProcessTree diff for 64bit Mac OS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
diff --git a/core/src/main/java/hudson/util/ProcessTree.java b/core/src/main/java/hudson/util/ProcessTree.java
index 42d9127..bc20667 100644
--- a/core/src/main/java/hudson/util/ProcessTree.java
+++ b/core/src/main/java/hudson/util/ProcessTree.java
@@ -25,7 +25,6 @@ package hudson.util;
@@ -898,8 +898,8 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
LOGGER.fine("Found "+count+" processes");
for( int base=0; base<size.getValue(); base+=sizeOf_kinfo_proc) {
- int pid = m.getInt(base+24);
- int ppid = m.getInt(base+416);
+ int pid = m.getInt(base+40);
+ int ppid = m.getInt(base+560);
// int effective_uid = m.getInt(base+304);
// byte[] comm = new byte[16];
// m.read(base+163,comm,0,16);
@@ -1052,7 +1052,8 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
}
// local constants
- private static final int sizeOf_kinfo_proc = 492; // TODO:checked on 32bit Mac OS X. is this different on 64bit?
+// private static final int sizeOf_kinfo_proc = 492; // TODO:checked on 32bit Mac OS X. is this different on 64bit?
+ private static final int sizeOf_kinfo_proc = 648; // TODO:checked on 32bit Mac OS X. is this different on 64bit?
private static final int sizeOfInt = Native.getNativeSize(int.class);
private static final int CTL_KERN = 1;
private static final int KERN_PROC = 14;
@@ -1097,7 +1098,7 @@ public abstract class ProcessTree implements Iterable<OSProcess>, IProcessTree,
Object writeReplace() {
return this; // cancel out super.writeReplace()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.