- java.lang.Object
-
- de.ibapl.jnhw.posix.Aio
-
@Include("#include <aio.h>") public class Aio extends Object
Wrapper around the<aio.h>header. See specs at: aio.h - asynchronous input and output.- Author:
- aploese
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAio.Aiocb<T extends OpaqueMemory32>POSIX:structure aiocb.static classAio.AiocbsPOSIX:structure aiocb.
-
Field Summary
Fields Modifier and Type Field Description static IntDefineAIO_ALLDONEPOSIX: A return value indicating that none of the requested operations could be canceled since they are already complete.static IntDefineAIO_CANCELEDPOSIX: A return value indicating that all requested operations have been canceled.static IntDefineAIO_NOTCANCELEDPOSIX: A return value indicating that some of the requested operations could not be canceled since they are in progress.static booleanHAVE_AIO_Hstatic IntDefineLIO_NOPPOSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option indicating that no transfer is requested.static IntDefineLIO_NOWAITPOSIX: Alio_listio(int, Aiocbs, Sigevent)synchronization operation indicating that the calling thread is to continue execution while the lio_listio() operation is being performed, and no notification is given when the operation is complete.static IntDefineLIO_READPOSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option requesting a read.static IntDefineLIO_WAITPOSIX: Alio_listio(int, Aiocbs, Sigevent)synchronization operation indicating that the calling thread is to suspend until the lio_listio() operation is complete.static IntDefineLIO_WRITEPOSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option requesting a write.
-
Constructor Summary
Constructors Constructor Description Aio()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intaio_cancel(int fildes)static intaio_cancel(Aio.Aiocb aiocbp)POSIX: aio_cancel - cancel an asynchronous I/O request.On the native side the param fildes is taken from aiocb.aio_fildes.static intaio_error(Aio.Aiocb aiocb)static voidaio_fsync(int op, Aio.Aiocb aiocb)static voidaio_read(Aio.Aiocb aiocb)static longaio_return(Aio.Aiocb aiocb)static voidaio_suspend(Aio.Aiocbs list, Time.Timespec timeout)static voidaio_write(Aio.Aiocb aiocb)static voidlio_listio(int mode, Aio.Aiocbs list, Signal.Sigevent sig)POSIX: lio_listio - list directed I/O.
-
-
-
Field Detail
-
AIO_ALLDONE
@Define public static final IntDefine AIO_ALLDONE
POSIX: A return value indicating that none of the requested operations could be canceled since they are already complete.
-
AIO_CANCELED
@Define public static final IntDefine AIO_CANCELED
POSIX: A return value indicating that all requested operations have been canceled.
-
AIO_NOTCANCELED
@Define public static final IntDefine AIO_NOTCANCELED
POSIX: A return value indicating that some of the requested operations could not be canceled since they are in progress.
-
HAVE_AIO_H
public static final boolean HAVE_AIO_H
-
LIO_NOP
@Define public static final IntDefine LIO_NOP
POSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option indicating that no transfer is requested.
-
LIO_NOWAIT
@Define public static final IntDefine LIO_NOWAIT
POSIX: Alio_listio(int, Aiocbs, Sigevent)synchronization operation indicating that the calling thread is to continue execution while the lio_listio() operation is being performed, and no notification is given when the operation is complete.
-
LIO_READ
@Define public static final IntDefine LIO_READ
POSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option requesting a read.
-
LIO_WAIT
@Define public static final IntDefine LIO_WAIT
POSIX: Alio_listio(int, Aiocbs, Sigevent)synchronization operation indicating that the calling thread is to suspend until the lio_listio() operation is complete.
-
LIO_WRITE
@Define public static final IntDefine LIO_WRITE
POSIX: Alio_listio(int, Aiocbs, Sigevent)element operation option requesting a write.
-
-
Method Detail
-
aio_cancel
public static final int aio_cancel(Aio.Aiocb aiocbp) throws NativeErrorException, NoSuchNativeMethodException
POSIX: aio_cancel - cancel an asynchronous I/O request.On the native side the param fildes is taken from aiocb.aio_fildes.- Parameters:
aiocbp- points to the asynchronous I/O control block for a particular request to be canceled. If aiocbp is NULL, then all outstanding cancelable asynchronous I/O requests against fildes shall be canceled.- Returns:
#AIO_CANCELED()on succcess orAIO_NOTCANCELEDif not all outstanding operations cant be cancelled.- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_cancel is not available natively.
-
aio_cancel
public static final int aio_cancel(int fildes) throws NativeErrorException, NoSuchNativeMethodExceptionPOSIX: aio_cancel - cancel an asynchronous I/O request. On the native side aiocbp is passed as NULL parameter. If aiocbp is NULL, then all outstanding cancelable asynchronous I/O requests against fildes shall be canceled.- Parameters:
fildes- a valid file descriptor.- Returns:
AIO_CANCELEDon succcess orAIO_NOTCANCELEDif not all outstanding operations cant be caqncelled.- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_cancel is not available natively.
-
aio_error
public static final int aio_error(Aio.Aiocb aiocb) throws NativeErrorException, NoSuchNativeMethodException
- Parameters:
aiocb- prefers to an asynchronous I/O control block.- Returns:
- If the asynchronous I/O operation has completed successfully, then 0 shall be returned. If the asynchronous operation has completed unsuccessfully, then the error status is returned.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_error is not available natively.
-
aio_fsync
public static final void aio_fsync(int op, Aio.Aiocb aiocb) throws NativeErrorException, NoSuchNativeMethodException- Parameters:
op- eitherO_DSYNCorO_SYNCaiocb- refers to an asynchronous I/O control block- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_fsync is not available natively.
-
aio_read
public static final void aio_read(Aio.Aiocb aiocb) throws NativeErrorException, NoSuchNativeMethodException
- Parameters:
aiocb- refers to an asynchronous I/O control block- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_read is not available natively.
-
aio_return
public static final long aio_return(Aio.Aiocb aiocb) throws NativeErrorException, NoSuchNativeMethodException
- Parameters:
aiocb- refers to an asynchronous I/O control block- Returns:
- If the asynchronous I/O operation has completed, thern the number of transferred bytes are returned. If the asynchronous I/O operation * has not yet completed, the results of aio_return() are undefined.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_return is not available natively.
-
aio_suspend
public static final void aio_suspend(Aio.Aiocbs list, Time.Timespec timeout) throws NativeErrorException, NoSuchNativeMethodException
- Parameters:
list- refers to an asynchronous I/O control blocks to suspend.timeout-- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_suspend is not available natively.
-
aio_write
public static final void aio_write(Aio.Aiocb aiocb) throws NativeErrorException, NoSuchNativeMethodException
- Parameters:
aiocb- refers to an asynchronous I/O control block- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method aio_write is not available natively.
-
lio_listio
public static final void lio_listio(int mode, Aio.Aiocbs list, Signal.Sigevent sig) throws NativeErrorException, NoSuchNativeMethodExceptionPOSIX: lio_listio - list directed I/O.- Parameters:
mode-list- refers to an asynchronous I/O control blocks.sig-- Throws:
NativeErrorException- if the return value of the native function indicates an error.NoSuchNativeMethodException- if the method lio_listio is not available natively.
-
-