-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Prctl() and ioctl wrapper functions from x/sys/unix #1504
Use Prctl() and ioctl wrapper functions from x/sys/unix #1504
Conversation
Rebased on latest master to hopefully fix the shfmt issues which made Travis CI fail. |
@@ -123,8 +123,8 @@ func unlockpt(f *os.File) error { | |||
|
|||
// ptsname retrieves the name of the first available pts for the given master. | |||
func ptsname(f *os.File) (string, error) { | |||
var n int32 | |||
if err := ioctl(f.Fd(), unix.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil { | |||
n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCGPTN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks ! Do you also want to make the same changes to https://github.com/containerd/console/blob/master/tc_linux.go ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will look into it and prepare a PR.
The |
It looks like this is actually a bug in
|
Update golang.org/x/sys to get newly added functions and constants which will be used in successive commits. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Use unix.Prctl() instead of manually reimplementing it using unix.RawSyscall. Also use unix.SECCOMP_MODE_FILTER instead of locally defining it. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Use IoctlGetInt and IoctlGetTermios/IoctlSetTermios instead of manually reimplementing them. Because of unlockpt, the ioctl wrapper is still needed as it needs to pass a pointer to a value, which is not supported by any ioctl function in x/sys/unix yet. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Rebased on latest master with shfmt removed. Travis is now happy again 😎 |
Update golang.org/x/sys/unix once again to get some more newly added wrapper functions and switch libcontainer to use them instead of manually reimplemented local wrappers.