@@ -2125,28 +2125,6 @@ func writevRacedetect(iovecs []Iovec, n int) {
2125
2125
// mmap varies by architecture; see syscall_linux_*.go.
2126
2126
//sys munmap(addr uintptr, length uintptr) (err error)
2127
2127
//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
-
2150
2128
//sys Madvise(b []byte, advice int) (err error)
2151
2129
//sys Mprotect(b []byte, prot int) (err error)
2152
2130
//sys Mlock(b []byte) (err error)
@@ -2155,6 +2133,12 @@ func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
2155
2133
//sys Munlock(b []byte) (err error)
2156
2134
//sys Munlockall() (err error)
2157
2135
2136
+ const (
2137
+ mremapFixed = MREMAP_FIXED
2138
+ mremapDontunmap = MREMAP_DONTUNMAP
2139
+ mremapMaymove = MREMAP_MAYMOVE
2140
+ )
2141
+
2158
2142
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
2159
2143
// using the specified flags.
2160
2144
func Vmsplice (fd int , iovs []Iovec , flags int ) (int , error ) {
0 commit comments