Skip to content

Commit

Permalink
fix mmap2
Browse files Browse the repository at this point in the history
  • Loading branch information
lunixbochs committed Sep 7, 2017
1 parent 5df5b0f commit 9c148d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 10 additions & 0 deletions go/kernel/linux/mman.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package linux

import (
co "github.com/lunixbochs/usercorn/go/kernel/common"
"github.com/lunixbochs/usercorn/go/native/enum"
)

func (k *LinuxKernel) Mmap2(addrHint, size uint64, prot enum.MmapProt, flags enum.MmapFlag, fd co.Fd, off co.Off) uint64 {
return k.Mmap(addrHint, size, prot, flags, fd, off*0x1000)
}
4 changes: 0 additions & 4 deletions go/kernel/posix/mman.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ func (k *PosixKernel) Mmap(addrHint, size uint64, prot enum.MmapProt, flags enum
return mmap.Addr
}

func (k *PosixKernel) Mmap2(addrHint, size uint64, prot enum.MmapProt, flags enum.MmapFlag, fd co.Fd, off co.Off) uint64 {
return k.Mmap(addrHint, size, prot, flags, fd, off)
}

func (k *PosixKernel) Munmap(addr, size uint64) uint64 {
return 0
}
Expand Down

0 comments on commit 9c148d7

Please sign in to comment.