Class BSD


  • public abstract class BSD
    extends Unix
    • 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.