github.com/megatontech/mynoteforgo@v0.0.0-20200507084910-5d0c6ea6e890/源码/syscall/types_aix.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build ignore 6 7 /* 8 Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 */ 10 11 // +godefs map struct_in_addr [4]byte /* in_addr */ 12 // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 14 package syscall 15 16 /* 17 #include <sys/types.h> 18 #include <sys/time.h> 19 #include <sys/limits.h> 20 #include <sys/un.h> 21 #include <sys/utsname.h> 22 #include <sys/ptrace.h> 23 #include <sys/statfs.h> 24 25 #include <net/if.h> 26 #include <netinet/in.h> 27 #include <netinet/icmp6.h> 28 29 30 #include <dirent.h> 31 #include <fcntl.h> 32 #include <gcrypt.h> 33 34 enum { 35 sizeofPtr = sizeof(void*), 36 }; 37 38 union sockaddr_all { 39 struct sockaddr s1; // this one gets used for fields 40 struct sockaddr_in s2; // these pad it out 41 struct sockaddr_in6 s3; 42 struct sockaddr_un s4; 43 }; 44 45 struct sockaddr_any { 46 struct sockaddr addr; 47 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 48 }; 49 50 */ 51 import "C" 52 53 // Machine characteristics; for internal use. 54 55 const ( 56 sizeofPtr = C.sizeofPtr 57 sizeofShort = C.sizeof_short 58 sizeofInt = C.sizeof_int 59 sizeofLong = C.sizeof_long 60 sizeofLongLong = C.sizeof_longlong 61 PathMax = C.PATH_MAX 62 ) 63 64 // Basic types 65 66 type ( 67 _C_short C.short 68 _C_int C.int 69 _C_long C.long 70 _C_long_long C.longlong 71 ) 72 73 // Time 74 75 type Timespec C.struct_timespec 76 77 type Timeval C.struct_timeval 78 79 type Timeval32 C.struct_timeval32 80 81 type Timezone C.struct_timezone 82 83 // Processes 84 85 type Rusage C.struct_rusage 86 87 type Rlimit C.struct_rlimit 88 89 type _Pid_t C.pid_t 90 91 type _Gid_t C.gid_t 92 93 // Files 94 95 type Flock_t C.struct_flock 96 97 type Stat_t C.struct_stat 98 99 type Statfs_t C.struct_statfs 100 101 type Fsid64_t C.fsid64_t 102 103 type StTimespec_t C.st_timespec_t 104 105 type Dirent C.struct_dirent 106 107 // Sockets 108 109 type RawSockaddrInet4 C.struct_sockaddr_in 110 111 type RawSockaddrInet6 C.struct_sockaddr_in6 112 113 type RawSockaddrUnix C.struct_sockaddr_un 114 115 type RawSockaddr C.struct_sockaddr 116 117 type RawSockaddrAny C.struct_sockaddr_any 118 119 type _Socklen C.socklen_t 120 121 type Cmsghdr C.struct_cmsghdr 122 123 type ICMPv6Filter C.struct_icmp6_filter 124 125 type Iovec C.struct_iovec 126 127 type IPMreq C.struct_ip_mreq 128 129 type IPv6Mreq C.struct_ipv6_mreq 130 131 type Linger C.struct_linger 132 133 type Msghdr C.struct_msghdr 134 135 const ( 136 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 137 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 138 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 139 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 140 SizeofLinger = C.sizeof_struct_linger 141 SizeofIPMreq = C.sizeof_struct_ip_mreq 142 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 143 SizeofMsghdr = C.sizeof_struct_msghdr 144 SizeofCmsghdr = C.sizeof_struct_cmsghdr 145 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 146 ) 147 148 // Ptrace requests 149 150 const ( 151 PTRACE_TRACEME = C.PT_TRACE_ME 152 PTRACE_CONT = C.PT_CONTINUE 153 PTRACE_KILL = C.PT_KILL 154 ) 155 156 // Routing and interface messages 157 158 const ( 159 SizeofIfMsghdr = C.sizeof_struct_if_msghdr 160 ) 161 162 type IfMsgHdr C.struct_if_msghdr 163 164 // Misc 165 166 type Utsname C.struct_utsname 167 168 const ( 169 _AT_FDCWD = C.AT_FDCWD 170 _AT_REMOVEDIR = C.AT_REMOVEDIR 171 _AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 172 )