Merge pull request #200 from jaxi/build_on_smartos

Ensure tsdb can be built on SmartOS/Illumos/Solaris
pull/5805/head
Goutham Veeramachaneni 7 years ago committed by GitHub
commit a00d700d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save