ioctl_solaris.go 630 B

123456789101112131415161718192021222324252627282930
  1. package pty
  2. import (
  3. "golang.org/x/sys/unix"
  4. "unsafe"
  5. )
  6. const (
  7. // see /usr/include/sys/stropts.h
  8. I_PUSH = uintptr((int32('S')<<8 | 002))
  9. I_STR = uintptr((int32('S')<<8 | 010))
  10. I_FIND = uintptr((int32('S')<<8 | 013))
  11. // see /usr/include/sys/ptms.h
  12. ISPTM = (int32('P') << 8) | 1
  13. UNLKPT = (int32('P') << 8) | 2
  14. PTSSTTY = (int32('P') << 8) | 3
  15. ZONEPT = (int32('P') << 8) | 4
  16. OWNERPT = (int32('P') << 8) | 5
  17. )
  18. type strioctl struct {
  19. ic_cmd int32
  20. ic_timout int32
  21. ic_len int32
  22. ic_dp unsafe.Pointer
  23. }
  24. func ioctl(fd, cmd, ptr uintptr) error {
  25. return unix.IoctlSetInt(int(fd), uint(cmd), int(ptr))
  26. }