@@ -2125,28 +2125,6 @@ func writevRacedetect(iovecs []Iovec, n int) {
21252125// mmap varies by architecture; see syscall_linux_*.go.
21262126//sys munmap(addr uintptr, length uintptr) (err error)
21272127//sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error)
2128-
2129- var mapper = & mremapMmapper {
2130- mmapper : mmapper {
2131- active : make (map [* byte ][]byte ),
2132- mmap : mmap ,
2133- munmap : munmap ,
2134- },
2135- mremap : mremap ,
2136- }
2137-
2138- func Mmap (fd int , offset int64 , length int , prot int , flags int ) (data []byte , err error ) {
2139- return mapper .Mmap (fd , offset , length , prot , flags )
2140- }
2141-
2142- func Munmap (b []byte ) (err error ) {
2143- return mapper .Munmap (b )
2144- }
2145-
2146- func Mremap (oldData []byte , newLength int , flags int ) (data []byte , err error ) {
2147- return mapper .Mremap (oldData , newLength , flags )
2148- }
2149-
21502128//sys Madvise(b []byte, advice int) (err error)
21512129//sys Mprotect(b []byte, prot int) (err error)
21522130//sys Mlock(b []byte) (err error)
@@ -2155,6 +2133,12 @@ func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
21552133//sys Munlock(b []byte) (err error)
21562134//sys Munlockall() (err error)
21572135
2136+ const (
2137+ mremapFixed = MREMAP_FIXED
2138+ mremapDontunmap = MREMAP_DONTUNMAP
2139+ mremapMaymove = MREMAP_MAYMOVE
2140+ )
2141+
21582142// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
21592143// using the specified flags.
21602144func Vmsplice (fd int , iovs []Iovec , flags int ) (int , error ) {
0 commit comments