factor out docs

This commit is contained in:
Keith Rarick
2013-03-16 18:30:08 -07:00
parent 87da17124b
commit 27435c699b
3 changed files with 13 additions and 4 deletions

11
doc.go Normal file
View 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()
}

View File

@@ -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

View File

@@ -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