MCPcopy Index your code
hub / github.com/cloudflare/tableflip / isNonblock

Function isNonblock

process_test.go:72–91  ·  view source on GitHub ↗
(tb testing.TB, file *os.File)

Source from the content-addressed store, hash-verified

70}
71
72func 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
93type testProcess struct {
94 fds []*os.File

Callers 1

TestFilesAreNonblockingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…