name.pachler.nio.file.impl
Class BSD

java.lang.Object
  extended by name.pachler.nio.file.impl.Unix
      extended by name.pachler.nio.file.impl.BSD

public abstract class BSD
extends Unix


Nested Class Summary
static class BSD.kevent
           struct kevent { uintptr_t ident; // identifier for this event short filter; // filter for event u_short flags; // action flags for kqueue u_int fflags; // filter flag value intptr_t data; // filter data value void *udata; // opaque user data identifier };
 
Nested classes/interfaces inherited from class name.pachler.nio.file.impl.Unix
Unix.timespec
 
Field Summary
static short EV_ADD
           
static short EV_CLEAR
           
static short EV_DELETE
           
static short EV_DISABLE
           
static short EV_ENABLE
           
static short EV_EOF
           
static short EV_ERROR
           
static short EV_ONESHOT
           
static short EVFILT_PROC
           
static short EVFILT_VNODE
           
static int NOTE_ATTRIB
           
static int NOTE_DELETE
           
static int NOTE_EXEC
           
static int NOTE_EXIT
           
static int NOTE_EXTEND
           
static int NOTE_FORK
           
static int NOTE_LINK
           
static int NOTE_RENAME
           
static int NOTE_REVOKE
           
static int NOTE_TRACK
           
static int NOTE_TRACKERR
           
static int NOTE_WRITE
           
 
Constructor Summary
BSD()
           
 
Method Summary
static int kevent(int kq, BSD.kevent[] changelist, BSD.kevent[] eventlist, Unix.timespec timeout)
           
static int kqueue()
           
 
Methods inherited from class name.pachler.nio.file.impl.Unix
getIntDefine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EV_ADD

public static final short EV_ADD

EV_ENABLE

public static final short EV_ENABLE

EV_DISABLE

public static final short EV_DISABLE

EV_DELETE

public static final short EV_DELETE

EV_ONESHOT

public static final short EV_ONESHOT

EV_CLEAR

public static final short EV_CLEAR

EV_EOF

public static final short EV_EOF

EV_ERROR

public static final short EV_ERROR

EVFILT_VNODE

public static final short EVFILT_VNODE

EVFILT_PROC

public static final short EVFILT_PROC

NOTE_DELETE

public static final int NOTE_DELETE

NOTE_WRITE

public static final int NOTE_WRITE

NOTE_EXTEND

public static final int NOTE_EXTEND

NOTE_ATTRIB

public static final int NOTE_ATTRIB

NOTE_LINK

public static final int NOTE_LINK

NOTE_RENAME

public static final int NOTE_RENAME

NOTE_REVOKE

public static final int NOTE_REVOKE

NOTE_EXIT

public static final int NOTE_EXIT

NOTE_FORK

public static final int NOTE_FORK

NOTE_EXEC

public static final int NOTE_EXEC

NOTE_TRACK

public static final int NOTE_TRACK

NOTE_TRACKERR

public static final int NOTE_TRACKERR
Constructor Detail

BSD

public BSD()
Method Detail

kqueue

public static int kqueue()

kevent

public static int kevent(int kq,
                         BSD.kevent[] changelist,
                         BSD.kevent[] eventlist,
                         Unix.timespec timeout)
Parameters:
kq - the kqueue to read events from/change events in. Obtained with kqueue().
changelist - an array of kevent instances that indicate events to add/remove or modify. If null, no changes will be applied to the kqueue.
eventlist - an array that the function will fill with events that occurred. If there are more events available than there is space in this array, the array will be filled. A subsequent call to kevent() will yield the remaining events. Use select() on the kqueue file descriptor to check if there are events pending. Non-null array elements will be kept; their values will be overwritten. The function will assign new kqueue objects to null array elements. Note that providing an eventlist array pre-filled with kevent objects will improve performance. If null is specified, no events will be read, and the function returns immediately.
timeout - timeout value. If null, the function will wait indefinitely until events are available (unless an error occurred). Otherwise, the function will wait for the specified timeout for events (which may be zero), again, unless an error occurs. Note that the function will return immediately if eventlist is null or it's length is zero, regardless of the timeout specified.
Returns:
the function returns the number of events written to eventlist. Zero may be returned if the timeout passed before events could be read. -1 is returned if an error occurred; call errno() to get the error code.