Source File
ioctl.go
Belonging Package
golang.org/x/sys/unix
// Copyright 2018 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 aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
package unix
import (
)
// 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 ( int, uint, int) error {
return ioctl(, , uintptr())
}
// IoctlSetPointerInt performs an ioctl operation which sets an
// integer value on fd, using the specified request number. The ioctl
// argument is called with a pointer to the integer value, rather than
// passing the integer value directly.
func ( int, uint, int) error {
:= int32()
return ioctl(, , uintptr(unsafe.Pointer(&)))
}
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
//
// To change fd's window size, the req argument should be TIOCSWINSZ.
func ( int, uint, *Winsize) error {
// TODO: if we get the chance, remove the req parameter and
// hardcode TIOCSWINSZ.
:= ioctl(, , uintptr(unsafe.Pointer()))
runtime.KeepAlive()
return
}
// IoctlSetTermios performs an ioctl on fd with a *Termios.
//
// The req value will usually be TCSETA or TIOCSETA.
func ( int, uint, *Termios) error {
// TODO: if we get the chance, remove the req parameter.
:= ioctl(, , uintptr(unsafe.Pointer()))
runtime.KeepAlive()
return
}
// 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 ( int, uint) (int, error) {
var int
:= ioctl(, , uintptr(unsafe.Pointer(&)))
return ,
}
func ( int, uint) (*Winsize, error) {
var Winsize
:= ioctl(, , uintptr(unsafe.Pointer(&)))
return &,
}
func ( int, uint) (*Termios, error) {
var Termios
:= ioctl(, , uintptr(unsafe.Pointer(&)))
return &,
}
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)