// int tcsetattr(int fd, int optional_actions, const struct termios *termios_p)
968401
func Setattr(fd int, action uint, state *Termios) (err error) {
	switch action {
	case TCSANOW:
		action = TCSETS
	case TCSADRAIN:
		action = TCSETSW
	case TCSAFLUSH:
		action = TCSETSF
	}

	_, _, e1 := unix.Syscall(unix.SYS_IOCTL, uintptr(fd),
		uintptr(action), uintptr(unsafe.Pointer(state)))
	if e1 != 0 {
		err = e1
	}
	return
}
987273
func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
	return unix.Lsetxattr(path, attr, data, flags)
}
842962
func tcsetattr(fd int, termios *syscall.Termios) (err error) {
	r, _, errno := syscall.Syscall(uintptr(syscall.SYS_IOCTL),
		uintptr(fd), uintptr(syscall.TIOCSETA), uintptr(unsafe.Pointer(termios)))
	if errno != 0 {
		err = errno
		return
	}
	if r != 0 {
		err = fmt.Errorf("tcsetattr failed %v", r)
	}
	return
}
377967
func txAttrs(tx *bolt.Tx, id uint64) (map[string]interface{}, error) {
	v := tx.Bucket([]byte("attrs")).Get(u64tob(id))
	if v == nil {
		return emptyMap, nil
	}
	return pilosa.DecodeAttrs(v)
}
875369
func (s *DeviceEvent) SetStdEvent(v string) *DeviceEvent {
	s.StdEvent = &v
	return s
}
1088510
func Tcsetattr(fd, opt uintptr, argp *syscall.Termios) error {
	switch opt {
	case TCSANOW:
		opt = syscall.TIOCSETA
	case TCSADRAIN:
		opt = syscall.TIOCSETAW
	case TCSAFLUSH:
		opt = syscall.TIOCSETAF
	default:
		return syscall.EINVAL
	}
	return ioctl(fd, opt, uintptr(unsafe.Pointer(argp)))
}
493895
func Cfsetospeed(attr *syscall.Termios, speed uintptr) error {
	solTermios := tiosToUnix(attr)
	_, err := C.cfsetospeed((*C.termios_t)(unsafe.Pointer(solTermios)), C.speed_t(speed))
	return err
}
1199392
func (s *LinkAttributeUpdate) SetAttributeAction(v *LinkAttributeAction) *LinkAttributeUpdate {
	s.AttributeAction = v
	return s
}
730789
func (p *Packet) SetTCPSynAck() {

	p.tcpLayer.SYN = true
	p.tcpLayer.ACK = true
	p.tcpLayer.FIN = false
}
1002770
func Tcgetattr(fd uintptr, argp *syscall.Termios) error {
	return ioctl(fd, syscall.TIOCGETA, uintptr(unsafe.Pointer(argp)))
}
27044
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
	return setxattr(path, attr, data, 0, flags)
}
1010279
func Tiocmset(fd uintptr, status *int) error {
	return ioctl(fd, syscall.TIOCMSET, uintptr(unsafe.Pointer(status)))
}
122488
func TcGetAttr(fd uintptr) (*Termios, error) {
	var termios = &Termios{}
	if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(termios))); err != 0 {
		return nil, err
	}
	return termios, nil
}
938441
func (suite *Suite) SetT(t *testing.T) {
	suite.t = t
	suite.Assertions = assert.New(t)
	suite.require = require.New(t)
}
1052380
func getAttr(fr *Frame, x Value, name string) (Value, error) {
	// field or method?
	if x, ok := x.(HasAttrs); ok {
		if v, err := x.Attr(name); v != nil || err != nil {
			return v, err
		}
	}

	return nil, fmt.Errorf("%s has no .%s field or method", x.Type(), name)
}
663068
func Tiocmget(fd uintptr, status *int) error {
	return ioctl(fd, syscall.TIOCMGET, uintptr(unsafe.Pointer(status)))
}
1011348
func (m *Model) SetStderr(err io.Writer) *Model {
	m.cmd.Stderr = err
	return m
}