Codebase list golang-pty / 3b1c658
go fmt Keith Rarick 12 years ago
2 changed file(s) with 1 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1010 sys_TIOCGPTN = 0x80045430
1111 sys_TIOCSPTLCK = 0x40045431
1212 )
13
1413
1514 // Opens a pty and its corresponding tty.
1615 func Open() (pty, tty *os.File, err error) {
3635 return p, t, nil
3736 }
3837
39
4038 func ptsname(f *os.File) (string, error) {
4139 var n int
4240 err := ioctl(f.Fd(), sys_TIOCGPTN, &n)
4644 return "/dev/pts/" + strconv.Itoa(n), nil
4745 }
4846
49
5047 func unlockpt(f *os.File) error {
5148 var u int
5249 return ioctl(f.Fd(), sys_TIOCSPTLCK, &u)
5350 }
54
5551
5652 func ioctl(fd uintptr, cmd uintptr, data *int) error {
5753 _, _, e := syscall.Syscall(
00 package pty
11
22 import (
3 "os"
34 "os/exec"
4 "os"
55 )
6
76
87 // Run starts a process with its stdin, stdout, and stderr
98 // connected to a pseudo-terminal tty;