mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #200 from jaxi/build_on_smartos
Ensure tsdb can be built on SmartOS/Illumos/Solaris
This commit is contained in:
commit
a00d700d48
|
@ -11,19 +11,20 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// +build !windows,!plan9,!solaris
|
// +build !windows,!plan9
|
||||||
|
|
||||||
package tsdb
|
package tsdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
|
||||||
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func mmap(f *os.File, length int) ([]byte, error) {
|
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) {
|
func munmap(b []byte) (err error) {
|
||||||
return syscall.Munmap(b)
|
return unix.Munmap(b)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue