//:build !moxie.wasm && !baremetal package runtime import "unsafe" // coverOutFD opens the coverage dump for appending: the file named by // MOXIE_COVER_OUT when it is set and can be opened, stderr otherwise. One file // accumulates every process and every spawn domain of a run, because each test // starts a fresh program and a fork's copy of the counter table is private; the // report tool sums the lines. The C helper reads the environment and opens the // path with the mode bits from the C headers, so no platform constants live in // Moxie. func coverOutFD() (fd int32) { name := []byte("MOXIE_COVER_OUT") name = name | []byte{0} p := moxieCoverEnv(unsafe.Pointer(&name[0])) if p == nil { return 2 } ofd := moxieCoverOpen(p) if ofd < 0 { return 2 } return ofd } //export moxie_cover_env func moxieCoverEnv(name unsafe.Pointer) (p unsafe.Pointer) //export moxie_cover_open func moxieCoverOpen(path unsafe.Pointer) (fd int32)