Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unix: document IoctlSetWinsize and IoctlSetTermios and fix pointer li…
…fetime Change-Id: I42e59149e58bd928d9beb2c6665ce186b377d2a1 Reviewed-on: https://go-review.googlesource.com/125640 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
- Loading branch information
Showing
8 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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. | ||
|
||
// +build darwin dragonfly freebsd linux netbsd openbsd solaris | ||
|
||
package unix | ||
|
||
import "runtime" | ||
|
||
// 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 := ioctlSetWinsize(fd, req, value) | ||
runtime.KeepAlive(value) | ||
return err | ||
} | ||
|
||
// IoctlSetTermios performs an ioctl on fd with a *Termios. | ||
// | ||
// The req value will usually be TCSETA or TIOCSETA. | ||
func IoctlSetTermios(fd int, req uint, value *Termios) error { | ||
// TODO: if we get the chance, remove the req parameter. | ||
err := ioctlSetTermios(fd, req, value) | ||
runtime.KeepAlive(value) | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters