Class Ioctl


  • @Include("#include <sys/ioctl.h>")
    public final class Ioctl
    extends Object
    Wrapper around the <sys/ioctl.h> header. execute man ioctl_tty on linux to get more informations.
    Author:
    aploese
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int FIONREAD
      Non POSIX: Get the number of bytes in the input buffer..
      static boolean HAVE_SYS_IOCTL_H  
      static int TIOCCBRK
      Non POSIX: Turn break off, that is, stop sending zero bits.
      static int TIOCEXCL
      Non POSIX: Put the terminal into exclusive mode..
      static IntDefine TIOCGICOUNT
      Linux: Get counts of input serial line interrupts (DCD, RI, DSR, CTS).
      static IntDefine TIOCGSOFTCAR
      Linux: ("Get software carrier flag") Get the status of the CLOCAL flag in the c_cflag field of the termios structure.
      static int TIOCM_CAR
      Non POSIX:DCD (data carrier detect) .
      static int TIOCM_CD
      Non POSIX: TIOCM_CAR.
      static int TIOCM_CTS
      Non POSIX: CTS (clear to send).
      static int TIOCM_DSR
      Non POSIX: DSR (data set ready).
      static int TIOCM_DTR
      Non POSIX: DTR (data terminal ready).
      static int TIOCM_LE
      Non POSIX: DSR (data set ready/line enable).
      static int TIOCM_RI
      Non POSIX: TIOCM_RNG.
      static int TIOCM_RNG
      Non POSIX: RNG (ring).
      static int TIOCM_RTS
      Non POSIX: RTS (request to send).
      static int TIOCM_SR
      Non POSIX: Secondary RXD (receive).
      static int TIOCM_ST
      Non POSIX: Secondary TXD (transmit).
      static int TIOCMBIC
      Non POSIX: Clear the indicated modem bits.
      static int TIOCMBIS
      Non POSIX: Set the indicated modem bits.
      static int TIOCMGET
      Non POSIX: Get the status of modem bits.
      static IntDefine TIOCMIWAIT
      Linux: Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change.
      static int TIOCMSET
      Non POSIX: Set the status of modem bits.
      static int TIOCOUTQ
      Non POSIX: Get the number of bytes in the output buffer.
      static int TIOCSBRK
      Non POSIX: Turn break on, that is, start sending zero bits.
      static IntDefine TIOCSSOFTCAR
      Linux: ("Set software carrier flag") Set the CLOCAL flag in the termios structure when *argp is nonzero, and clear it otherwise.
    • Field Detail

      • FIONREAD

        @Define
        public static final int FIONREAD
        Non POSIX: Get the number of bytes in the input buffer..
      • HAVE_SYS_IOCTL_H

        public static final boolean HAVE_SYS_IOCTL_H
      • TIOCCBRK

        @Define
        public static final int TIOCCBRK
        Non POSIX: Turn break off, that is, stop sending zero bits.
      • TIOCEXCL

        @Define
        public static final int TIOCEXCL
        Non POSIX: Put the terminal into exclusive mode..
      • TIOCGICOUNT

        @Define
        public static final IntDefine TIOCGICOUNT
        Linux: Get counts of input serial line interrupts (DCD, RI, DSR, CTS).
      • TIOCGSOFTCAR

        @Define
        public static final IntDefine TIOCGSOFTCAR
        Linux: ("Get software carrier flag") Get the status of the CLOCAL flag in the c_cflag field of the termios structure.
      • TIOCMBIC

        @Define
        public static final int TIOCMBIC
        Non POSIX: Clear the indicated modem bits.
      • TIOCMBIS

        @Define
        public static final int TIOCMBIS
        Non POSIX: Set the indicated modem bits.
      • TIOCMGET

        @Define
        public static final int TIOCMGET
        Non POSIX: Get the status of modem bits.
      • TIOCMIWAIT

        @Define
        public static final IntDefine TIOCMIWAIT
        Linux: Wait for any of the 4 modem bits (DCD, RI, DSR, CTS) to change.
      • TIOCMSET

        @Define
        public static final int TIOCMSET
        Non POSIX: Set the status of modem bits.
      • TIOCM_CAR

        @Define
        public static final int TIOCM_CAR
        Non POSIX:DCD (data carrier detect) .
      • TIOCM_CTS

        @Define
        public static final int TIOCM_CTS
        Non POSIX: CTS (clear to send).
      • TIOCM_DSR

        @Define
        public static final int TIOCM_DSR
        Non POSIX: DSR (data set ready).
      • TIOCM_DTR

        @Define
        public static final int TIOCM_DTR
        Non POSIX: DTR (data terminal ready).
      • TIOCM_LE

        @Define
        public static final int TIOCM_LE
        Non POSIX: DSR (data set ready/line enable).
      • TIOCM_RNG

        @Define
        public static final int TIOCM_RNG
        Non POSIX: RNG (ring).
      • TIOCM_RTS

        @Define
        public static final int TIOCM_RTS
        Non POSIX: RTS (request to send).
      • TIOCM_SR

        @Define
        public static final int TIOCM_SR
        Non POSIX: Secondary RXD (receive).
      • TIOCM_ST

        @Define
        public static final int TIOCM_ST
        Non POSIX: Secondary TXD (transmit).
      • TIOCOUTQ

        @Define
        public static final int TIOCOUTQ
        Non POSIX: Get the number of bytes in the output buffer.
      • TIOCSBRK

        @Define
        public static final int TIOCSBRK
        Non POSIX: Turn break on, that is, start sending zero bits.
      • TIOCSSOFTCAR

        @Define
        public static final IntDefine TIOCSSOFTCAR
        Linux: ("Set software carrier flag") Set the CLOCAL flag in the termios structure when *argp is nonzero, and clear it otherwise.
    • Method Detail

      • ioctl

        public static final int ioctl​(int fd,
                                      int request)
                               throws NativeErrorException
        The ioctl() system call manipulates the underlying device parameters of special files. In particular, many operating characteristics of character special files (e.g., terminals) may be controlled with ioctl() requests.
        Parameters:
        fd - an open file descriptor
        request - a device-dependent request code
        Returns:
        Usually, on success zero is returned. A few ioctl() requests use the return value as an output parameter and return a nonnegative value on success. On error, -1 is returned, and errno is set ap‐ propriately.
        Throws:
        NativeErrorException - if the return value of the native function indicates an error.
      • ioctl

        public static final int ioctl​(int fd,
                                      int request,
                                      IntRef value)
                               throws NativeErrorException
        The ioctl() system call manipulates the underlying device parameters of special files. In particular, many operating characteristics of character special files (e.g., terminals) may be controlled with ioctl() requests.
        Parameters:
        fd - an open file descriptor
        request - a device-dependent request code
        value - an untyped pointer to memory. It's traditionally char *argp (from the days before void * was valid C), and will be so named for this discussion.
        Returns:
        Usually, on success zero is returned. A few ioctl() requests use the return value as an output parameter and return a nonnegative value on success. On error, -1 is returned, and errno is set ap‐ propriately.
        Throws:
        NativeErrorException - if the return value of the native function indicates an error.