mirror of
https://github.com/golang/go
synced 2024-11-23 23:00:03 -07:00
syscall: add missing Setrlimit and Termios on aix/ppc64
This commits adds a missing syscall and a missing structure in syscall package. Change-Id: I9d630454c56337267f7bbb023e601246e14fc929 Reviewed-on: https://go-review.googlesource.com/c/163978 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
8ee9bca272
commit
4a9aba5afe
@ -601,6 +601,7 @@ func PtraceDetach(pid int) (err error) { return ptrace64(PT_DETACH, int64(pid),
|
||||
//sysnb Setpgid(pid int, pgid int) (err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
//sys Symlink(path string, link string) (err error)
|
||||
|
@ -26,6 +26,7 @@ package syscall
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/icmp6.h>
|
||||
|
||||
#include <termios.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
@ -170,3 +171,7 @@ const (
|
||||
_AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||
_AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
||||
// Terminal handling
|
||||
|
||||
type Termios C.struct_termios
|
||||
|
@ -83,6 +83,7 @@ import "unsafe"
|
||||
//go:cgo_import_dynamic libc_Setpgid setpgid "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Setregid setregid "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Setreuid setreuid "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Setrlimit setrlimit "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Stat stat "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Statfs statfs "libc.a/shr_64.o"
|
||||
//go:cgo_import_dynamic libc_Symlink symlink "libc.a/shr_64.o"
|
||||
@ -171,6 +172,7 @@ import "unsafe"
|
||||
//go:linkname libc_Setpgid libc_Setpgid
|
||||
//go:linkname libc_Setregid libc_Setregid
|
||||
//go:linkname libc_Setreuid libc_Setreuid
|
||||
//go:linkname libc_Setrlimit libc_Setrlimit
|
||||
//go:linkname libc_Stat libc_Stat
|
||||
//go:linkname libc_Statfs libc_Statfs
|
||||
//go:linkname libc_Symlink libc_Symlink
|
||||
@ -262,6 +264,7 @@ var (
|
||||
libc_Setpgid,
|
||||
libc_Setregid,
|
||||
libc_Setreuid,
|
||||
libc_Setrlimit,
|
||||
libc_Stat,
|
||||
libc_Statfs,
|
||||
libc_Symlink,
|
||||
@ -1198,6 +1201,16 @@ func Setreuid(ruid int, euid int) (err error) {
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Setrlimit(which int, lim *Rlimit) (err error) {
|
||||
_, _, e1 := rawSyscall6(uintptr(unsafe.Pointer(&libc_Setrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Stat(path string, stat *Stat_t) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -88,7 +88,6 @@ type Stat_t struct {
|
||||
Gid uint32
|
||||
Rdev uint64
|
||||
Ssize int32
|
||||
Pad_cgo_0 [4]byte
|
||||
Atim StTimespec_t
|
||||
Mtim StTimespec_t
|
||||
Ctim StTimespec_t
|
||||
@ -114,7 +113,6 @@ type Statfs_t struct {
|
||||
Ffree uint64
|
||||
Fsid Fsid64_t
|
||||
Vfstype int32
|
||||
Pad_cgo_0 [4]byte
|
||||
Fsize uint64
|
||||
Vfsnumber int32
|
||||
Vfsoff int32
|
||||
@ -123,7 +121,7 @@ type Statfs_t struct {
|
||||
Fname [32]uint8
|
||||
Fpack [32]uint8
|
||||
Name_max int32
|
||||
Pad_cgo_1 [4]byte
|
||||
Pad_cgo_0 [4]byte
|
||||
}
|
||||
|
||||
type Fsid64_t struct {
|
||||
@ -214,10 +212,8 @@ type Linger struct {
|
||||
type Msghdr struct {
|
||||
Name *byte
|
||||
Namelen uint32
|
||||
Pad_cgo_0 [4]byte
|
||||
Iov *Iovec
|
||||
Iovlen int32
|
||||
Pad_cgo_1 [4]byte
|
||||
Control *byte
|
||||
Controllen uint32
|
||||
Flags int32
|
||||
@ -270,3 +266,11 @@ const (
|
||||
_AT_REMOVEDIR = 0x1
|
||||
_AT_SYMLINK_NOFOLLOW = 0x1
|
||||
)
|
||||
|
||||
type Termios struct {
|
||||
Iflag uint32
|
||||
Oflag uint32
|
||||
Cflag uint32
|
||||
Lflag uint32
|
||||
Cc [16]uint8
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user