add generated ztypes_arm.go and ztypes_freebsd_arm.go

Tidy unused ioctl arguments
This commit is contained in:
Yuval Pavel Zholkover
2014-03-15 12:35:43 +02:00
parent 88e4fdb5b4
commit 67e2db24c8
8 changed files with 45 additions and 14 deletions

View File

@@ -52,11 +52,9 @@ func ptsname(f *os.File) (string, error) {
}
func grantpt(f *os.File) error {
var u _C_int
return ioctl(f.Fd(), syscall.TIOCPTYGRANT, uintptr(unsafe.Pointer(&u)))
return ioctl(f.Fd(), syscall.TIOCPTYGRANT, 0)
}
func unlockpt(f *os.File) error {
var u _C_int
return ioctl(f.Fd(), syscall.TIOCPTYUNLK, uintptr(unsafe.Pointer(&u)))
return ioctl(f.Fd(), syscall.TIOCPTYUNLK, 0)
}

View File

@@ -7,10 +7,6 @@ import (
"unsafe"
)
const (
SPECNAMELEN = 63 /* max length of devicename <sys/param.h> */
)
func posix_openpt(oflag int) (fd int, err error) {
r0, _, e1 := syscall.Syscall(syscall.SYS_POSIX_OPENPT, uintptr(oflag), 0, 0)
fd = int(r0)
@@ -21,7 +17,7 @@ func posix_openpt(oflag int) (fd int, err error) {
}
func open() (pty, tty *os.File, err error) {
fd, err := posix_openpt(syscall.O_RDWR)
fd, err := posix_openpt(syscall.O_RDWR | syscall.O_CLOEXEC)
if err != nil {
return nil, nil, err
}
@@ -40,9 +36,8 @@ func open() (pty, tty *os.File, err error) {
}
func isptmaster(fd uintptr) (bool, error) {
var result int
err := ioctl(fd, syscall.TIOCPTMASTER, uintptr(unsafe.Pointer(&result)))
return (result == 0), err
err := ioctl(fd, syscall.TIOCPTMASTER, 0)
return err == nil, err
}
var (
@@ -59,7 +54,7 @@ func ptsname(f *os.File) (string, error) {
return "", syscall.EINVAL
}
const n = SPECNAMELEN + 1
const n = _C_SPECNAMELEN + 1
var (
buf = make([]byte, n)
arg = fiodgnameArg{Len: n, Buf: (*byte)(unsafe.Pointer(&buf[0]))}

View File

@@ -46,5 +46,6 @@ func ptsname(f *os.File) (string, error) {
func unlockpt(f *os.File) error {
var u _C_int
// use TIOCSPTLCK with a zero valued arg to clear the slave pty lock
return ioctl(f.Fd(), ioctl_TIOCSPTLCK, uintptr(unsafe.Pointer(&u)))
}

View File

@@ -2,7 +2,14 @@
package pty
// #include <sys/filio.h>
/*
#include <sys/param.h>
#include <sys/filio.h>
*/
import "C"
const (
_C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */
)
type fiodgnameArg C.struct_fiodgname_arg

9
ztypes_arm.go Normal file
View File

@@ -0,0 +1,9 @@
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types.go
package pty
type (
_C_int int32
_C_uint uint32
)

View File

@@ -3,6 +3,10 @@
package pty
const (
_C_SPECNAMELEN = 0x3f
)
type fiodgnameArg struct {
Len int32
Buf *byte

View File

@@ -3,6 +3,10 @@
package pty
const (
_C_SPECNAMELEN = 0x3f
)
type fiodgnameArg struct {
Len int32
Pad_cgo_0 [4]byte

13
ztypes_freebsd_arm.go Normal file
View File

@@ -0,0 +1,13 @@
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_freebsd.go
package pty
const (
_C_SPECNAMELEN = 0x3f
)
type fiodgnameArg struct {
Len int32
Buf *byte
}