The following test program works fine on, e.g. Linux, but fails on AIX. LastErrorException is not thrown even though call sets errno.
Using GIT master JNA, commit: 2b8773a
oslevel: 7.1.0.0
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr9fp2-20110627_03(SR9 FP2))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110624_85526 (JIT enabled, AOT enabled)
J9VM - 20110624_085526
JIT - r9_20101028_17488ifx17
GC - 20101027_AA)
JCL - 20110530_01
import com.sun.jna.*;
import java.util.*;
public class JNATest {
public static void main(String[] args) {
try {
int rc = LibC.INSTANCE.open("/nonexistentfile-" + UUID.randomUUID(), 2, 0);
System.err.println("TEST FAILED: Expected exception, instead got rc=" + rc);
} catch (LastErrorException ex) {
System.err.println("TEST PASSED");
}
}
public interface LibC extends Library {
public static final LibC INSTANCE = (LibC)Native.loadLibrary("c", LibC.class);
int open(String pathname, int flags, int mode) throws LastErrorException;
}
}
The following test program works fine on, e.g. Linux, but fails on AIX. LastErrorException is not thrown even though call sets errno.
Using GIT master JNA, commit: 2b8773a
oslevel: 7.1.0.0
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460sr9fp2-20110627_03(SR9 FP2))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr9-20110624_85526 (JIT enabled, AOT enabled)
J9VM - 20110624_085526
JIT - r9_20101028_17488ifx17
GC - 20101027_AA)
JCL - 20110530_01