MCPcopy Index your code
hub / github.com/codehamr/codehamr / mkfifo

Function mkfifo

internal/tools/nonregular_unix_test.go:22–29  ·  view source on GitHub ↗

mkfifo creates a FIFO in a temp dir; opening it for read OR write would block forever with no peer, which is exactly what the guards must prevent.

(t *testing.T)

Source from the content-addressed store, hash-verified

20// mkfifo creates a FIFO in a temp dir; opening it for read OR write would
21// block forever with no peer, which is exactly what the guards must prevent.
22func mkfifo(t *testing.T) string {
23 t.Helper()
24 path := filepath.Join(t.TempDir(), "pipe")
25 if err := syscall.Mkfifo(path, 0o600); err != nil {
26 t.Skipf("mkfifo unavailable: %v", err)
27 }
28 return path
29}
30
31// TestReadFileRefusesNonRegular: read_file on a FIFO would block forever in
32// open(2) waiting for a writer, leaking the tool goroutine past Ctrl+C (which

Calls

no outgoing calls

Tested by

no test coverage detected