Commit 693748e9 authored by Joel Sing's avatar Joel Sing Committed by Tobias Klauser

syscall: resync various riscv64 structs with x/sys/unix

For some reason the existing versions have additional padding - manually resync these
structs with those in x/sys/unix, also bringing in pollFd which does not currently
exist for linux/riscv64.

Cross checked with the output from 'go tool cgo -godefs' on a linux/riscv64 machine.

Updates #27532

Change-Id: I9fd2d3ad7222208a138773f4a9153c3c9cad7381
Reviewed-on: https://go-review.googlesource.com/c/go/+/212763
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
parent f9813515
...@@ -50,6 +50,7 @@ package syscall ...@@ -50,6 +50,7 @@ package syscall
#include <linux/netlink.h> #include <linux/netlink.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/icmpv6.h> #include <linux/icmpv6.h>
#include <poll.h>
#include <termios.h> #include <termios.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -31,13 +31,11 @@ type Timeval struct { ...@@ -31,13 +31,11 @@ type Timeval struct {
type Timex struct { type Timex struct {
Modes uint32 Modes uint32
Pad_cgo_0 [4]byte
Offset int64 Offset int64
Freq int64 Freq int64
Maxerror int64 Maxerror int64
Esterror int64 Esterror int64
Status int32 Status int32
Pad_cgo_1 [4]byte
Constant int64 Constant int64
Precision int64 Precision int64
Tolerance int64 Tolerance int64
...@@ -46,14 +44,13 @@ type Timex struct { ...@@ -46,14 +44,13 @@ type Timex struct {
Ppsfreq int64 Ppsfreq int64
Jitter int64 Jitter int64
Shift int32 Shift int32
Pad_cgo_2 [4]byte
Stabil int64 Stabil int64
Jitcnt int64 Jitcnt int64
Calcnt int64 Calcnt int64
Errcnt int64 Errcnt int64
Stbcnt int64 Stbcnt int64
Tai int32 Tai int32
Pad_cgo_3 [44]byte _ [44]byte
} }
type Time_t int64 type Time_t int64
...@@ -131,12 +128,12 @@ type Statfs_t struct { ...@@ -131,12 +128,12 @@ type Statfs_t struct {
} }
type Dirent struct { type Dirent struct {
Ino uint64 Ino uint64
Off int64 Off int64
Reclen uint16 Reclen uint16
Type uint8 Type uint8
Name [256]uint8 Name [256]uint8
Pad_cgo_0 [5]byte _ [5]byte
} }
type Fsid struct { type Fsid struct {
...@@ -144,13 +141,12 @@ type Fsid struct { ...@@ -144,13 +141,12 @@ type Fsid struct {
} }
type Flock_t struct { type Flock_t struct {
Type int16 Type int16
Whence int16 Whence int16
Pad_cgo_0 [4]byte Start int64
Start int64 Len int64
Len int64 Pid int32
Pid int32 _ [4]byte
Pad_cgo_1 [4]byte
} }
type RawSockaddrInet4 struct { type RawSockaddrInet4 struct {
...@@ -231,13 +227,12 @@ type IPv6Mreq struct { ...@@ -231,13 +227,12 @@ type IPv6Mreq 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 uint64 Iovlen uint64
Control *byte Control *byte
Controllen uint64 Controllen uint64
Flags int32 Flags int32
Pad_cgo_1 [4]byte _ [4]byte
} }
type Cmsghdr struct { type Cmsghdr struct {
...@@ -279,7 +274,6 @@ type TCPInfo struct { ...@@ -279,7 +274,6 @@ type TCPInfo struct {
Probes uint8 Probes uint8
Backoff uint8 Backoff uint8
Options uint8 Options uint8
Pad_cgo_0 [2]byte
Rto uint32 Rto uint32
Ato uint32 Ato uint32
Snd_mss uint32 Snd_mss uint32
...@@ -497,9 +491,8 @@ type SockFilter struct { ...@@ -497,9 +491,8 @@ type SockFilter struct {
} }
type SockFprog struct { type SockFprog struct {
Len uint16 Len uint16
Pad_cgo_0 [6]byte Filter *SockFilter
Filter *SockFilter
} }
type InotifyEvent struct { type InotifyEvent struct {
...@@ -570,12 +563,11 @@ type Sysinfo_t struct { ...@@ -570,12 +563,11 @@ type Sysinfo_t struct {
Freeswap uint64 Freeswap uint64
Procs uint16 Procs uint16
Pad uint16 Pad uint16
Pad_cgo_0 [4]byte
Totalhigh uint64 Totalhigh uint64
Freehigh uint64 Freehigh uint64
Unit uint32 Unit uint32
X_f [0]uint8 _ [0]uint8
Pad_cgo_1 [4]byte _ [4]byte
} }
type Utsname struct { type Utsname struct {
...@@ -588,12 +580,11 @@ type Utsname struct { ...@@ -588,12 +580,11 @@ type Utsname struct {
} }
type Ustat_t struct { type Ustat_t struct {
Tfree int32 Tfree int32
Pad_cgo_0 [4]byte Tinode uint64
Tinode uint64 Fname [6]uint8
Fname [6]uint8 Fpack [6]uint8
Fpack [6]uint8 _ [4]byte
Pad_cgo_1 [4]byte
} }
type EpollEvent struct { type EpollEvent struct {
...@@ -610,16 +601,21 @@ const ( ...@@ -610,16 +601,21 @@ const (
_AT_EACCESS = 0x200 _AT_EACCESS = 0x200
) )
type pollFd struct {
Fd int32
Events int16
Revents int16
}
type Termios struct { type Termios struct {
Iflag uint32 Iflag uint32
Oflag uint32 Oflag uint32
Cflag uint32 Cflag uint32
Lflag uint32 Lflag uint32
Line uint8 Line uint8
Cc [32]uint8 Cc [19]uint8
Pad_cgo_0 [3]byte Ispeed uint32
Ispeed uint32 Ospeed uint32
Ospeed uint32
} }
const ( const (
......
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