mirror of
https://github.com/creack/pty.git
synced 2026-03-31 10:37:09 +09:00
factor out docs
This commit is contained in:
11
doc.go
Normal file
11
doc.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// Package pty provides functions for working with Unix terminals.
|
||||
package pty
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// Opens a pty and its corresponding tty.
|
||||
func Open() (pty, tty *os.File, err error) {
|
||||
return open()
|
||||
}
|
||||
@@ -10,8 +10,7 @@ import (
|
||||
// see ioccom.h
|
||||
const sys_IOCPARM_MASK = 0x1fff
|
||||
|
||||
// Opens a pty and its corresponding tty.
|
||||
func Open() (pty, tty *os.File, err error) {
|
||||
func open() (pty, tty *os.File, err error) {
|
||||
p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
@@ -12,8 +12,7 @@ const (
|
||||
sys_TIOCSPTLCK = 0x40045431
|
||||
)
|
||||
|
||||
// Opens a pty and its corresponding tty.
|
||||
func Open() (pty, tty *os.File, err error) {
|
||||
func open() (pty, tty *os.File, err error) {
|
||||
p, err := os.OpenFile("/dev/ptmx", os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
||||
Reference in New Issue
Block a user