Skip to content

Commit

Permalink
unix: expose mmap calls on z/OS
Browse files Browse the repository at this point in the history
The calls `Mmap` and `Munmap` were removed for z/OS.
Syscall removed occurred in: 508397

This change exposes them in a z/OS specific file
(to remove the accidental deletion of them in future refactors of the APIs for `unix-like` OSes).

Change-Id: Ice0cabfb4547cab2ffa7130b7c26d9cc38233afe
GitHub-Last-Rev: e7b4680
GitHub-Pull-Request: #186
Reviewed-on: https://go-review.googlesource.com/c/sys/+/569359
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
  • Loading branch information
MacMalainey authored and gopherbot committed Mar 8, 2024
1 parent 360f961 commit 4be02d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion unix/mmap_nomremap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris
//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos

package unix

Expand Down
8 changes: 8 additions & 0 deletions unix/syscall_zos_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,14 @@ func (m *mmapper) Munmap(data []byte) (err error) {
return nil
}

func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
return mapper.Mmap(fd, offset, length, prot, flags)
}

func Munmap(b []byte) (err error) {
return mapper.Munmap(b)
}

func Read(fd int, p []byte) (n int, err error) {
n, err = read(fd, p)
if raceenabled {
Expand Down

0 comments on commit 4be02d3

Please sign in to comment.