diff --git a/splice/pair_darwin.go b/splice/pair_darwin.go index 8780bb1a..f09f6c09 100644 --- a/splice/pair_darwin.go +++ b/splice/pair_darwin.go @@ -4,19 +4,18 @@ package splice -import () - func (p *Pair) LoadFromAt(fd uintptr, sz int, off int64) (int, error) { panic("not implemented") - return 0, nil } func (p *Pair) LoadFrom(fd uintptr, sz int) (int, error) { panic("not implemented") - return 0, nil } func (p *Pair) WriteTo(fd uintptr, n int) (int, error) { panic("not implemented") - return 0, nil +} + +func (p *Pair) discard() { + panic("not implemented") } diff --git a/splice/splice.go b/splice/splice.go index 86560a49..826ba552 100644 --- a/splice/splice.go +++ b/splice/splice.go @@ -71,12 +71,6 @@ func fcntl(fd uintptr, cmd int, arg int) (val int, errno syscall.Errno) { const F_SETPIPE_SZ = 1031 const F_GETPIPE_SZ = 1032 -func osPipe() (int, int, error) { - var fds [2]int - err := syscall.Pipe2(fds[:], syscall.O_NONBLOCK) - return fds[0], fds[1], err -} - func newSplicePair() (p *Pair, err error) { p = &Pair{} p.r, p.w, err = osPipe() diff --git a/splice/splice_darwin.go b/splice/splice_darwin.go new file mode 100644 index 00000000..2a2c7536 --- /dev/null +++ b/splice/splice_darwin.go @@ -0,0 +1,7 @@ +package splice + +import "fmt" + +func osPipe() (int, int, error) { + return 0, 0, fmt.Errorf("not implemented") +} diff --git a/splice/splice_linux.go b/splice/splice_linux.go new file mode 100644 index 00000000..45ce92e6 --- /dev/null +++ b/splice/splice_linux.go @@ -0,0 +1,9 @@ +package splice + +import "syscall" + +func osPipe() (int, int, error) { + var fds [2]int + err := syscall.Pipe2(fds[:], syscall.O_NONBLOCK) + return fds[0], fds[1], err +}