Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
Created July 15, 2015 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jayjanssen/8ee0659dc0618ba60268 to your computer and use it in GitHub Desktop.
Save jayjanssen/8ee0659dc0618ba60268 to your computer and use it in GitHub Desktop.
Can I read the gcache mmap?
package main
import "github.com/riobard/go-mmap"
import "fmt"
import "os"
func main() {
file, err := os.Open( "/gcache/galera.cache")
if err != nil {
panic( err )
}
fmt.Println( "Opened")
gcache, err := mmap.Map( file, 4096, 50000000000, mmap.PROT_READ, mmap.MAP_SHARED )
if err != nil {
panic( err )
}
for i := 0; i < 4096; i++ {
fmt.Println( "str: ", string(gcache[i:(i+64)]))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment