diff --git a/cpu/cpu_arm64.go b/cpu/cpu_arm64.go index 2d900243..951078f2 100644 --- a/cpu/cpu_arm64.go +++ b/cpu/cpu_arm64.go @@ -39,7 +39,7 @@ func initOptions() { func archInit() { switch runtime.GOOS { - case "android", "darwin", "netbsd": + case "android", "darwin", "ios", "netbsd": // Android and iOS don't seem to allow reading these registers. // // NetBSD: diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go index 83fa5ef1..c04ea744 100644 --- a/cpu/cpu_test.go +++ b/cpu/cpu_test.go @@ -31,7 +31,7 @@ func TestAVX2hasAVX(t *testing.T) { } func TestARM64minimalFeatures(t *testing.T) { - if runtime.GOARCH != "arm64" || runtime.GOOS == "darwin" { + if runtime.GOARCH != "arm64" || (runtime.GOOS == "darwin" || runtime.GOOS == "ios") { return } if !cpu.ARM64.HasASIMD { diff --git a/unix/sockcmsg_unix_other.go b/unix/sockcmsg_unix_other.go index 7d08dae5..abdedcf1 100644 --- a/unix/sockcmsg_unix_other.go +++ b/unix/sockcmsg_unix_other.go @@ -20,7 +20,7 @@ func cmsgAlignOf(salen int) int { case "aix": // There is no alignment on AIX. salign = 1 - case "darwin", "illumos", "solaris": + case "darwin", "ios", "illumos", "solaris": // NOTE: It seems like 64-bit Darwin, Illumos and Solaris // kernels still require 32-bit aligned access to network // subsystem. diff --git a/unix/syscall_bsd.go b/unix/syscall_bsd.go index 60bbe10a..9ebe92e4 100644 --- a/unix/syscall_bsd.go +++ b/unix/syscall_bsd.go @@ -272,7 +272,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { if err != nil { return } - if runtime.GOOS == "darwin" && len == 0 { + if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && len == 0 { // Accepted socket has no address. // This is likely due to a bug in xnu kernels, // where instead of ECONNABORTED error socket diff --git a/unix/syscall_unix_test.go b/unix/syscall_unix_test.go index 7d31402c..f86e1e2e 100644 --- a/unix/syscall_unix_test.go +++ b/unix/syscall_unix_test.go @@ -165,7 +165,7 @@ func TestFcntlFlock(t *testing.T) { // "-test.run=^TestPassFD$" and an environment variable used to signal // that the test should become the child process instead. func TestPassFD(t *testing.T) { - if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { + if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { t.Skip("cannot exec subprocess on iOS, skipping test") } @@ -377,7 +377,7 @@ func TestRlimit(t *testing.T) { } set := rlimit set.Cur = set.Max - 1 - if runtime.GOOS == "darwin" && set.Cur > 4096 { + if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && set.Cur > 4096 { // rlim_min for RLIMIT_NOFILE should be equal to // or lower than kern.maxfilesperproc, which on // some machines are 4096. See #40564. @@ -394,7 +394,7 @@ func TestRlimit(t *testing.T) { } set = rlimit set.Cur = set.Max - 1 - if runtime.GOOS == "darwin" && set.Cur > 4096 { + if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && set.Cur > 4096 { set.Cur = 4096 } if set != get { @@ -402,7 +402,7 @@ func TestRlimit(t *testing.T) { // increase the soft limit of rlimit sandbox, though // Setrlimit never reports an error. switch runtime.GOOS { - case "darwin": + case "darwin", "ios": default: t.Fatalf("Rlimit: change failed: wanted %#v got %#v", set, get) } @@ -483,7 +483,7 @@ func TestDup(t *testing.T) { func TestPoll(t *testing.T) { if runtime.GOOS == "android" || - (runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")) { + ((runtime.GOOS == "darwin" || runtime.GOOS == "ios") && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64")) { t.Skip("mkfifo syscall is not available on android and iOS, skipping test") } @@ -597,7 +597,7 @@ func TestGetwd(t *testing.T) { switch runtime.GOOS { case "android": dirs = []string{"/", "/system/bin"} - case "darwin": + case "darwin", "ios": switch runtime.GOARCH { case "arm", "arm64": d1, err := ioutil.TempDir("", "d1")