mirror of https://github.com/etcd-io/bbolt.git
commit
4f5275f4eb
|
@ -56,7 +56,9 @@ func mmap(db *DB, sz int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Advise the kernel that the mmap is accessed randomly.
|
// Advise the kernel that the mmap is accessed randomly.
|
||||||
if err := madvise(b, syscall.MADV_RANDOM); err != nil {
|
err = madvise(b, syscall.MADV_RANDOM)
|
||||||
|
if err != nil && err != syscall.ENOSYS {
|
||||||
|
// Ignore not implemented error in kernel because it still works.
|
||||||
return fmt.Errorf("madvise: %s", err)
|
return fmt.Errorf("madvise: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue