...
Source file
src/syscall/sockcmsg_unix_other.go
Documentation: syscall
1
2
3
4
5
6
7 package syscall
8
9 import (
10 "runtime"
11 )
12
13
14 func cmsgAlignOf(salen int) int {
15 salign := sizeofPtr
16
17
18
19 switch runtime.GOOS {
20 case "aix":
21
22 salign = 1
23 case "darwin", "ios", "illumos", "solaris":
24
25
26
27 if sizeofPtr == 8 {
28 salign = 4
29 }
30 case "netbsd", "openbsd":
31
32 if runtime.GOARCH == "arm" {
33 salign = 8
34 }
35
36 if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" {
37 salign = 16
38 }
39 }
40
41 return (salen + salign - 1) & ^(salign - 1)
42 }
43
View as plain text