mirror of
https://github.com/golang/go
synced 2024-11-12 06:20:22 -07:00
syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go
Fixes #1998. ztypes_linux_arm.go has been regenerated on an arm5 debian sid host and includes a few new constants. R=golang-dev, mikioh.mikioh, rsc CC=golang-dev https://golang.org/cl/5240047
This commit is contained in:
parent
ec7963565a
commit
9691312e53
@ -103,9 +103,20 @@ struct sockaddr_any {
|
|||||||
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// copied from /usr/include/linux/un.h
|
||||||
|
struct my_sockaddr_un {
|
||||||
|
sa_family_t sun_family;
|
||||||
|
#ifdef __ARM_EABI__
|
||||||
|
// on ARM char is by default unsigned
|
||||||
|
signed char sun_path[108];
|
||||||
|
#else
|
||||||
|
char sun_path[108];
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct sockaddr_in $RawSockaddrInet4;
|
typedef struct sockaddr_in $RawSockaddrInet4;
|
||||||
typedef struct sockaddr_in6 $RawSockaddrInet6;
|
typedef struct sockaddr_in6 $RawSockaddrInet6;
|
||||||
typedef struct sockaddr_un $RawSockaddrUnix;
|
typedef struct my_sockaddr_un $RawSockaddrUnix;
|
||||||
typedef struct sockaddr_ll $RawSockaddrLinklayer;
|
typedef struct sockaddr_ll $RawSockaddrLinklayer;
|
||||||
typedef struct sockaddr_nl $RawSockaddrNetlink;
|
typedef struct sockaddr_nl $RawSockaddrNetlink;
|
||||||
typedef struct sockaddr $RawSockaddr;
|
typedef struct sockaddr $RawSockaddr;
|
||||||
@ -251,7 +262,11 @@ enum {
|
|||||||
// Ptrace
|
// Ptrace
|
||||||
|
|
||||||
// Register structures
|
// Register structures
|
||||||
typedef struct user_regs_struct $PtraceRegs;
|
#ifdef __ARM_EABI__
|
||||||
|
typedef struct user_regs $PtraceRegs;
|
||||||
|
#else
|
||||||
|
typedef struct user_regs_struct $PtraceRegs;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
|
|
||||||
@ -263,6 +278,11 @@ typedef struct ustat $Ustat_t;
|
|||||||
// The real epoll_event is a union, and godefs doesn't handle it well.
|
// The real epoll_event is a union, and godefs doesn't handle it well.
|
||||||
struct my_epoll_event {
|
struct my_epoll_event {
|
||||||
uint32_t events;
|
uint32_t events;
|
||||||
|
#ifdef __ARM_EABI__
|
||||||
|
// padding is not specified in linux/eventpoll.h but added to conform to the
|
||||||
|
// alignment requirements of EABI
|
||||||
|
int32_t padFd;
|
||||||
|
#endif
|
||||||
int32_t fd;
|
int32_t fd;
|
||||||
int32_t pad;
|
int32_t pad;
|
||||||
};
|
};
|
||||||
|
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
// MACHINE GENERATED - DO NOT EDIT.
|
// MACHINE GENERATED - DO NOT EDIT.
|
||||||
|
|
||||||
// Manual corrections: TODO(rsc): need to fix godefs
|
|
||||||
// remove duplicate PtraceRegs type
|
|
||||||
// change RawSockaddrUnix field to Path [108]int8 (was uint8)
|
|
||||||
// add padding to EpollEvent
|
|
||||||
|
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
@ -61,7 +56,7 @@ const (
|
|||||||
IFLA_LINKINFO = 0x12
|
IFLA_LINKINFO = 0x12
|
||||||
IFLA_NET_NS_PID = 0x13
|
IFLA_NET_NS_PID = 0x13
|
||||||
IFLA_IFALIAS = 0x14
|
IFLA_IFALIAS = 0x14
|
||||||
IFLA_MAX = 0x14
|
IFLA_MAX = 0x1c
|
||||||
RT_SCOPE_UNIVERSE = 0
|
RT_SCOPE_UNIVERSE = 0
|
||||||
RT_SCOPE_SITE = 0xc8
|
RT_SCOPE_SITE = 0xc8
|
||||||
RT_SCOPE_LINK = 0xfd
|
RT_SCOPE_LINK = 0xfd
|
||||||
@ -239,7 +234,8 @@ type Statfs_t struct {
|
|||||||
Fsid [8]byte /* __fsid_t */
|
Fsid [8]byte /* __fsid_t */
|
||||||
Namelen int32
|
Namelen int32
|
||||||
Frsize int32
|
Frsize int32
|
||||||
Spare [5]int32
|
Flags int32
|
||||||
|
Spare [4]int32
|
||||||
Pad_godefs_0 [4]byte
|
Pad_godefs_0 [4]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -443,7 +439,9 @@ type InotifyEvent struct {
|
|||||||
Len uint32
|
Len uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
type PtraceRegs struct{}
|
type PtraceRegs struct {
|
||||||
|
Uregs [18]uint32
|
||||||
|
}
|
||||||
|
|
||||||
type FdSet struct {
|
type FdSet struct {
|
||||||
Bits [32]int32
|
Bits [32]int32
|
||||||
|
Loading…
Reference in New Issue
Block a user