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