Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
factor out docs
  • Loading branch information
kr committed Mar 17, 2013
1 parent 87da171 commit 27435c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 11 additions & 0 deletions doc.go
@@ -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()
}
3 changes: 1 addition & 2 deletions pty_darwin.go
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions pty_linux.go
Expand Up @@ -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
Expand Down

0 comments on commit 27435c6

Please sign in to comment.