(tb testing.TB, file *os.File)
| 70 | } |
| 71 | |
| 72 | func isNonblock(tb testing.TB, file *os.File) (nonblocking bool) { |
| 73 | tb.Helper() |
| 74 | |
| 75 | raw, err := file.SyscallConn() |
| 76 | if err != nil { |
| 77 | tb.Fatal("SyscallConn:", err) |
| 78 | } |
| 79 | |
| 80 | err = raw.Control(func(fd uintptr) { |
| 81 | flags, err := unix.FcntlInt(fd, unix.F_GETFL, 0) |
| 82 | if err != nil { |
| 83 | tb.Fatal("IsNonblock:", err) |
| 84 | } |
| 85 | nonblocking = flags&unix.O_NONBLOCK > 0 |
| 86 | }) |
| 87 | if err != nil { |
| 88 | tb.Fatal("Control:", err) |
| 89 | } |
| 90 | return |
| 91 | } |
| 92 | |
| 93 | type testProcess struct { |
| 94 | fds []*os.File |
no outgoing calls
no test coverage detected
searching dependent graphs…