Annotation Type IgnoreError


  • @Retention(RUNTIME)
    public @interface IgnoreError
    Indicates that the errno value for a native function need not be saved after the function returns.

    Due to the nature of the Java Virtual Machine, the errno value must be saved immediately after the native function is called, otherwise internal jvm operations may overwrite it before control is returned to java code.

    Since it is not possible for jnr-ffi to infer in a generic way whether a native function has succeeded or failed, the C errno value is saved after every native function call - even for the ones that succeed. This can have a significant performance impact, so for those functions which either don't fail, or for which the errno value can be ignored, can be annotated with @IgnoreError to avoid unneccessary saving of the errno value.

    See Also:
    SaveError, LibraryLoader.saveError(Map, boolean, boolean)