File: ioctl_solaris.go

package info (click to toggle)
golang-github-creack-pty 1.1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 204 kB
  • sloc: sh: 46; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 630 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package pty

import (
	"golang.org/x/sys/unix"
	"unsafe"
)

const (
	// see /usr/include/sys/stropts.h
	I_PUSH  = uintptr((int32('S')<<8 | 002))
	I_STR   = uintptr((int32('S')<<8 | 010))
	I_FIND  = uintptr((int32('S')<<8 | 013))
	// see /usr/include/sys/ptms.h
	ISPTM   = (int32('P') << 8) | 1
	UNLKPT  = (int32('P') << 8) | 2
	PTSSTTY = (int32('P') << 8) | 3
	ZONEPT  = (int32('P') << 8) | 4
	OWNERPT = (int32('P') << 8) | 5
)

type strioctl struct {
	ic_cmd    int32
	ic_timout int32
	ic_len    int32
	ic_dp     unsafe.Pointer
}

func ioctl(fd, cmd, ptr uintptr) error {
	return unix.IoctlSetInt(int(fd), uint(cmd), int(ptr))
}