]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add missing Setrlimit and Termios on aix/ppc64
authorClément Chigot <clement.chigot@atos.net>
Thu, 21 Feb 2019 10:17:12 +0000 (11:17 +0100)
committerIan Lance Taylor <iant@golang.org>
Wed, 27 Feb 2019 13:47:27 +0000 (13:47 +0000)
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>
src/syscall/syscall_aix.go
src/syscall/types_aix.go
src/syscall/zsyscall_aix_ppc64.go
src/syscall/ztypes_aix_ppc64.go

index ea88c666bece4cc660c10ca054fa36f82c171cff..186522bdde75fcc37ed815be91bd938d09c378ad 100644 (file)
@@ -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)
index b961bdb197eaac372e7e7cda6a504d0b1ddbec58..ee9380a67365792f489b9eea8894daa91c788a8d 100644 (file)
@@ -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
index fe27dcadf2802345aaaad097f4b37f795c6c0ea2..7d01dc013c6c544c5436ed06a1bc642e63bdb91a 100644 (file)
@@ -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)
index 314266ea797768e6ca9b3d39b1cb67208ce808b4..68810dbe7e6ba73363e9f129717972ccfd5aa3e4 100644 (file)
@@ -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
+}