aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2019-02-21 11:17:12 +0100
committerIan Lance Taylor <iant@golang.org>2019-02-27 13:47:27 +0000
commit4a9aba5afe8358b1f7a55d374fbefd9504f377e2 (patch)
tree8622998b35199055142ffcd6d0ec89004e7a9b14 /src/syscall
parent8ee9bca2729ead81da6bf5a18b87767ff396d1b7 (diff)
downloadgo-4a9aba5afe8358b1f7a55d374fbefd9504f377e2.tar.xz
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>
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/syscall_aix.go1
-rw-r--r--src/syscall/types_aix.go5
-rw-r--r--src/syscall/zsyscall_aix_ppc64.go13
-rw-r--r--src/syscall/ztypes_aix_ppc64.go56
4 files changed, 49 insertions, 26 deletions
diff --git a/src/syscall/syscall_aix.go b/src/syscall/syscall_aix.go
index ea88c666be..186522bdde 100644
--- a/src/syscall/syscall_aix.go
+++ b/src/syscall/syscall_aix.go
@@ -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)
diff --git a/src/syscall/types_aix.go b/src/syscall/types_aix.go
index b961bdb197..ee9380a673 100644
--- a/src/syscall/types_aix.go
+++ b/src/syscall/types_aix.go
@@ -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
diff --git a/src/syscall/zsyscall_aix_ppc64.go b/src/syscall/zsyscall_aix_ppc64.go
index fe27dcadf2..7d01dc013c 100644
--- a/src/syscall/zsyscall_aix_ppc64.go
+++ b/src/syscall/zsyscall_aix_ppc64.go
@@ -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)
diff --git a/src/syscall/ztypes_aix_ppc64.go b/src/syscall/ztypes_aix_ppc64.go
index 314266ea79..68810dbe7e 100644
--- a/src/syscall/ztypes_aix_ppc64.go
+++ b/src/syscall/ztypes_aix_ppc64.go
@@ -79,28 +79,27 @@ type Flock_t struct {
}
type Stat_t struct {
- Dev uint64
- Ino uint64
- Mode uint32
- Nlink int16
- Flag uint16
- Uid uint32
- Gid uint32
- Rdev uint64
- Ssize int32
- Pad_cgo_0 [4]byte
- Atim StTimespec_t
- Mtim StTimespec_t
- Ctim StTimespec_t
- Blksize int64
- Blocks int64
- Vfstype int32
- Vfs uint32
- Type uint32
- Gen uint32
- Reserved [9]uint32
- Padto_ll uint32
- Size int64
+ Dev uint64
+ Ino uint64
+ Mode uint32
+ Nlink int16
+ Flag uint16
+ Uid uint32
+ Gid uint32
+ Rdev uint64
+ Ssize int32
+ Atim StTimespec_t
+ Mtim StTimespec_t
+ Ctim StTimespec_t
+ Blksize int64
+ Blocks int64
+ Vfstype int32
+ Vfs uint32
+ Type uint32
+ Gen uint32
+ Reserved [9]uint32
+ Padto_ll uint32
+ Size int64
}
type Statfs_t struct {
@@ -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
+}