diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-03-15 07:10:25 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-03-16 06:19:58 -0400 |
commit | 310eae4ba44bc1c98c5cc5995f1f183b8ac432b1 (patch) | |
tree | 9f3fe5d78514078a40eb9da29932b218fbc9869a /vendor/golang.org/x/sys/unix/ioctl_zos.go | |
parent | e7dc59252bd722377938ac3e6b4fd7e077f05293 (diff) | |
download | podman-310eae4ba44bc1c98c5cc5995f1f183b8ac432b1.tar.gz podman-310eae4ba44bc1c98c5cc5995f1f183b8ac432b1.tar.bz2 podman-310eae4ba44bc1c98c5cc5995f1f183b8ac432b1.zip |
Switch all builds to pull-never
Fixes: https://github.com/containers/buildah/issues/2779
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/golang.org/x/sys/unix/ioctl_zos.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/ioctl_zos.go | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/unix/ioctl_zos.go b/vendor/golang.org/x/sys/unix/ioctl_zos.go new file mode 100644 index 000000000..5384e7d91 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/ioctl_zos.go @@ -0,0 +1,74 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build zos && s390x +// +build zos,s390x + +package unix + +import ( + "runtime" + "unsafe" +) + +// ioctl itself should not be exposed directly, but additional get/set +// functions for specific types are permissible. + +// IoctlSetInt performs an ioctl operation which sets an integer value +// on fd, using the specified request number. +func IoctlSetInt(fd int, req uint, value int) error { + return ioctl(fd, req, uintptr(value)) +} + +// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. +// +// To change fd's window size, the req argument should be TIOCSWINSZ. +func IoctlSetWinsize(fd int, req uint, value *Winsize) error { + // TODO: if we get the chance, remove the req parameter and + // hardcode TIOCSWINSZ. + err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) + runtime.KeepAlive(value) + return err +} + +// IoctlSetTermios performs an ioctl on fd with a *Termios. +// +// The req value is expected to be TCSETS, TCSETSW, or TCSETSF +func IoctlSetTermios(fd int, req uint, value *Termios) error { + if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) { + return ENOSYS + } + err := Tcsetattr(fd, int(req), value) + runtime.KeepAlive(value) + return err +} + +// IoctlGetInt performs an ioctl operation which gets an integer value +// from fd, using the specified request number. +// +// A few ioctl requests use the return value as an output parameter; +// for those, IoctlRetInt should be used instead of this function. +func IoctlGetInt(fd int, req uint) (int, error) { + var value int + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return value, err +} + +func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { + var value Winsize + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +// IoctlGetTermios performs an ioctl on fd with a *Termios. +// +// The req value is expected to be TCGETS +func IoctlGetTermios(fd int, req uint) (*Termios, error) { + var value Termios + if req != TCGETS { + return &value, ENOSYS + } + err := Tcgetattr(fd, &value) + return &value, err +} |