diff options
author | Cherry Zhang <cherryyz@google.com> | 2020-09-16 16:59:58 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2020-09-23 18:12:59 +0000 |
commit | a413908dd064de6e3ea5b8d95d707a532bd3f4c8 (patch) | |
tree | ca1bb03a29fff2bb902aa015fe04fcd36988394d /src/syscall | |
parent | bc320fc1f5bc5d6019e3d8d62aa32eac3417bb7f (diff) | |
download | go-a413908dd064de6e3ea5b8d95d707a532bd3f4c8.tar.gz go-a413908dd064de6e3ea5b8d95d707a532bd3f4c8.zip |
all: add GOOS=ios
Introduce GOOS=ios for iOS systems. GOOS=ios matches "darwin"
build tag, like GOOS=android matches "linux" and GOOS=illumos
matches "solaris". Only ios/arm64 is supported (ios/amd64 is
not).
GOOS=ios and GOOS=darwin remain essentially the same at this
point. They will diverge at later time, to differentiate macOS
and iOS.
Uses of GOOS=="darwin" are changed to (GOOS=="darwin" || GOOS=="ios"),
except if it clearly means macOS (e.g. GOOS=="darwin" && GOARCH=="amd64"),
it remains GOOS=="darwin".
Updates #38485.
Change-Id: I4faacdc1008f42434599efb3c3ad90763a83b67c
Reviewed-on: https://go-review.googlesource.com/c/go/+/254740
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/syscall')
-rw-r--r-- | src/syscall/exec_unix.go | 2 | ||||
-rw-r--r-- | src/syscall/sockcmsg_unix_other.go | 2 | ||||
-rw-r--r-- | src/syscall/syscall_bsd.go | 2 | ||||
-rw-r--r-- | src/syscall/syscall_unix.go | 2 | ||||
-rw-r--r-- | src/syscall/syscall_unix_test.go | 6 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go index cb08b7084c..725c2bc1f9 100644 --- a/src/syscall/exec_unix.go +++ b/src/syscall/exec_unix.go @@ -296,7 +296,7 @@ func Exec(argv0 string, argv []string, envv []string) (err error) { uintptr(unsafe.Pointer(argv0p)), uintptr(unsafe.Pointer(&argvp[0])), uintptr(unsafe.Pointer(&envvp[0]))) - } else if runtime.GOOS == "darwin" { + } else if runtime.GOOS == "darwin" || runtime.GOOS == "ios" { // Similarly on Darwin. err1 = execveDarwin(argv0p, &argvp[0], &envvp[0]) } else { diff --git a/src/syscall/sockcmsg_unix_other.go b/src/syscall/sockcmsg_unix_other.go index fbafbf8341..3aaf7c3616 100644 --- a/src/syscall/sockcmsg_unix_other.go +++ b/src/syscall/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/src/syscall/syscall_bsd.go b/src/syscall/syscall_bsd.go index fda9d613d3..b52de7450f 100644 --- a/src/syscall/syscall_bsd.go +++ b/src/syscall/syscall_bsd.go @@ -277,7 +277,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/src/syscall/syscall_unix.go b/src/syscall/syscall_unix.go index 56abce19cd..91c939e0ea 100644 --- a/src/syscall/syscall_unix.go +++ b/src/syscall/syscall_unix.go @@ -22,7 +22,7 @@ var ( ) const ( - darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8 + darwin64Bit = (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && sizeofPtr == 8 netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 ) diff --git a/src/syscall/syscall_unix_test.go b/src/syscall/syscall_unix_test.go index 3c7982eefe..7e9bb0c3ac 100644 --- a/src/syscall/syscall_unix_test.go +++ b/src/syscall/syscall_unix_test.go @@ -70,7 +70,7 @@ func _() { // Thus this test also verifies that the Flock_t structure can be // roundtripped with F_SETLK and F_GETLK. func TestFcntlFlock(t *testing.T) { - if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" { + if (runtime.GOOS == "darwin" || runtime.GOOS == "ios") && runtime.GOARCH == "arm64" { t.Skip("skipping; no child processes allowed on iOS") } flock := syscall.Flock_t{ @@ -336,7 +336,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. @@ -353,7 +353,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 { |