Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 911 Bytes

README.md

File metadata and controls

43 lines (33 loc) · 911 Bytes

badio

ptrace layer for triggering bad IO behavior.

Example:

$ make
$ (cd test && go build main.go)
$ cat test/main.go
package main

import (
	"os"
)

func main() {
	f, err := os.OpenFile("test.txt", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
	if err != nil {
		panic(err)
	}

	text := "some great stuff"
	_, _ = f.Write([]byte(text))

	_ = f.Close()
}
$ ./main test/main
Got a write on 3: some great stu
$ cat test.txt
some great stu

Notes

On Go writes on Linux: