15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 import java.foreign.Libraries; 25 import java.foreign.Library; 26 import java.foreign.NativeTypes; 27 import java.foreign.Scope; 28 import java.foreign.memory.Array; 29 import java.foreign.memory.Pointer; 30 import java.foreign.memory.Struct; 31 import java.lang.invoke.MethodHandles; 32 import org.testng.annotations.BeforeTest; 33 import org.testng.annotations.Test; 34 import static test.jextract.lp.libproc_h.*; 35 import static test.jextract.lp.proc_info_h.*; 36 import test.jextract.lp.proc_info; 37 38 import static org.testng.Assert.assertEquals; 39 import static org.testng.Assert.assertTrue; 40 41 /* 42 * @test 43 * @library .. 44 * @requires (os.family == "mac") 45 * @run driver JtregJextract -t test.jextract.lp -lproc -rpath /usr/lib -- /usr/include/libproc.h /usr/include/sys/proc_info.h 46 * @run testng LibprocTest 47 */ 48 public class LibprocTest { 49 private static final int NAME_BUF_MAX = 256; 50 @Test 51 public void processListTest() { 52 long curProcPid = ProcessHandle.current().pid(); 53 boolean foundCurProc = false; 54 55 // Scope for native allocations 56 try (Scope s = Scope.newNativeScope()) { | 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 import java.foreign.Libraries; 25 import java.foreign.Library; 26 import java.foreign.NativeTypes; 27 import java.foreign.Scope; 28 import java.foreign.memory.Array; 29 import java.foreign.memory.Pointer; 30 import java.foreign.memory.Struct; 31 import java.lang.invoke.MethodHandles; 32 import org.testng.annotations.BeforeTest; 33 import org.testng.annotations.Test; 34 import static test.jextract.lp.libproc_h.*; 35 import static test.jextract.lp.sys.proc_info_h.*; 36 import test.jextract.lp.sys.proc_info; 37 38 import static org.testng.Assert.assertEquals; 39 import static org.testng.Assert.assertTrue; 40 41 /* 42 * @test 43 * @library .. 44 * @requires (os.family == "mac") 45 * @run driver JtregJextract -t test.jextract.lp -lproc -rpath /usr/lib -- /usr/include/libproc.h /usr/include/sys/proc_info.h 46 * @run testng LibprocTest 47 */ 48 public class LibprocTest { 49 private static final int NAME_BUF_MAX = 256; 50 @Test 51 public void processListTest() { 52 long curProcPid = ProcessHandle.current().pid(); 53 boolean foundCurProc = false; 54 55 // Scope for native allocations 56 try (Scope s = Scope.newNativeScope()) { |