- java.lang.Object
-
- de.ibapl.jnhw.linux.sys.Eventfd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEventfd.eventfd_t
-
Field Summary
Fields Modifier and Type Field Description static intEFD_CLOEXECLinux: Set the close-on-exec (FD_CLOEXEC) flag on the new file descriptor.static intEFD_NONBLOCKLinux: Set the O_NONBLOCK file status flag on the open file description (see open(2)) referred to by the new file descriptor..static intEFD_SEMAPHORELinux: Provide semaphore-like semantics for reads from the new file descriptor.static booleanHAVE_SYS_EVENTFD_H
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static inteventfd(int count, int flags)Linux: eventfd - create a file descriptor for event notification.static longeventfd_read(int fd)Additional glibc feature to make read from an eventfd simpler.static voideventfd_write(int fd, long value)Additional glibc feature to make write to an eventfd simpler.
-
-
-
Field Detail
-
EFD_CLOEXEC
@Define public static final int EFD_CLOEXEC
Linux: Set the close-on-exec (FD_CLOEXEC) flag on the new file descriptor.
-
EFD_NONBLOCK
@Define public static final int EFD_NONBLOCK
Linux: Set the O_NONBLOCK file status flag on the open file description (see open(2)) referred to by the new file descriptor..
-
EFD_SEMAPHORE
@Define public static final int EFD_SEMAPHORE
Linux: Provide semaphore-like semantics for reads from the new file descriptor.
-
HAVE_SYS_EVENTFD_H
public static final boolean HAVE_SYS_EVENTFD_H
-
-
Method Detail
-
eventfd
public static final int eventfd(int count, int flags) throws NativeErrorExceptionLinux: eventfd - create a file descriptor for event notification. eventfd creates an "eventfd object" that can be used as an event wait/notify mechanism by user-space applications, and by the kernel to notify user-space applications of events.- Parameters:
count- the initial value of the counter.flags-EFD_CLOEXEC|EFD_NONBLOCK|EFD_SEMAPHORE.- Returns:
- a new file descriptor that can be used to refer to the eventfd object.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
eventfd_read
public static final long eventfd_read(int fd) throws NativeErrorExceptionAdditional glibc feature to make read from an eventfd simpler.- Parameters:
fd- a valid file descriptor from a call toeventfd.- Returns:
- the 2. parameter of the catice call value a 8 byte buffer to hold the readed value.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
eventfd_write
public static final void eventfd_write(int fd, long value) throws NativeErrorExceptionAdditional glibc feature to make write to an eventfd simpler.- Parameters:
fd- a valid file descriptor from a call toeventfd.value- the 8 bytes to be to write out.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
-