all: add GOOS=ios

Following CL 254740, this CL does it on x/sys.

Updates golang/go#38485.

Change-Id: I5eab09a9a87c87fc883b5701434415648fb28eb0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255557
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Cherry Zhang
2020-09-23 18:26:05 +00:00
parent aee5d888a8
commit d9f96fdee2
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ func initOptions() {
func archInit() { func archInit() {
switch runtime.GOOS { switch runtime.GOOS {
case "android", "darwin", "netbsd": case "android", "darwin", "ios", "netbsd":
// Android and iOS don't seem to allow reading these registers. // Android and iOS don't seem to allow reading these registers.
// //
// NetBSD: // NetBSD:
+1 -1
View File
@@ -31,7 +31,7 @@ func TestAVX2hasAVX(t *testing.T) {
} }
func TestARM64minimalFeatures(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 return
} }
if !cpu.ARM64.HasASIMD { if !cpu.ARM64.HasASIMD {
+1 -1
View File
@@ -20,7 +20,7 @@ func cmsgAlignOf(salen int) int {
case "aix": case "aix":
// There is no alignment on AIX. // There is no alignment on AIX.
salign = 1 salign = 1
case "darwin", "illumos", "solaris": case "darwin", "ios", "illumos", "solaris":
// NOTE: It seems like 64-bit Darwin, Illumos and Solaris // NOTE: It seems like 64-bit Darwin, Illumos and Solaris
// kernels still require 32-bit aligned access to network // kernels still require 32-bit aligned access to network
// subsystem. // subsystem.
+1 -1
View File
@@ -272,7 +272,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
if err != nil { if err != nil {
return return
} }
if runtime.GOOS == "darwin" && len == 0 { if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && len == 0 {
// Accepted socket has no address. // Accepted socket has no address.
// This is likely due to a bug in xnu kernels, // This is likely due to a bug in xnu kernels,
// where instead of ECONNABORTED error socket // where instead of ECONNABORTED error socket
+6 -6
View File
@@ -165,7 +165,7 @@ func TestFcntlFlock(t *testing.T) {
// "-test.run=^TestPassFD$" and an environment variable used to signal // "-test.run=^TestPassFD$" and an environment variable used to signal
// that the test should become the child process instead. // that the test should become the child process instead.
func TestPassFD(t *testing.T) { 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") t.Skip("cannot exec subprocess on iOS, skipping test")
} }
@@ -377,7 +377,7 @@ func TestRlimit(t *testing.T) {
} }
set := rlimit set := rlimit
set.Cur = set.Max - 1 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 // rlim_min for RLIMIT_NOFILE should be equal to
// or lower than kern.maxfilesperproc, which on // or lower than kern.maxfilesperproc, which on
// some machines are 4096. See #40564. // some machines are 4096. See #40564.
@@ -394,7 +394,7 @@ func TestRlimit(t *testing.T) {
} }
set = rlimit set = rlimit
set.Cur = set.Max - 1 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 set.Cur = 4096
} }
if set != get { if set != get {
@@ -402,7 +402,7 @@ func TestRlimit(t *testing.T) {
// increase the soft limit of rlimit sandbox, though // increase the soft limit of rlimit sandbox, though
// Setrlimit never reports an error. // Setrlimit never reports an error.
switch runtime.GOOS { switch runtime.GOOS {
case "darwin": case "darwin", "ios":
default: default:
t.Fatalf("Rlimit: change failed: wanted %#v got %#v", set, get) 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) { func TestPoll(t *testing.T) {
if runtime.GOOS == "android" || 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") 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 { switch runtime.GOOS {
case "android": case "android":
dirs = []string{"/", "/system/bin"} dirs = []string{"/", "/system/bin"}
case "darwin": case "darwin", "ios":
switch runtime.GOARCH { switch runtime.GOARCH {
case "arm", "arm64": case "arm", "arm64":
d1, err := ioutil.TempDir("", "d1") d1, err := ioutil.TempDir("", "d1")