Improve OpenBSD memory handling#77
Improve OpenBSD memory handling#77jasperla wants to merge 2 commits intoelastic:masterfrom jasperla:openbsd_mem
Conversation
This ensures the types are packed correctly and we don't end up with a silent 0 for npages for example. closes #12
| rnswap := C.swapctl(C.SWAP_STATS, unsafe.Pointer(&swdev[0]), nswap) | ||
| if rnswap == 0 { | ||
| return nil | ||
| return fmt.Errorf("Failed to call swapctl(2)") |
There was a problem hiding this comment.
Will this return an error when a machine has 0 swap devices? The OpenBSD man page for swapctl(2) is somewhat ambiguous here, but my interpretation is that a return value of 0 is OK and -1 indicates failure.
There was a problem hiding this comment.
It won't return an error in such case; I've ran swapctl -d /dev/sd0b to remove my /dev/sd0b as a swap device and this conditional didn't get triggered.
❕ Build Aborted
Expand to view the summary
Build stats
Trends 🧪Steps errors
Expand to view the steps failures
|
❕ Build Aborted
Expand to view the summary
Build stats
Trends 🧪Steps errors
Expand to view the steps failures
|
❕ Build Aborted
Expand to view the summary
Build stats
Trends 🧪Steps errors
Expand to view the steps failures
|
As prompted by #72, the actual fix and some improvements in error reporting.
NB: This was tested with
examples/free/free.go, not cockroachdb itself.