mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Ensure tsdb can be built on SmartOS/Illumos/Solaris
At the moment tsdb cannot be built on Illumos/Solaris due to - An exclude tag against Solaris is added in db_unix.go - We use built-in syscall package, which doesn't have nmmap and munmap support This PR supports build on Illumos/Solaris by remove the Solaris exclude tag in db_unix.go At the same time use golang.org/x/sys/unix package instead of syscall package, since it has Solaris nmmap and munmap implementation.
This commit is contained in:
parent
7337c6a513
commit
bfadf72d3f
|
@ -11,19 +11,20 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// +build !windows,!plan9,!solaris
|
||||
// +build !windows,!plan9
|
||||
|
||||
package tsdb
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func mmap(f *os.File, length int) ([]byte, error) {
|
||||
return syscall.Mmap(int(f.Fd()), 0, length, syscall.PROT_READ, syscall.MAP_SHARED)
|
||||
return unix.Mmap(int(f.Fd()), 0, length, unix.PROT_READ, unix.MAP_SHARED)
|
||||
}
|
||||
|
||||
func munmap(b []byte) (err error) {
|
||||
return syscall.Munmap(b)
|
||||
return unix.Munmap(b)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue