Commit 4a9aba5a authored by Clément Chigot's avatar Clément Chigot Committed by Ian Lance Taylor

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: default avatarTobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 8ee9bca2
...@@ -601,6 +601,7 @@ func PtraceDetach(pid int) (err error) { return ptrace64(PT_DETACH, int64(pid), ...@@ -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 Setpgid(pid int, pgid int) (err error)
//sysnb Setregid(rgid int, egid int) (err error) //sysnb Setregid(rgid int, egid int) (err error)
//sysnb Setreuid(ruid int, euid 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 Stat(path string, stat *Stat_t) (err error)
//sys Statfs(path string, buf *Statfs_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error)
//sys Symlink(path string, link string) (err error) //sys Symlink(path string, link string) (err error)
......
...@@ -26,6 +26,7 @@ package syscall ...@@ -26,6 +26,7 @@ package syscall
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/icmp6.h> #include <netinet/icmp6.h>
#include <termios.h>
#include <dirent.h> #include <dirent.h>
#include <fcntl.h> #include <fcntl.h>
...@@ -170,3 +171,7 @@ const ( ...@@ -170,3 +171,7 @@ const (
_AT_REMOVEDIR = C.AT_REMOVEDIR _AT_REMOVEDIR = C.AT_REMOVEDIR
_AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW _AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
) )
// Terminal handling
type Termios C.struct_termios
...@@ -83,6 +83,7 @@ import "unsafe" ...@@ -83,6 +83,7 @@ import "unsafe"
//go:cgo_import_dynamic libc_Setpgid setpgid "libc.a/shr_64.o" //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_Setregid setregid "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Setreuid setreuid "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_Stat stat "libc.a/shr_64.o"
//go:cgo_import_dynamic libc_Statfs statfs "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" //go:cgo_import_dynamic libc_Symlink symlink "libc.a/shr_64.o"
...@@ -171,6 +172,7 @@ import "unsafe" ...@@ -171,6 +172,7 @@ import "unsafe"
//go:linkname libc_Setpgid libc_Setpgid //go:linkname libc_Setpgid libc_Setpgid
//go:linkname libc_Setregid libc_Setregid //go:linkname libc_Setregid libc_Setregid
//go:linkname libc_Setreuid libc_Setreuid //go:linkname libc_Setreuid libc_Setreuid
//go:linkname libc_Setrlimit libc_Setrlimit
//go:linkname libc_Stat libc_Stat //go:linkname libc_Stat libc_Stat
//go:linkname libc_Statfs libc_Statfs //go:linkname libc_Statfs libc_Statfs
//go:linkname libc_Symlink libc_Symlink //go:linkname libc_Symlink libc_Symlink
...@@ -262,6 +264,7 @@ var ( ...@@ -262,6 +264,7 @@ var (
libc_Setpgid, libc_Setpgid,
libc_Setregid, libc_Setregid,
libc_Setreuid, libc_Setreuid,
libc_Setrlimit,
libc_Stat, libc_Stat,
libc_Statfs, libc_Statfs,
libc_Symlink, libc_Symlink,
...@@ -1198,6 +1201,16 @@ func Setreuid(ruid int, euid int) (err error) { ...@@ -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 // 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) { func Stat(path string, stat *Stat_t) (err error) {
var _p0 *byte var _p0 *byte
_p0, err = BytePtrFromString(path) _p0, err = BytePtrFromString(path)
......
...@@ -79,28 +79,27 @@ type Flock_t struct { ...@@ -79,28 +79,27 @@ type Flock_t struct {
} }
type Stat_t struct { type Stat_t struct {
Dev uint64 Dev uint64
Ino uint64 Ino uint64
Mode uint32 Mode uint32
Nlink int16 Nlink int16
Flag uint16 Flag uint16
Uid uint32 Uid uint32
Gid uint32 Gid uint32
Rdev uint64 Rdev uint64
Ssize int32 Ssize int32
Pad_cgo_0 [4]byte Atim StTimespec_t
Atim StTimespec_t Mtim StTimespec_t
Mtim StTimespec_t Ctim StTimespec_t
Ctim StTimespec_t Blksize int64
Blksize int64 Blocks int64
Blocks int64 Vfstype int32
Vfstype int32 Vfs uint32
Vfs uint32 Type uint32
Type uint32 Gen uint32
Gen uint32 Reserved [9]uint32
Reserved [9]uint32 Padto_ll uint32
Padto_ll uint32 Size int64
Size int64
} }
type Statfs_t struct { type Statfs_t struct {
...@@ -114,7 +113,6 @@ type Statfs_t struct { ...@@ -114,7 +113,6 @@ type Statfs_t struct {
Ffree uint64 Ffree uint64
Fsid Fsid64_t Fsid Fsid64_t
Vfstype int32 Vfstype int32
Pad_cgo_0 [4]byte
Fsize uint64 Fsize uint64
Vfsnumber int32 Vfsnumber int32
Vfsoff int32 Vfsoff int32
...@@ -123,7 +121,7 @@ type Statfs_t struct { ...@@ -123,7 +121,7 @@ type Statfs_t struct {
Fname [32]uint8 Fname [32]uint8
Fpack [32]uint8 Fpack [32]uint8
Name_max int32 Name_max int32
Pad_cgo_1 [4]byte Pad_cgo_0 [4]byte
} }
type Fsid64_t struct { type Fsid64_t struct {
...@@ -214,10 +212,8 @@ type Linger struct { ...@@ -214,10 +212,8 @@ type Linger struct {
type Msghdr struct { type Msghdr struct {
Name *byte Name *byte
Namelen uint32 Namelen uint32
Pad_cgo_0 [4]byte
Iov *Iovec Iov *Iovec
Iovlen int32 Iovlen int32
Pad_cgo_1 [4]byte
Control *byte Control *byte
Controllen uint32 Controllen uint32
Flags int32 Flags int32
...@@ -270,3 +266,11 @@ const ( ...@@ -270,3 +266,11 @@ const (
_AT_REMOVEDIR = 0x1 _AT_REMOVEDIR = 0x1
_AT_SYMLINK_NOFOLLOW = 0x1 _AT_SYMLINK_NOFOLLOW = 0x1
) )
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [16]uint8
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment