aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lp.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lp.go b/lp.go
index 41209b4..aee2d23 100644
--- a/lp.go
+++ b/lp.go
@@ -3,6 +3,7 @@ package robo
import (
"bufio"
"os"
+ "syscall"
)
type LP struct {
@@ -18,6 +19,11 @@ func (d LP) Close() {
d.File.Close()
}
+func (d LP) SetNonblock() {
+ fd := d.File.Fd()
+ syscall.SetNonblock(int(fd), true)
+}
+
func (d LP) Handle() *bufio.ReadWriter {
r := bufio.NewReader(d.File)
w := bufio.NewWriter(d.File)