summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link/rawfile/rawfile_unsafe.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/tcpip/link/rawfile/rawfile_unsafe.go')
-rw-r--r--pkg/tcpip/link/rawfile/rawfile_unsafe.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/tcpip/link/rawfile/rawfile_unsafe.go b/pkg/tcpip/link/rawfile/rawfile_unsafe.go
index 44e25d475..cf49ce572 100644
--- a/pkg/tcpip/link/rawfile/rawfile_unsafe.go
+++ b/pkg/tcpip/link/rawfile/rawfile_unsafe.go
@@ -19,6 +19,9 @@
package rawfile
import (
+ "runtime/debug"
+ "fmt"
+ "log"
"syscall"
"unsafe"
@@ -149,6 +152,11 @@ func BlockingReadv(fd int, iovecs []syscall.Iovec) (int, *tcpip.Error) {
n, _, e := syscall.RawSyscall(syscall.SYS_READV, uintptr(fd), uintptr(unsafe.Pointer(&iovecs[0])), uintptr(len(iovecs)))
if e == 0 {
return int(n), nil
+ } else if e != syscall.EAGAIN && e != syscall.EWOULDBLOCK && e != syscall.EINTR {
+ fmt.Println("BlockingReadv: RawSyscall failed ", e)
+ debug.PrintStack()
+ log.Fatal("BlockingReadv: RawSyscall failed ", e)
+// return 0, TranslateErrno(e)
}
event := PollEvent{