]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: add #ifdefs to fix the manual corrections in ztypes_linux_arm.go
authorDave Cheney <dave@cheney.net>
Tue, 11 Oct 2011 19:47:00 +0000 (15:47 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 11 Oct 2011 19:47:00 +0000 (15:47 -0400)
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

src/pkg/syscall/types_linux.c
src/pkg/syscall/ztypes_linux_arm.go

index 3cf0e2e0d0607b2bc4b88b88c031eef7e931dd7f..8ede62fc1c08aa5cd98e2bfe68725ae0465155af 100644 (file)
@@ -103,9 +103,20 @@ struct sockaddr_any {
        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_in6 $RawSockaddrInet6;
-typedef struct sockaddr_un $RawSockaddrUnix;
+typedef struct my_sockaddr_un $RawSockaddrUnix;
 typedef struct sockaddr_ll $RawSockaddrLinklayer;
 typedef struct sockaddr_nl $RawSockaddrNetlink;
 typedef struct sockaddr $RawSockaddr;
@@ -251,7 +262,11 @@ enum {
 // Ptrace
 
 // 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
 
@@ -263,6 +278,11 @@ typedef struct ustat $Ustat_t;
 // The real epoll_event is a union, and godefs doesn't handle it well.
 struct my_epoll_event {
        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 pad;
 };
index 9fb7e347b69fe9c3c256ab156ae4a766fe399287..ca45a3cbe76784ec7220e79fea4fa6ee675ffa91 100644 (file)
@@ -2,11 +2,6 @@
 
 // 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
 
 // Constants
@@ -61,7 +56,7 @@ const (
        IFLA_LINKINFO           = 0x12
        IFLA_NET_NS_PID         = 0x13
        IFLA_IFALIAS            = 0x14
-       IFLA_MAX                = 0x14
+       IFLA_MAX                = 0x1c
        RT_SCOPE_UNIVERSE       = 0
        RT_SCOPE_SITE           = 0xc8
        RT_SCOPE_LINK           = 0xfd
@@ -239,7 +234,8 @@ type Statfs_t struct {
        Fsid         [8]byte /* __fsid_t */
        Namelen      int32
        Frsize       int32
-       Spare        [5]int32
+       Flags        int32
+       Spare        [4]int32
        Pad_godefs_0 [4]byte
 }
 
@@ -443,7 +439,9 @@ type InotifyEvent struct {
        Len    uint32
 }
 
-type PtraceRegs struct{}
+type PtraceRegs struct {
+       Uregs [18]uint32
+}
 
 type FdSet struct {
        Bits [32]int32