You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ioctl.go 950B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
  5. package unix
  6. import "runtime"
  7. // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
  8. //
  9. // To change fd's window size, the req argument should be TIOCSWINSZ.
  10. func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
  11. // TODO: if we get the chance, remove the req parameter and
  12. // hardcode TIOCSWINSZ.
  13. err := ioctlSetWinsize(fd, req, value)
  14. runtime.KeepAlive(value)
  15. return err
  16. }
  17. // IoctlSetTermios performs an ioctl on fd with a *Termios.
  18. //
  19. // The req value will usually be TCSETA or TIOCSETA.
  20. func IoctlSetTermios(fd int, req uint, value *Termios) error {
  21. // TODO: if we get the chance, remove the req parameter.
  22. err := ioctlSetTermios(fd, req, value)
  23. runtime.KeepAlive(value)
  24. return err
  25. }