New upstream version 0.0~git20161122.0.30237cf
MartÃn Ferrari
7 years ago
127 | 127 | #include <linux/wait.h> |
128 | 128 | #include <linux/icmpv6.h> |
129 | 129 | #include <linux/serial.h> |
130 | #include <linux/can.h> | |
130 | 131 | #include <net/route.h> |
131 | 132 | #include <asm/termbits.h> |
132 | 133 | |
338 | 339 | $2 !~ /^(BPF_TIMEVAL)$/ && |
339 | 340 | $2 ~ /^(BPF|DLT)_/ || |
340 | 341 | $2 ~ /^CLOCK_/ || |
342 | $2 ~ /^CAN_/ || | |
341 | 343 | $2 !~ "WMESGLEN" && |
342 | 344 | $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)} |
343 | 345 | $2 ~ /^__WCOREFLAG$/ {next} |
408 | 408 | sa.raw.Dev = sa.Dev |
409 | 409 | sa.raw.Channel = sa.Channel |
410 | 410 | return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil |
411 | } | |
412 | ||
413 | // SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets. | |
414 | // The RxID and TxID fields are used for transport protocol addressing in | |
415 | // (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with | |
416 | // zero values for CAN_RAW and CAN_BCM sockets as they have no meaning. | |
417 | // | |
418 | // The SockaddrCAN struct must be bound to the socket file descriptor | |
419 | // using Bind before the CAN socket can be used. | |
420 | // | |
421 | // // Read one raw CAN frame | |
422 | // fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW) | |
423 | // addr := &SockaddrCAN{Ifindex: index} | |
424 | // Bind(fd, addr) | |
425 | // frame := make([]byte, 16) | |
426 | // Read(fd, frame) | |
427 | // | |
428 | // The full SocketCAN documentation can be found in the linux kernel | |
429 | // archives at: https://www.kernel.org/doc/Documentation/networking/can.txt | |
430 | type SockaddrCAN struct { | |
431 | Ifindex int | |
432 | RxID uint32 | |
433 | TxID uint32 | |
434 | raw RawSockaddrCAN | |
435 | } | |
436 | ||
437 | func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) { | |
438 | if sa.Ifindex < 0 || sa.Ifindex > 0x7fffffff { | |
439 | return nil, 0, EINVAL | |
440 | } | |
441 | sa.raw.Family = AF_CAN | |
442 | sa.raw.Ifindex = int32(sa.Ifindex) | |
443 | rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) | |
444 | for i := 0; i < 4; i++ { | |
445 | sa.raw.Addr[i] = rx[i] | |
446 | } | |
447 | tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) | |
448 | for i := 0; i < 4; i++ { | |
449 | sa.raw.Addr[i+4] = tx[i] | |
450 | } | |
451 | return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil | |
411 | 452 | } |
412 | 453 | |
413 | 454 | func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { |
898 | 939 | //sysnb Getppid() (ppid int) |
899 | 940 | //sys Getpriority(which int, who int) (prio int, err error) |
900 | 941 | //sysnb Getrusage(who int, rusage *Rusage) (err error) |
942 | //sysnb Getsid(pid int) (sid int, err error) | |
901 | 943 | //sysnb Gettid() (tid int) |
902 | 944 | //sys Getxattr(path string, attr string, dest []byte) (sz int, err error) |
903 | 945 | //sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) |
910 | 952 | //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) |
911 | 953 | //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) |
912 | 954 | //sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT |
913 | //sysnb prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) = SYS_PRLIMIT64 | |
955 | //sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64 | |
914 | 956 | //sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) |
915 | 957 | //sys read(fd int, p []byte) (n int, err error) |
916 | 958 | //sys Removexattr(path string, attr string) (err error) |
57 | 57 | #include <utime.h> |
58 | 58 | #include <bluetooth/bluetooth.h> |
59 | 59 | #include <bluetooth/hci.h> |
60 | #include <linux/can.h> | |
60 | 61 | |
61 | 62 | #ifdef TCSETS2 |
62 | 63 | // On systems that have "struct termios2" use this as type Termios. |
217 | 218 | |
218 | 219 | type RawSockaddrHCI C.struct_sockaddr_hci |
219 | 220 | |
221 | type RawSockaddrCAN C.struct_sockaddr_can | |
222 | ||
220 | 223 | type RawSockaddr C.struct_sockaddr |
221 | 224 | |
222 | 225 | type RawSockaddrAny C.struct_sockaddr_any |
257 | 260 | SizeofSockaddrLinklayer = C.sizeof_struct_sockaddr_ll |
258 | 261 | SizeofSockaddrNetlink = C.sizeof_struct_sockaddr_nl |
259 | 262 | SizeofSockaddrHCI = C.sizeof_struct_sockaddr_hci |
263 | SizeofSockaddrCAN = C.sizeof_struct_sockaddr_can | |
260 | 264 | SizeofLinger = C.sizeof_struct_linger |
261 | 265 | SizeofIPMreq = C.sizeof_struct_ip_mreq |
262 | 266 | SizeofIPMreqn = C.sizeof_struct_ip_mreqn |
189 | 189 | BS0 = 0x0 |
190 | 190 | BS1 = 0x2000 |
191 | 191 | BSDLY = 0x2000 |
192 | CAN_BCM = 0x2 | |
193 | CAN_EFF_FLAG = 0x80000000 | |
194 | CAN_EFF_ID_BITS = 0x1d | |
195 | CAN_EFF_MASK = 0x1fffffff | |
196 | CAN_ERR_FLAG = 0x20000000 | |
197 | CAN_ERR_MASK = 0x1fffffff | |
198 | CAN_INV_FILTER = 0x20000000 | |
199 | CAN_ISOTP = 0x6 | |
200 | CAN_MAX_DLC = 0x8 | |
201 | CAN_MAX_DLEN = 0x8 | |
202 | CAN_MCNET = 0x5 | |
203 | CAN_MTU = 0x10 | |
204 | CAN_NPROTO = 0x7 | |
205 | CAN_RAW = 0x1 | |
206 | CAN_RTR_FLAG = 0x40000000 | |
207 | CAN_SFF_ID_BITS = 0xb | |
208 | CAN_SFF_MASK = 0x7ff | |
209 | CAN_TP16 = 0x3 | |
210 | CAN_TP20 = 0x4 | |
192 | 211 | CBAUD = 0x100f |
193 | 212 | CBAUDEX = 0x1000 |
194 | 213 | CFLUSH = 0xf |
189 | 189 | BS0 = 0x0 |
190 | 190 | BS1 = 0x2000 |
191 | 191 | BSDLY = 0x2000 |
192 | CAN_BCM = 0x2 | |
193 | CAN_EFF_FLAG = 0x80000000 | |
194 | CAN_EFF_ID_BITS = 0x1d | |
195 | CAN_EFF_MASK = 0x1fffffff | |
196 | CAN_ERR_FLAG = 0x20000000 | |
197 | CAN_ERR_MASK = 0x1fffffff | |
198 | CAN_INV_FILTER = 0x20000000 | |
199 | CAN_ISOTP = 0x6 | |
200 | CAN_MAX_DLC = 0x8 | |
201 | CAN_MAX_DLEN = 0x8 | |
202 | CAN_MCNET = 0x5 | |
203 | CAN_MTU = 0x10 | |
204 | CAN_NPROTO = 0x7 | |
205 | CAN_RAW = 0x1 | |
206 | CAN_RTR_FLAG = 0x40000000 | |
207 | CAN_SFF_ID_BITS = 0xb | |
208 | CAN_SFF_MASK = 0x7ff | |
209 | CAN_TP16 = 0x3 | |
210 | CAN_TP20 = 0x4 | |
192 | 211 | CBAUD = 0x100f |
193 | 212 | CBAUDEX = 0x1000 |
194 | 213 | CFLUSH = 0xf |
185 | 185 | BS0 = 0x0 |
186 | 186 | BS1 = 0x2000 |
187 | 187 | BSDLY = 0x2000 |
188 | CAN_BCM = 0x2 | |
189 | CAN_EFF_FLAG = 0x80000000 | |
190 | CAN_EFF_ID_BITS = 0x1d | |
191 | CAN_EFF_MASK = 0x1fffffff | |
192 | CAN_ERR_FLAG = 0x20000000 | |
193 | CAN_ERR_MASK = 0x1fffffff | |
194 | CAN_INV_FILTER = 0x20000000 | |
195 | CAN_ISOTP = 0x6 | |
196 | CAN_MAX_DLC = 0x8 | |
197 | CAN_MAX_DLEN = 0x8 | |
198 | CAN_MCNET = 0x5 | |
199 | CAN_MTU = 0x10 | |
200 | CAN_NPROTO = 0x7 | |
201 | CAN_RAW = 0x1 | |
202 | CAN_RTR_FLAG = 0x40000000 | |
203 | CAN_SFF_ID_BITS = 0xb | |
204 | CAN_SFF_MASK = 0x7ff | |
205 | CAN_TP16 = 0x3 | |
206 | CAN_TP20 = 0x4 | |
188 | 207 | CBAUD = 0x100f |
189 | 208 | CBAUDEX = 0x1000 |
190 | 209 | CFLUSH = 0xf |
195 | 195 | BS0 = 0x0 |
196 | 196 | BS1 = 0x2000 |
197 | 197 | BSDLY = 0x2000 |
198 | CAN_BCM = 0x2 | |
199 | CAN_EFF_FLAG = 0x80000000 | |
200 | CAN_EFF_ID_BITS = 0x1d | |
201 | CAN_EFF_MASK = 0x1fffffff | |
202 | CAN_ERR_FLAG = 0x20000000 | |
203 | CAN_ERR_MASK = 0x1fffffff | |
204 | CAN_INV_FILTER = 0x20000000 | |
205 | CAN_ISOTP = 0x6 | |
206 | CAN_MAX_DLC = 0x8 | |
207 | CAN_MAX_DLEN = 0x8 | |
208 | CAN_MCNET = 0x5 | |
209 | CAN_MTU = 0x10 | |
210 | CAN_NPROTO = 0x7 | |
211 | CAN_RAW = 0x1 | |
212 | CAN_RTR_FLAG = 0x40000000 | |
213 | CAN_SFF_ID_BITS = 0xb | |
214 | CAN_SFF_MASK = 0x7ff | |
215 | CAN_TP16 = 0x3 | |
216 | CAN_TP20 = 0x4 | |
198 | 217 | CBAUD = 0x100f |
199 | 218 | CBAUDEX = 0x1000 |
200 | 219 | CFLUSH = 0xf |
196 | 196 | BS0 = 0x0 |
197 | 197 | BS1 = 0x8000 |
198 | 198 | BSDLY = 0x8000 |
199 | CAN_BCM = 0x2 | |
200 | CAN_EFF_FLAG = 0x80000000 | |
201 | CAN_EFF_ID_BITS = 0x1d | |
202 | CAN_EFF_MASK = 0x1fffffff | |
203 | CAN_ERR_FLAG = 0x20000000 | |
204 | CAN_ERR_MASK = 0x1fffffff | |
205 | CAN_INV_FILTER = 0x20000000 | |
206 | CAN_ISOTP = 0x6 | |
207 | CAN_MAX_DLC = 0x8 | |
208 | CAN_MAX_DLEN = 0x8 | |
209 | CAN_MCNET = 0x5 | |
210 | CAN_MTU = 0x10 | |
211 | CAN_NPROTO = 0x7 | |
212 | CAN_RAW = 0x1 | |
213 | CAN_RTR_FLAG = 0x40000000 | |
214 | CAN_SFF_ID_BITS = 0xb | |
215 | CAN_SFF_MASK = 0x7ff | |
216 | CAN_TP16 = 0x3 | |
217 | CAN_TP20 = 0x4 | |
199 | 218 | CBAUD = 0xff |
200 | 219 | CBAUDEX = 0x0 |
201 | 220 | CFLUSH = 0xf |
195 | 195 | BS0 = 0x0 |
196 | 196 | BS1 = 0x8000 |
197 | 197 | BSDLY = 0x8000 |
198 | CAN_BCM = 0x2 | |
199 | CAN_EFF_FLAG = 0x80000000 | |
200 | CAN_EFF_ID_BITS = 0x1d | |
201 | CAN_EFF_MASK = 0x1fffffff | |
202 | CAN_ERR_FLAG = 0x20000000 | |
203 | CAN_ERR_MASK = 0x1fffffff | |
204 | CAN_INV_FILTER = 0x20000000 | |
205 | CAN_ISOTP = 0x6 | |
206 | CAN_MAX_DLC = 0x8 | |
207 | CAN_MAX_DLEN = 0x8 | |
208 | CAN_MCNET = 0x5 | |
209 | CAN_MTU = 0x10 | |
210 | CAN_NPROTO = 0x7 | |
211 | CAN_RAW = 0x1 | |
212 | CAN_RTR_FLAG = 0x40000000 | |
213 | CAN_SFF_ID_BITS = 0xb | |
214 | CAN_SFF_MASK = 0x7ff | |
215 | CAN_TP16 = 0x3 | |
216 | CAN_TP20 = 0x4 | |
198 | 217 | CBAUD = 0xff |
199 | 218 | CBAUDEX = 0x0 |
200 | 219 | CFLUSH = 0xf |
200 | 200 | BS0 = 0x0 |
201 | 201 | BS1 = 0x2000 |
202 | 202 | BSDLY = 0x2000 |
203 | CAN_BCM = 0x2 | |
204 | CAN_EFF_FLAG = 0x80000000 | |
205 | CAN_EFF_ID_BITS = 0x1d | |
206 | CAN_EFF_MASK = 0x1fffffff | |
207 | CAN_ERR_FLAG = 0x20000000 | |
208 | CAN_ERR_MASK = 0x1fffffff | |
209 | CAN_INV_FILTER = 0x20000000 | |
210 | CAN_ISOTP = 0x6 | |
211 | CAN_MAX_DLC = 0x8 | |
212 | CAN_MAX_DLEN = 0x8 | |
213 | CAN_MCNET = 0x5 | |
214 | CAN_MTU = 0x10 | |
215 | CAN_NPROTO = 0x7 | |
216 | CAN_RAW = 0x1 | |
217 | CAN_RTR_FLAG = 0x40000000 | |
218 | CAN_SFF_ID_BITS = 0xb | |
219 | CAN_SFF_MASK = 0x7ff | |
220 | CAN_TP16 = 0x3 | |
221 | CAN_TP20 = 0x4 | |
203 | 222 | CBAUD = 0x100f |
204 | 223 | CBAUDEX = 0x1000 |
205 | 224 | CFLUSH = 0xf |
204 | 204 | BS0 = 0x0 |
205 | 205 | BS1 = 0x2000 |
206 | 206 | BSDLY = 0x2000 |
207 | CAN_BCM = 0x2 | |
208 | CAN_EFF_FLAG = 0x80000000 | |
209 | CAN_EFF_ID_BITS = 0x1d | |
210 | CAN_EFF_MASK = 0x1fffffff | |
211 | CAN_ERR_FLAG = 0x20000000 | |
212 | CAN_ERR_MASK = 0x1fffffff | |
213 | CAN_INV_FILTER = 0x20000000 | |
214 | CAN_ISOTP = 0x6 | |
215 | CAN_MAX_DLC = 0x8 | |
216 | CAN_MAX_DLEN = 0x8 | |
217 | CAN_MCNET = 0x5 | |
218 | CAN_MTU = 0x10 | |
219 | CAN_NPROTO = 0x7 | |
220 | CAN_RAW = 0x1 | |
221 | CAN_RTR_FLAG = 0x40000000 | |
222 | CAN_SFF_ID_BITS = 0xb | |
223 | CAN_SFF_MASK = 0x7ff | |
224 | CAN_TP16 = 0x3 | |
225 | CAN_TP20 = 0x4 | |
207 | 226 | CBAUD = 0x100f |
208 | 227 | CBAUDEX = 0x1000 |
209 | 228 | CFLUSH = 0xf |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
571 | 571 | |
572 | 572 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
573 | 573 | |
574 | func Getsid(pid int) (sid int, err error) { | |
575 | r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) | |
576 | sid = int(r0) | |
577 | if e1 != 0 { | |
578 | err = errnoErr(e1) | |
579 | } | |
580 | return | |
581 | } | |
582 | ||
583 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | |
584 | ||
574 | 585 | func Gettid() (tid int) { |
575 | 586 | r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) |
576 | 587 | tid = int(r0) |
761 | 772 | |
762 | 773 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT |
763 | 774 | |
764 | func prlimit(pid int, resource int, old *Rlimit, newlimit *Rlimit) (err error) { | |
765 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(newlimit)), 0, 0) | |
775 | func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { | |
776 | _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) | |
766 | 777 | if e1 != 0 { |
767 | 778 | err = errnoErr(e1) |
768 | 779 | } |
200 | 200 | Family uint16 |
201 | 201 | Dev uint16 |
202 | 202 | Channel uint16 |
203 | } | |
204 | ||
205 | type RawSockaddrCAN struct { | |
206 | Family uint16 | |
207 | Pad_cgo_0 [2]byte | |
208 | Ifindex int32 | |
209 | Addr [8]byte | |
203 | 210 | } |
204 | 211 | |
205 | 212 | type RawSockaddr struct { |
325 | 332 | SizeofSockaddrLinklayer = 0x14 |
326 | 333 | SizeofSockaddrNetlink = 0xc |
327 | 334 | SizeofSockaddrHCI = 0x6 |
335 | SizeofSockaddrCAN = 0x10 | |
328 | 336 | SizeofLinger = 0x8 |
329 | 337 | SizeofIPMreq = 0x8 |
330 | 338 | SizeofIPMreqn = 0xc |
202 | 202 | Family uint16 |
203 | 203 | Dev uint16 |
204 | 204 | Channel uint16 |
205 | } | |
206 | ||
207 | type RawSockaddrCAN struct { | |
208 | Family uint16 | |
209 | Pad_cgo_0 [2]byte | |
210 | Ifindex int32 | |
211 | Addr [8]byte | |
205 | 212 | } |
206 | 213 | |
207 | 214 | type RawSockaddr struct { |
329 | 336 | SizeofSockaddrLinklayer = 0x14 |
330 | 337 | SizeofSockaddrNetlink = 0xc |
331 | 338 | SizeofSockaddrHCI = 0x6 |
339 | SizeofSockaddrCAN = 0x10 | |
332 | 340 | SizeofLinger = 0x8 |
333 | 341 | SizeofIPMreq = 0x8 |
334 | 342 | SizeofIPMreqn = 0xc |
0 | 0 | // +build arm,linux |
1 | 1 | // Created by cgo -godefs - DO NOT EDIT |
2 | // cgo -godefs types_linux.go | |
2 | // cgo -godefs types_linux.go | go run mkpost.go | |
3 | 3 | |
4 | 4 | package unix |
5 | 5 | |
154 | 154 | Pad_cgo_1 [4]byte |
155 | 155 | } |
156 | 156 | |
157 | const ( | |
158 | FADV_NORMAL = 0x0 | |
159 | FADV_RANDOM = 0x1 | |
160 | FADV_SEQUENTIAL = 0x2 | |
161 | FADV_WILLNEED = 0x3 | |
162 | FADV_DONTNEED = 0x4 | |
163 | FADV_NOREUSE = 0x5 | |
164 | ) | |
165 | ||
157 | 166 | type RawSockaddrInet4 struct { |
158 | 167 | Family uint16 |
159 | 168 | Port uint16 |
195 | 204 | Family uint16 |
196 | 205 | Dev uint16 |
197 | 206 | Channel uint16 |
207 | } | |
208 | ||
209 | type RawSockaddrCAN struct { | |
210 | Family uint16 | |
211 | Pad_cgo_0 [2]byte | |
212 | Ifindex int32 | |
213 | Addr [8]byte | |
198 | 214 | } |
199 | 215 | |
200 | 216 | type RawSockaddr struct { |
320 | 336 | SizeofSockaddrLinklayer = 0x14 |
321 | 337 | SizeofSockaddrNetlink = 0xc |
322 | 338 | SizeofSockaddrHCI = 0x6 |
339 | SizeofSockaddrCAN = 0x10 | |
323 | 340 | SizeofLinger = 0x8 |
324 | 341 | SizeofIPMreq = 0x8 |
325 | 342 | SizeofIPMreqn = 0xc |
203 | 203 | Family uint16 |
204 | 204 | Dev uint16 |
205 | 205 | Channel uint16 |
206 | } | |
207 | ||
208 | type RawSockaddrCAN struct { | |
209 | Family uint16 | |
210 | Pad_cgo_0 [2]byte | |
211 | Ifindex int32 | |
212 | Addr [8]byte | |
206 | 213 | } |
207 | 214 | |
208 | 215 | type RawSockaddr struct { |
330 | 337 | SizeofSockaddrLinklayer = 0x14 |
331 | 338 | SizeofSockaddrNetlink = 0xc |
332 | 339 | SizeofSockaddrHCI = 0x6 |
340 | SizeofSockaddrCAN = 0x10 | |
333 | 341 | SizeofLinger = 0x8 |
334 | 342 | SizeofIPMreq = 0x8 |
335 | 343 | SizeofIPMreqn = 0xc |
203 | 203 | Family uint16 |
204 | 204 | Dev uint16 |
205 | 205 | Channel uint16 |
206 | } | |
207 | ||
208 | type RawSockaddrCAN struct { | |
209 | Family uint16 | |
210 | Pad_cgo_0 [2]byte | |
211 | Ifindex int32 | |
212 | Addr [8]byte | |
206 | 213 | } |
207 | 214 | |
208 | 215 | type RawSockaddr struct { |
329 | 336 | SizeofSockaddrLinklayer = 0x14 |
330 | 337 | SizeofSockaddrNetlink = 0xc |
331 | 338 | SizeofSockaddrHCI = 0x6 |
339 | SizeofSockaddrCAN = 0x10 | |
332 | 340 | SizeofLinger = 0x8 |
333 | 341 | SizeofIPMreq = 0x8 |
334 | 342 | SizeofIPMreqn = 0xc |
203 | 203 | Family uint16 |
204 | 204 | Dev uint16 |
205 | 205 | Channel uint16 |
206 | } | |
207 | ||
208 | type RawSockaddrCAN struct { | |
209 | Family uint16 | |
210 | Pad_cgo_0 [2]byte | |
211 | Ifindex int32 | |
212 | Addr [8]byte | |
206 | 213 | } |
207 | 214 | |
208 | 215 | type RawSockaddr struct { |
329 | 336 | SizeofSockaddrLinklayer = 0x14 |
330 | 337 | SizeofSockaddrNetlink = 0xc |
331 | 338 | SizeofSockaddrHCI = 0x6 |
339 | SizeofSockaddrCAN = 0x10 | |
332 | 340 | SizeofLinger = 0x8 |
333 | 341 | SizeofIPMreq = 0x8 |
334 | 342 | SizeofIPMreqn = 0xc |
204 | 204 | Family uint16 |
205 | 205 | Dev uint16 |
206 | 206 | Channel uint16 |
207 | } | |
208 | ||
209 | type RawSockaddrCAN struct { | |
210 | Family uint16 | |
211 | Pad_cgo_0 [2]byte | |
212 | Ifindex int32 | |
213 | Addr [8]byte | |
207 | 214 | } |
208 | 215 | |
209 | 216 | type RawSockaddr struct { |
331 | 338 | SizeofSockaddrLinklayer = 0x14 |
332 | 339 | SizeofSockaddrNetlink = 0xc |
333 | 340 | SizeofSockaddrHCI = 0x6 |
341 | SizeofSockaddrCAN = 0x10 | |
334 | 342 | SizeofLinger = 0x8 |
335 | 343 | SizeofIPMreq = 0x8 |
336 | 344 | SizeofIPMreqn = 0xc |
204 | 204 | Family uint16 |
205 | 205 | Dev uint16 |
206 | 206 | Channel uint16 |
207 | } | |
208 | ||
209 | type RawSockaddrCAN struct { | |
210 | Family uint16 | |
211 | Pad_cgo_0 [2]byte | |
212 | Ifindex int32 | |
213 | Addr [8]byte | |
207 | 214 | } |
208 | 215 | |
209 | 216 | type RawSockaddr struct { |
331 | 338 | SizeofSockaddrLinklayer = 0x14 |
332 | 339 | SizeofSockaddrNetlink = 0xc |
333 | 340 | SizeofSockaddrHCI = 0x6 |
341 | SizeofSockaddrCAN = 0x10 | |
334 | 342 | SizeofLinger = 0x8 |
335 | 343 | SizeofIPMreq = 0x8 |
336 | 344 | SizeofIPMreqn = 0xc |
203 | 203 | Family uint16 |
204 | 204 | Dev uint16 |
205 | 205 | Channel uint16 |
206 | } | |
207 | ||
208 | type RawSockaddrCAN struct { | |
209 | Family uint16 | |
210 | Pad_cgo_0 [2]byte | |
211 | Ifindex int32 | |
212 | Addr [8]byte | |
206 | 213 | } |
207 | 214 | |
208 | 215 | type RawSockaddr struct { |
329 | 336 | SizeofSockaddrLinklayer = 0x14 |
330 | 337 | SizeofSockaddrNetlink = 0xc |
331 | 338 | SizeofSockaddrHCI = 0x6 |
339 | SizeofSockaddrCAN = 0x10 | |
332 | 340 | SizeofLinger = 0x8 |
333 | 341 | SizeofIPMreq = 0x8 |
334 | 342 | SizeofIPMreqn = 0xc |
208 | 208 | Family uint16 |
209 | 209 | Dev uint16 |
210 | 210 | Channel uint16 |
211 | } | |
212 | ||
213 | type RawSockaddrCAN struct { | |
214 | Family uint16 | |
215 | Pad_cgo_0 [2]byte | |
216 | Ifindex int32 | |
217 | Addr [8]byte | |
211 | 218 | } |
212 | 219 | |
213 | 220 | type RawSockaddr struct { |
334 | 341 | SizeofSockaddrLinklayer = 0x14 |
335 | 342 | SizeofSockaddrNetlink = 0xc |
336 | 343 | SizeofSockaddrHCI = 0x6 |
344 | SizeofSockaddrCAN = 0x10 | |
337 | 345 | SizeofLinger = 0x8 |
338 | 346 | SizeofIPMreq = 0x8 |
339 | 347 | SizeofIPMreqn = 0xc |