github.com/etecs-ru/go-sys-wineventlog@v0.0.0-20210227233244-4c3abb794018/unix/types_openbsd.go (about) 1 // Copyright 2009 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 README.md 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 unix 16 17 /* 18 #define KERNEL 19 #include <dirent.h> 20 #include <fcntl.h> 21 #include <poll.h> 22 #include <signal.h> 23 #include <termios.h> 24 #include <stdio.h> 25 #include <unistd.h> 26 #include <sys/param.h> 27 #include <sys/types.h> 28 #include <sys/event.h> 29 #include <sys/mman.h> 30 #include <sys/mount.h> 31 #include <sys/ptrace.h> 32 #include <sys/resource.h> 33 #include <sys/select.h> 34 #include <sys/signal.h> 35 #include <sys/socket.h> 36 #include <sys/stat.h> 37 #include <sys/time.h> 38 #include <sys/uio.h> 39 #include <sys/un.h> 40 #include <sys/utsname.h> 41 #include <sys/wait.h> 42 #include <uvm/uvmexp.h> 43 #include <net/bpf.h> 44 #include <net/if.h> 45 #include <net/if_dl.h> 46 #include <net/route.h> 47 #include <netinet/in.h> 48 #include <netinet/icmp6.h> 49 #include <netinet/tcp.h> 50 51 enum { 52 sizeofPtr = sizeof(void*), 53 }; 54 55 union sockaddr_all { 56 struct sockaddr s1; // this one gets used for fields 57 struct sockaddr_in s2; // these pad it out 58 struct sockaddr_in6 s3; 59 struct sockaddr_un s4; 60 struct sockaddr_dl s5; 61 }; 62 63 struct sockaddr_any { 64 struct sockaddr addr; 65 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 66 }; 67 68 */ 69 import "C" 70 71 // Machine characteristics 72 73 const ( 74 SizeofPtr = C.sizeofPtr 75 SizeofShort = C.sizeof_short 76 SizeofInt = C.sizeof_int 77 SizeofLong = C.sizeof_long 78 SizeofLongLong = C.sizeof_longlong 79 ) 80 81 // Basic types 82 83 type ( 84 _C_short C.short 85 _C_int C.int 86 _C_long C.long 87 _C_long_long C.longlong 88 ) 89 90 // Time 91 92 type Timespec C.struct_timespec 93 94 type Timeval C.struct_timeval 95 96 // Processes 97 98 type Rusage C.struct_rusage 99 100 type Rlimit C.struct_rlimit 101 102 type _Gid_t C.gid_t 103 104 // Files 105 106 type Stat_t C.struct_stat 107 108 type Statfs_t C.struct_statfs 109 110 type Flock_t C.struct_flock 111 112 type Dirent C.struct_dirent 113 114 type Fsid C.fsid_t 115 116 // File system limits 117 118 const ( 119 PathMax = C.PATH_MAX 120 ) 121 122 // Sockets 123 124 type RawSockaddrInet4 C.struct_sockaddr_in 125 126 type RawSockaddrInet6 C.struct_sockaddr_in6 127 128 type RawSockaddrUnix C.struct_sockaddr_un 129 130 type RawSockaddrDatalink C.struct_sockaddr_dl 131 132 type RawSockaddr C.struct_sockaddr 133 134 type RawSockaddrAny C.struct_sockaddr_any 135 136 type _Socklen C.socklen_t 137 138 type Linger C.struct_linger 139 140 type Iovec C.struct_iovec 141 142 type IPMreq C.struct_ip_mreq 143 144 type IPv6Mreq C.struct_ipv6_mreq 145 146 type Msghdr C.struct_msghdr 147 148 type Cmsghdr C.struct_cmsghdr 149 150 type Inet6Pktinfo C.struct_in6_pktinfo 151 152 type IPv6MTUInfo C.struct_ip6_mtuinfo 153 154 type ICMPv6Filter C.struct_icmp6_filter 155 156 const ( 157 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 158 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 159 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 160 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 161 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 162 SizeofLinger = C.sizeof_struct_linger 163 SizeofIovec = C.sizeof_struct_iovec 164 SizeofIPMreq = C.sizeof_struct_ip_mreq 165 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 166 SizeofMsghdr = C.sizeof_struct_msghdr 167 SizeofCmsghdr = C.sizeof_struct_cmsghdr 168 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 169 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 170 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 171 ) 172 173 // Ptrace requests 174 175 const ( 176 PTRACE_TRACEME = C.PT_TRACE_ME 177 PTRACE_CONT = C.PT_CONTINUE 178 PTRACE_KILL = C.PT_KILL 179 ) 180 181 // Events (kqueue, kevent) 182 183 type Kevent_t C.struct_kevent 184 185 // Select 186 187 type FdSet C.fd_set 188 189 // Routing and interface messages 190 191 const ( 192 SizeofIfMsghdr = C.sizeof_struct_if_msghdr 193 SizeofIfData = C.sizeof_struct_if_data 194 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 195 SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 196 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 197 SizeofRtMetrics = C.sizeof_struct_rt_metrics 198 ) 199 200 type IfMsghdr C.struct_if_msghdr 201 202 type IfData C.struct_if_data 203 204 type IfaMsghdr C.struct_ifa_msghdr 205 206 type IfAnnounceMsghdr C.struct_if_announcemsghdr 207 208 type RtMsghdr C.struct_rt_msghdr 209 210 type RtMetrics C.struct_rt_metrics 211 212 type Mclpool C.struct_mclpool 213 214 // Berkeley packet filter 215 216 const ( 217 SizeofBpfVersion = C.sizeof_struct_bpf_version 218 SizeofBpfStat = C.sizeof_struct_bpf_stat 219 SizeofBpfProgram = C.sizeof_struct_bpf_program 220 SizeofBpfInsn = C.sizeof_struct_bpf_insn 221 SizeofBpfHdr = C.sizeof_struct_bpf_hdr 222 ) 223 224 type BpfVersion C.struct_bpf_version 225 226 type BpfStat C.struct_bpf_stat 227 228 type BpfProgram C.struct_bpf_program 229 230 type BpfInsn C.struct_bpf_insn 231 232 type BpfHdr C.struct_bpf_hdr 233 234 type BpfTimeval C.struct_bpf_timeval 235 236 // Terminal handling 237 238 type Termios C.struct_termios 239 240 type Winsize C.struct_winsize 241 242 // fchmodat-like syscalls. 243 244 const ( 245 AT_FDCWD = C.AT_FDCWD 246 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW 247 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 248 ) 249 250 // poll 251 252 type PollFd C.struct_pollfd 253 254 const ( 255 POLLERR = C.POLLERR 256 POLLHUP = C.POLLHUP 257 POLLIN = C.POLLIN 258 POLLNVAL = C.POLLNVAL 259 POLLOUT = C.POLLOUT 260 POLLPRI = C.POLLPRI 261 POLLRDBAND = C.POLLRDBAND 262 POLLRDNORM = C.POLLRDNORM 263 POLLWRBAND = C.POLLWRBAND 264 POLLWRNORM = C.POLLWRNORM 265 ) 266 267 // Signal Sets 268 269 type Sigset_t C.sigset_t 270 271 // Uname 272 273 type Utsname C.struct_utsname 274 275 // Uvmexp 276 277 const SizeofUvmexp = C.sizeof_struct_uvmexp 278 279 type Uvmexp C.struct_uvmexp 280 281 // Clockinfo 282 283 const SizeofClockinfo = C.sizeof_struct_clockinfo 284 285 type Clockinfo C.struct_clockinfo