public class NativeLibraryDarwin
extends java.lang.Object
NativeLibraryWrapper
implementation for Darwin/Mac.
When JNA is initialized, all methods that have the 'native' keyword will be attmpted to be linked against. As Java doesn't have the equivalent of a #ifdef, this means if a native method like posix_fadvise is defined in the class but not available on the target operating system (e.g. posix_fadvise is not availble on Darwin/Mac) this will cause the entire initial linking and initialization of JNA to fail. This means other native calls that are supported on that target operating system will be unavailable simply because of one native defined method not supported on the runtime operating system.
NativeLibraryWrapper
,
NativeLibrary
Constructor and Description |
---|
NativeLibraryDarwin() |
Modifier and Type | Method and Description |
---|---|
int |
callClose(int fd) |
int |
callFcntl(int fd,
int command,
long flags) |
int |
callFsync(int fd) |
long |
callGetpid() |
int |
callMlockall(int flags) |
int |
callMunlockall() |
int |
callOpen(java.lang.String path,
int flags) |
int |
callPosixFadvise(int fd,
long offset,
int len,
int flag) |
com.sun.jna.Pointer |
callStrerror(int errnum) |
boolean |
isAvailable()
Checks if the library has been successfully linked.
|
public int callMlockall(int flags) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callMunlockall() throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callFcntl(int fd, int command, long flags) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callPosixFadvise(int fd, long offset, int len, int flag) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callOpen(java.lang.String path, int flags) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callFsync(int fd) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public int callClose(int fd) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public com.sun.jna.Pointer callStrerror(int errnum) throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public long callGetpid() throws java.lang.UnsatisfiedLinkError, java.lang.RuntimeException
java.lang.UnsatisfiedLinkError
java.lang.RuntimeException
public boolean isAvailable()
true
if the library has been successfully linked, false
otherwise.Copyright © 2021 The Apache Software Foundation