-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Madvise optional #82
Madvise optional #82
Conversation
Codecov Report
@@ Coverage Diff @@
## master #82 +/- ##
=========================================
Coverage ? 85.58%
=========================================
Files ? 9
Lines ? 1859
Branches ? 0
=========================================
Hits ? 1591
Misses ? 158
Partials ? 110
Continue to review full report at Codecov.
|
bolt_unix.go
Outdated
@@ -56,7 +56,10 @@ func mmap(db *DB, sz int) error { | |||
} | |||
|
|||
// 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 == syscall.ENOSYS { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if err!=nil && err!=syscall.ENOSYS
lgtm. can you squash the commits into one? |
done origin/master is merged so that's why other files looks changed. |
@honteng Can you revert the merge commit? Just your patch should work. |
ok, I removed. Please merge. |
OpenWRT Linux kernel doesn't support madvise syscall. It always returns "function not implemented" error, but it still works fine. This should be optional check.