public interface LibC
extends com.sun.jna.Library
Modifier and Type | Field and Description |
---|---|
static LibC |
INSTANCE
Native library instance.
|
Modifier and Type | Method and Description |
---|---|
int |
fclose(com.sun.jna.Pointer stream)
Close a file stream.
|
com.sun.jna.Pointer |
fdopen(int filedes,
String mode)
Open a stream for a file descriptor.
|
com.sun.jna.Pointer |
freopen(String path,
String mode,
com.sun.jna.Pointer stream)
Associate an existing stream to a new file.
|
int |
mlock(com.sun.jna.Pointer addr,
com.sun.jna.NativeLong length)
Locks (pins) parts of virtual address space into RAM so it can not be swapped out.
|
int |
munlock(com.sun.jna.Pointer addr,
com.sun.jna.NativeLong length)
Unlock previously locked memory.
|
int |
vsnprintf(ByteBuffer str,
int size,
String format,
com.sun.jna.Pointer args)
Format a string with a variable arguments list into a fixed size buffer.
|
static final LibC INSTANCE
int vsnprintf(ByteBuffer str, int size, String format, com.sun.jna.Pointer args)
The resultant string will be truncated to the size of the buffer if it would otherwise exceed it.
For example, if the buffer has a capacity of 10 this is a maximum of 9 characters plus a null terminator for a total capacity of 10. This means if 10 characters are required, the buffer capacity must be 11 to accommodate the null terminator.
str
- buffersize
- capacity of the buffer, including space for a null terminatorformat
- format stringargs
- format argumentsint mlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)
addr
- address pointerlength
- lengtherrno
to an error codeint munlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)
addr
- address pointerlength
- lengtherrno
to an error codecom.sun.jna.Pointer fdopen(int filedes, String mode)
filedes
- file descriptormode
- open modeNULL
, setting errno
to an error codecom.sun.jna.Pointer freopen(String path, String mode, com.sun.jna.Pointer stream)
path
- new file pathmode
- open modestream
- file streamNULL
, setting errno
to an error codeint fclose(com.sun.jna.Pointer stream)
stream
- streamerrno
to an error codeCopyright © 2009–2015 Caprica Software Limited. All rights reserved.