// +build !windows,!plan9

// Copyright 2015 go-termios Author. All Rights Reserved.
// https://github.com/go-termios/termios
// Author: John Lenton <chipaca@github.com>

package sys

import (
	

	
)

// Termios represents terminal attributes.
type Termios unix.Termios

// TermiosForFd returns a pointer to a Termios structure if the file
// descriptor is open on a terminal device.
func ( int) (*Termios, error) {
	,  := unix.IoctlGetTermios(, getAttrIOCTL)
	return (*Termios)(), 
}

// ApplyToFd applies term to the given file descriptor.
func ( *Termios) ( int) error {
	return unix.IoctlSetTermios(, setAttrNowIOCTL, (*unix.Termios)(unsafe.Pointer()))
}

// Copy returns a copy of term.
func ( *Termios) () *Termios {
	 := *
	return &
}

// SetVTime sets the timeout in deciseconds for noncanonical read.
func ( *Termios) ( uint8) {
	.Cc[unix.VTIME] = 
}

// SetVMin sets the minimal number of characters for noncanonical read.
func ( *Termios) ( uint8) {
	.Cc[unix.VMIN] = 
}

// SetICanon sets the canonical flag.
func ( *Termios) ( bool) {
	setFlag(&.Lflag, unix.ICANON, )
}

// SetIExten sets the iexten flag.
func ( *Termios) ( bool) {
	setFlag(&.Lflag, unix.IEXTEN, )
}

// SetEcho sets the echo flag.
func ( *Termios) ( bool) {
	setFlag(&.Lflag, unix.ECHO, )
}

// SetICRNL sets the CRNL iflag bit
func ( *Termios) ( bool) {
	setFlag(&.Iflag, unix.ICRNL, )
}