diff --git a/misc/cgo/test/sigaltstack.go b/misc/cgo/test/sigaltstack.go index 2b7a1ec9ad0a01e0dcb34f37ca756afbc94011c3..2c9b81ced7a9b550eabf2ff3f545efb098de8689 100644 --- a/misc/cgo/test/sigaltstack.go +++ b/misc/cgo/test/sigaltstack.go @@ -55,7 +55,7 @@ import ( func testSigaltstack(t *testing.T) { switch { - case runtime.GOOS == "solaris", runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"): + case runtime.GOOS == "solaris", runtime.GOOS == "illumos", runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64"): t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) case runtime.GOOS == "darwin" && runtime.GOARCH == "386": t.Skipf("sigaltstack fails on darwin/386") diff --git a/misc/cgo/testcarchive/carchive_test.go b/misc/cgo/testcarchive/carchive_test.go index 5fbe9caafb35df24f25ab87691cfc9caac719302..085970f32af2988e7e97228adf479855067554f4 100644 --- a/misc/cgo/testcarchive/carchive_test.go +++ b/misc/cgo/testcarchive/carchive_test.go @@ -124,7 +124,7 @@ func testMain(m *testing.M) int { if GOARCH == "arm" || GOARCH == "arm64" { libbase += "_shared" } - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos": libbase += "_shared" } } diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 97f786e6c531e6af9e32989c31feaff705306e3e..4b3968e417130f51805b95ff2a9428bd697b21a8 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -105,7 +105,7 @@ func testMain(m *testing.M) int { if GOARCH == "arm" || GOARCH == "arm64" { libgodir += "_shared" } - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos": libgodir += "_shared" } cc = append(cc, "-I", filepath.Join("pkg", libgodir)) diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 4c5f1c925e8bba21871092b91e43ed5ddc361758..e47f25dce6c4f69dfc2075cae33b608aa426521b 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -80,6 +80,7 @@ var okgoarch = []string{ var okgoos = []string{ "darwin", "dragonfly", + "illumos", "js", "linux", "android", @@ -936,7 +937,7 @@ func matchtag(tag string) bool { } return !matchtag(tag[1:]) } - return tag == "gc" || tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" || (goos == "android" && tag == "linux") + return tag == "gc" || tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" || (goos == "android" && tag == "linux") || (goos == "illumos" && tag == "solaris") } // shouldbuild reports whether we should build this file. @@ -950,7 +951,7 @@ func shouldbuild(file, dir string) bool { name := filepath.Base(file) excluded := func(list []string, ok string) bool { for _, x := range list { - if x == ok || ok == "android" && x == "linux" { + if x == ok || (ok == "android" && x == "linux") || (ok == "illumos" && x == "solaris") { continue } i := strings.Index(name, x) @@ -1486,6 +1487,7 @@ var cgoEnabled = map[string]bool{ "freebsd/386": true, "freebsd/amd64": true, "freebsd/arm": true, + "illumos/amd64": true, "linux/386": true, "linux/amd64": true, "linux/arm": true, diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go index 9be2fff37a4ad7cd22573876a094d47505d06e12..7a7ffe8f0c154fad3013447cff42d7a95c4333c9 100644 --- a/src/cmd/dist/main.go +++ b/src/cmd/dist/main.go @@ -81,8 +81,11 @@ func main() { if gohostarch == "" { fatalf("$objtype is unset") } - case "solaris": - // Even on 64-bit platform, solaris uname -m prints i86pc. + case "solaris", "illumos": + // Solaris and illumos systems have multi-arch userlands, and + // "uname -m" reports the machine hardware name; e.g., + // "i86pc" on both 32- and 64-bit x86 systems. Check for the + // native (widest) instruction set on the running kernel: out := run("", CheckExit, "isainfo", "-n") if strings.Contains(out, "amd64") { gohostarch = "amd64" diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 94417be0f2c1a53681e26b8e1d1b17309a475a72..3f7164dd50192832506f408147c5c4f1defc7429 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -4139,7 +4139,7 @@ func TestCgoConsistentResults(t *testing.T) { t.Skip("skipping because cgo not enabled") } switch runtime.GOOS { - case "solaris": + case "solaris", "illumos": testenv.SkipFlaky(t, 13247) } diff --git a/src/cmd/go/internal/bug/bug.go b/src/cmd/go/internal/bug/bug.go index 468605c74ace9f46021658dc27dd8bab59793987..77a1677125dfe03bd83c9b8de5e0f52798d3b9ad 100644 --- a/src/cmd/go/internal/bug/bug.go +++ b/src/cmd/go/internal/bug/bug.go @@ -102,7 +102,9 @@ func printOSDetails(w io.Writer) { printGlibcVersion(w) case "openbsd", "netbsd", "freebsd", "dragonfly": printCmdOut(w, "uname -v: ", "uname", "-v") - case "solaris": + case "illumos", "solaris": + // Be sure to use the OS-supplied uname, in "/usr/bin": + printCmdOut(w, "uname -srv: ", "/usr/bin/uname", "-srv") out, err := ioutil.ReadFile("/etc/release") if err == nil { fmt.Fprintf(w, "/etc/release: %s\n", out) diff --git a/src/cmd/go/internal/imports/build.go b/src/cmd/go/internal/imports/build.go index fd0a300bc87b37a3b206146c8aa42a476055c825..1e44a83c72a1b72e62bfa67539aa9df23def7a2c 100644 --- a/src/cmd/go/internal/imports/build.go +++ b/src/cmd/go/internal/imports/build.go @@ -202,6 +202,7 @@ var KnownOS = map[string]bool{ "dragonfly": true, "freebsd": true, "hurd": true, + "illumos": true, "js": true, "linux": true, "nacl": true, diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go index aa67093a48aad68cb7adff8dc99c718a3032d88f..581a978ef8e632b7aa7a4eb75ceb305866be05a5 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go @@ -159,7 +159,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) { f2 := mustOpen(t, f.Name()) defer f2.Close() - if runtime.GOOS == "solaris" || runtime.GOOS == "aix" { + doUnlockTF := false + switch runtime.GOOS { + case "aix", "illumos", "solaris": // When using POSIX locks (as on Solaris), we can't safely read-lock the // same inode through two different descriptors at the same time: when the // first descriptor is closed, the second descriptor would still be open but @@ -167,8 +169,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) { lockF2 := mustBlock(t, "RLock", f2) unlock(t, f) lockF2(t) - } else { + default: rLock(t, f2) + doUnlockTF = true } other := mustOpen(t, f.Name()) @@ -176,7 +179,7 @@ func TestRLockExcludesOnlyLock(t *testing.T) { lockOther := mustBlock(t, "Lock", other) unlock(t, f2) - if runtime.GOOS != "solaris" && runtime.GOOS != "aix" { + if doUnlockTF { unlock(t, f) } lockOther(t) diff --git a/src/cmd/go/internal/work/buildid.go b/src/cmd/go/internal/work/buildid.go index 750bc3c6cdbe450e5c6e87bd953bd174a61ee974..894c260b29afdb3421414e443758c91f8fa96645 100644 --- a/src/cmd/go/internal/work/buildid.go +++ b/src/cmd/go/internal/work/buildid.go @@ -326,7 +326,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) { var buf bytes.Buffer if cfg.Goos == "aix" { fmt.Fprintf(&buf, "\t.csect .go.buildid[XO]\n") - } else if cfg.Goos != "solaris" || assemblerIsGas() { + } else if (cfg.Goos != "solaris" && cfg.Goos != "illumos") || assemblerIsGas() { fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n") } else if cfg.Goarch == "sparc" || cfg.Goarch == "sparc64" { fmt.Fprintf(&buf, "\t"+`.section ".go.buildid",#exclude`+"\n") @@ -345,7 +345,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) { fmt.Fprintf(&buf, "%#02x", a.buildID[i]) } fmt.Fprintf(&buf, "\n") - if cfg.Goos != "solaris" && cfg.Goos != "aix" { + if cfg.Goos != "solaris" && cfg.Goos != "illumos" && cfg.Goos != "aix" { secType := "@progbits" if cfg.Goarch == "arm" { secType = "%progbits" diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index d1a529d1e68353a5ea55d6ba9eb8986d5db38c8a..cb380d1702514eb2a63ed228eda70054fc284c71 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -713,7 +713,7 @@ func (b *Builder) build(a *Action) (err error) { // This is read by readGccgoArchive in cmd/internal/buildid/buildid.go. if a.buildID != "" && cfg.BuildToolchainName == "gccgo" { switch cfg.Goos { - case "aix", "android", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "aix", "android", "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris": asmfile, err := b.gccgoBuildIDFile(a) if err != nil { return err diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go index d60295ce53c077f581bfa552a19764d8bceda331..35d3a505cc7d362607932d3c9decff4e51cb8479 100644 --- a/src/cmd/go/internal/work/init.go +++ b/src/cmd/go/internal/work/init.go @@ -95,7 +95,7 @@ func buildModeInit() { codegenArg = "-shared" default: switch cfg.Goos { - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris": if platform == "linux/ppc64" { base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) } diff --git a/src/cmd/internal/objabi/head.go b/src/cmd/internal/objabi/head.go index db2221d6b145e1cddb162bb4f495899739802177..0a54228228425a30bd36b44ab50e6b40a58214e4 100644 --- a/src/cmd/internal/objabi/head.go +++ b/src/cmd/internal/objabi/head.go @@ -73,7 +73,7 @@ func (h *HeadType) Set(s string) error { *h = Hopenbsd case "plan9": *h = Hplan9 - case "solaris": + case "illumos", "solaris": *h = Hsolaris case "windows": *h = Hwindows diff --git a/src/cmd/link/internal/ld/dwarf_test.go b/src/cmd/link/internal/ld/dwarf_test.go index 333680511ab851d8f6ddcec2bf64e3619b32dec9..f6ed8d3401a0872c7e54e4e18b5cd9e24a6dc6c2 100644 --- a/src/cmd/link/internal/ld/dwarf_test.go +++ b/src/cmd/link/internal/ld/dwarf_test.go @@ -574,8 +574,8 @@ func TestInlinedRoutineRecords(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } - if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { - t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" { + t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168") } t.Parallel() @@ -801,8 +801,8 @@ func TestAbstractOriginSanity(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } - if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { - t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" { + t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168") } if wd, err := os.Getwd(); err == nil { @@ -819,8 +819,8 @@ func TestAbstractOriginSanityIssue25459(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } - if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { - t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" { + t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168") } if runtime.GOARCH != "amd64" && runtime.GOARCH != "x86" { t.Skip("skipping on not-amd64 not-x86; location lists not supported") @@ -840,8 +840,8 @@ func TestAbstractOriginSanityIssue26237(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } - if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { - t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" { + t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168") } if wd, err := os.Getwd(); err == nil { gopathdir := filepath.Join(wd, "testdata", "issue26237") diff --git a/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go index 723b7f1012743d5acc073b9e721ba437ed54469a..a79565a7ff5cacd9637976e9bb85ff2f10cdafcf 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go @@ -21,9 +21,9 @@ func cmsgAlignOf(salen int) int { case "aix": // There is no alignment on AIX. salign = 1 - case "darwin", "dragonfly", "solaris": - // NOTE: It seems like 64-bit Darwin, DragonFly BSD and - // Solaris kernels still require 32-bit aligned access to + case "darwin", "dragonfly", "solaris", "illumos": + // NOTE: It seems like 64-bit Darwin, DragonFly BSD, illumos, + // and Solaris kernels still require 32-bit aligned access to // network subsystem. if SizeofPtr == 8 { salign = 4 diff --git a/src/cmd/vet/all/whitelist/illumos_amd64.txt b/src/cmd/vet/all/whitelist/illumos_amd64.txt new file mode 100644 index 0000000000000000000000000000000000000000..4525c03cd79fd7c41971803dd4ff9277ce413b5a --- /dev/null +++ b/src/cmd/vet/all/whitelist/illumos_amd64.txt @@ -0,0 +1,6 @@ +// illumos/amd64-specific vet whitelist. See readme.txt for details. + +runtime/sys_solaris_amd64.s: [amd64] settls: function settls missing Go declaration +runtime/sys_solaris_amd64.s: [amd64] pipe1: function pipe1 missing Go declaration +runtime/sys_solaris_amd64.s: [amd64] asmsysvicall6: function asmsysvicall6 missing Go declaration +runtime/sys_solaris_amd64.s: [amd64] usleep2: function usleep2 missing Go declaration diff --git a/src/debug/gosym/pclntab_test.go b/src/debug/gosym/pclntab_test.go index d21f0e24a8324030d4297d3b7a6697807bb20468..ef644f8454b107f3c8d2647c437d39b694d7b019 100644 --- a/src/debug/gosym/pclntab_test.go +++ b/src/debug/gosym/pclntab_test.go @@ -55,7 +55,7 @@ func endtest() { // These tests open and examine the test binary, and use elf.Open to do so. func skipIfNotELF(t *testing.T) { switch runtime.GOOS { - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos": // OK. default: t.Skipf("skipping on non-ELF system %s", runtime.GOOS) diff --git a/src/go/build/build.go b/src/go/build/build.go index 1ad076089db76b54a0da89328fdd6367054cef6c..a91551bc22c15687fc3d5a5d7b1f67bb86d9e441 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -1685,6 +1685,9 @@ func (ctxt *Context) match(name string, allTags map[string]bool) bool { if ctxt.GOOS == "android" && name == "linux" { return true } + if ctxt.GOOS == "illumos" && name == "solaris" { + return true + } // other tags for _, tag := range ctxt.BuildTags { diff --git a/src/go/build/doc.go b/src/go/build/doc.go index 7b044bc8381c678683437e493b2448b3e1faf233..703825a45d7469f05d9c2e5b68bd12e8348e5961 100644 --- a/src/go/build/doc.go +++ b/src/go/build/doc.go @@ -147,6 +147,9 @@ // Using GOOS=android matches build tags and files as for GOOS=linux // in addition to android tags and files. // +// Using GOOS=illumos matches build tags and files as for GOOS=solaris +// in addition to illumos tags and files. +// // Binary-Only Packages // // In Go 1.12 and earlier, it was possible to distribute packages in binary diff --git a/src/go/build/syslist.go b/src/go/build/syslist.go index d13fe9c4f997fe545ff7656a82fa8e561dda8a47..197c646d5c0473cd93a76f9a7505c10b36108296 100644 --- a/src/go/build/syslist.go +++ b/src/go/build/syslist.go @@ -4,5 +4,5 @@ package build -const goosList = "aix android darwin dragonfly freebsd hurd js linux nacl netbsd openbsd plan9 solaris windows zos " +const goosList = "aix android darwin dragonfly freebsd hurd illumos js linux nacl netbsd openbsd plan9 solaris windows zos " const goarchList = "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc riscv riscv64 s390 s390x sparc sparc64 wasm " diff --git a/src/net/error_test.go b/src/net/error_test.go index b0622d7fd5b02704f89a4f9dcd8bfab5e5865147..c4fee5aa5e54ae5ced3cdd2d59f0db97b0ad393a 100644 --- a/src/net/error_test.go +++ b/src/net/error_test.go @@ -185,7 +185,7 @@ func TestDialError(t *testing.T) { func TestProtocolDialError(t *testing.T) { switch runtime.GOOS { - case "nacl", "solaris": + case "nacl", "solaris", "illumos": t.Skipf("not supported on %s", runtime.GOOS) } diff --git a/src/net/fd_unix.go b/src/net/fd_unix.go index e7ab9a45fd65cca2b9868c75d9d71e3b343eef1a..dbe4a511ec84bbd3224e544e3bb5ab220abb1db4 100644 --- a/src/net/fd_unix.go +++ b/src/net/fd_unix.go @@ -81,12 +81,12 @@ func (fd *netFD) connect(ctx context.Context, la, ra syscall.Sockaddr) (rsa sysc runtime.KeepAlive(fd) return nil, nil case syscall.EINVAL: - // On Solaris we can see EINVAL if the socket has - // already been accepted and closed by the server. - // Treat this as a successful connection--writes to - // the socket will see EOF. For details and a test - // case in C see https://golang.org/issue/6828. - if runtime.GOOS == "solaris" { + // On Solaris and illumos we can see EINVAL if the socket has + // already been accepted and closed by the server. Treat this + // as a successful connection--writes to the socket will see + // EOF. For details and a test case in C see + // https://golang.org/issue/6828. + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" { return nil, nil } fallthrough diff --git a/src/net/interface_test.go b/src/net/interface_test.go index c6b514abcec7987309d758d8be901455c74ffd03..fb6032fbc069a9f921c8aa344ddf927d823de564 100644 --- a/src/net/interface_test.go +++ b/src/net/interface_test.go @@ -61,7 +61,7 @@ func TestInterfaces(t *testing.T) { t.Fatal(err) } switch runtime.GOOS { - case "solaris": + case "solaris", "illumos": if ifxi.Index != ifi.Index { t.Errorf("got %v; want %v", ifxi, ifi) } @@ -278,7 +278,7 @@ func checkUnicastStats(ifStats *ifStats, uniStats *routeStats) error { func checkMulticastStats(ifStats *ifStats, uniStats, multiStats *routeStats) error { switch runtime.GOOS { - case "aix", "dragonfly", "nacl", "netbsd", "openbsd", "plan9", "solaris": + case "aix", "dragonfly", "nacl", "netbsd", "openbsd", "plan9", "solaris", "illumos": default: // Test the existence of connected multicast route // clones for IPv4. Unlike IPv6, IPv4 multicast diff --git a/src/net/listen_test.go b/src/net/listen_test.go index 6c9b92a9fc5d30f49f2b4350781bb2445ce9fa49..fef2b6405fa33e82ac5976cfadb28bf02d10a85d 100644 --- a/src/net/listen_test.go +++ b/src/net/listen_test.go @@ -534,8 +534,8 @@ func TestIPv4MulticastListener(t *testing.T) { switch runtime.GOOS { case "android", "nacl", "plan9": t.Skipf("not supported on %s", runtime.GOOS) - case "solaris": - t.Skipf("not supported on solaris, see golang.org/issue/7399") + case "solaris", "illumos": + t.Skipf("not supported on solaris or illumos, see golang.org/issue/7399") } if !supportsIPv4() { t.Skip("IPv4 is not supported") @@ -609,8 +609,8 @@ func TestIPv6MulticastListener(t *testing.T) { switch runtime.GOOS { case "plan9": t.Skipf("not supported on %s", runtime.GOOS) - case "solaris": - t.Skipf("not supported on solaris, see issue 7399") + case "solaris", "illumos": + t.Skipf("not supported on solaris or illumos, see issue 7399") } if !supportsIPv6() { t.Skip("IPv6 is not supported") @@ -674,7 +674,7 @@ func checkMulticastListener(c *UDPConn, ip IP) error { func multicastRIBContains(ip IP) (bool, error) { switch runtime.GOOS { - case "aix", "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "windows": + case "aix", "dragonfly", "netbsd", "openbsd", "plan9", "solaris", "illumos", "windows": return true, nil // not implemented yet case "linux": if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" { diff --git a/src/net/tcpsock_test.go b/src/net/tcpsock_test.go index 36d2ccb09a9b713393eba8183907fe0ac0fb92f7..f78675b185da3556f4873b2140c5343b06598293 100644 --- a/src/net/tcpsock_test.go +++ b/src/net/tcpsock_test.go @@ -651,7 +651,7 @@ func TestTCPSelfConnect(t *testing.T) { n = 1000 } switch runtime.GOOS { - case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "solaris", "windows": + case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "illumos", "solaris", "windows": // Non-Linux systems take a long time to figure // out that there is nothing listening on localhost. n = 100 diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index a157810eedfd586d73b006989856f09d69009534..f9d73060a3d8b06a68cbbad7339cd4cac2e7016f 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -831,7 +831,7 @@ func TestHelperProcess(*testing.T) { // the cloned file descriptors that result from opening // /dev/urandom. // https://golang.org/issue/3955 - case "solaris": + case "illumos", "solaris": // TODO(aram): This fails on Solaris because libc opens // its own files, as it sees fit. Darwin does the same, // see: https://golang.org/issue/2603 diff --git a/src/os/os_test.go b/src/os/os_test.go index b7e26f47b710e1e28014b54d1999c1f3619f4b3c..b6bbba287fd459b23c6cd4b9bb1af9c4688827d4 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -2226,8 +2226,8 @@ func TestPipeThreads(t *testing.T) { switch runtime.GOOS { case "freebsd": t.Skip("skipping on FreeBSD; issue 19093") - case "solaris": - t.Skip("skipping on Solaris; issue 19111") + case "illumos", "solaris": + t.Skip("skipping on Solaris and illumos; issue 19111") case "windows": t.Skip("skipping on Windows; issue 19098") case "plan9": diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index 96e0fc5a55e3661d383bf1938ef898b4bdd147bf..4d556f977e4239b9024348651a743b732fb79b96 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -159,7 +159,7 @@ func TestRemoveAllLarge(t *testing.T) { func TestRemoveAllLongPath(t *testing.T) { switch runtime.GOOS { - case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris": break default: t.Skip("skipping for not implemented platforms") diff --git a/src/os/user/user_test.go b/src/os/user/user_test.go index eeb24dd0e00d2cc4332f525274b63b280692bf28..8c4c817c2b63cd1a0d798b4d3cb91f7274423ec7 100644 --- a/src/os/user/user_test.go +++ b/src/os/user/user_test.go @@ -132,7 +132,7 @@ func TestGroupIds(t *testing.T) { if runtime.GOOS == "aix" { t.Skip("skipping GroupIds, see golang.org/issue/30563") } - if runtime.GOOS == "solaris" { + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" { t.Skip("skipping GroupIds, see golang.org/issue/14709") } user, err := Current() diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s index 1cca0c794bf8fefda64bc62aaa798d1e38ff5550..2807f4c23846eb01882b642ad61663bba1e6f61e 100644 --- a/src/runtime/asm_amd64.s +++ b/src/runtime/asm_amd64.s @@ -171,6 +171,10 @@ needtls: // skip TLS setup on Solaris JMP ok #endif +#ifdef GOOS_illumos + // skip TLS setup on illumos + JMP ok +#endif #ifdef GOOS_darwin // skip TLS setup on Darwin JMP ok diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index 123607247a1eeabebdb8adb318e98b986652501a..a881ae14898b390078f1de5924f7ec0fca8f2c09 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -92,7 +92,7 @@ type cgoCallers [32]uintptr // Call from Go to C. //go:nosplit func cgocall(fn, arg unsafe.Pointer) int32 { - if !iscgo && GOOS != "solaris" && GOOS != "windows" { + if !iscgo && GOOS != "solaris" && GOOS != "illumos" && GOOS != "windows" { throw("cgocall unavailable") } diff --git a/src/runtime/crash_unix_test.go b/src/runtime/crash_unix_test.go index 987c7095a03db72fcd4ea54e4bd8e5e4777c125f..14f418cf97183187a24957a1cec21c5e4517c6b2 100644 --- a/src/runtime/crash_unix_test.go +++ b/src/runtime/crash_unix_test.go @@ -35,7 +35,7 @@ func init() { func TestCrashDumpsAllThreads(t *testing.T) { switch runtime.GOOS { - case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris": default: t.Skipf("skipping; not supported on %v", runtime.GOOS) } diff --git a/src/runtime/internal/sys/gengoos.go b/src/runtime/internal/sys/gengoos.go index d0789218747a612a2090882f0c127ea16db98f65..952b13649d64321e0a2725f0d9ab6caa85597cf3 100644 --- a/src/runtime/internal/sys/gengoos.go +++ b/src/runtime/internal/sys/gengoos.go @@ -49,6 +49,9 @@ func main() { if target == "linux" { fmt.Fprintf(&buf, "// +build !android\n") // must explicitly exclude android for linux } + if target == "solaris" { + fmt.Fprintf(&buf, "// +build !illumos\n") // must explicitly exclude illumos for solaris + } fmt.Fprintf(&buf, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes fmt.Fprintf(&buf, "package sys\n\n") fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target) diff --git a/src/runtime/internal/sys/zgoos_aix.go b/src/runtime/internal/sys/zgoos_aix.go index 909bfc5e934e17d33cd1372e6c9e5d7b4a33ce83..d97485c43cb4f0a34104cf21cb28451a43b3e07d 100644 --- a/src/runtime/internal/sys/zgoos_aix.go +++ b/src/runtime/internal/sys/zgoos_aix.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_android.go b/src/runtime/internal/sys/zgoos_android.go index 434ce46712d7b179d2b7e3fb994e2b4f4d502d9d..eec970b0647f609dd8e85f014b4414d1e709fbce 100644 --- a/src/runtime/internal/sys/zgoos_android.go +++ b/src/runtime/internal/sys/zgoos_android.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_darwin.go b/src/runtime/internal/sys/zgoos_darwin.go index b645d1cf5fd5184245078cde72bfd9b41e39d6de..c40819ee559d559ea171e98c18fb3f0a35772c62 100644 --- a/src/runtime/internal/sys/zgoos_darwin.go +++ b/src/runtime/internal/sys/zgoos_darwin.go @@ -12,6 +12,7 @@ const GoosDarwin = 1 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_dragonfly.go b/src/runtime/internal/sys/zgoos_dragonfly.go index 154cec370fe03c79f5daaf5559d9502fff1a9a5a..3dc4edcc31b7771fc95a30e4a09648589ac690a1 100644 --- a/src/runtime/internal/sys/zgoos_dragonfly.go +++ b/src/runtime/internal/sys/zgoos_dragonfly.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 1 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_freebsd.go b/src/runtime/internal/sys/zgoos_freebsd.go index 5f41c0344507fd1db9dea2d7573bc573362346ed..6c98b342f9ceb39a1b60e8cbdc6aa3b103f6c21d 100644 --- a/src/runtime/internal/sys/zgoos_freebsd.go +++ b/src/runtime/internal/sys/zgoos_freebsd.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 1 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_hurd.go b/src/runtime/internal/sys/zgoos_hurd.go index 53f7fc384bf6e93f74f3c11f1f48ff32ceb3afbb..d6dcc7bad456b5a0dbe186951a8126be73e82b6a 100644 --- a/src/runtime/internal/sys/zgoos_hurd.go +++ b/src/runtime/internal/sys/zgoos_hurd.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 1 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_illumos.go b/src/runtime/internal/sys/zgoos_illumos.go new file mode 100644 index 0000000000000000000000000000000000000000..17f4ecc34edc3d1cedef54d33b04e3e7c9520bed --- /dev/null +++ b/src/runtime/internal/sys/zgoos_illumos.go @@ -0,0 +1,24 @@ +// Code generated by gengoos.go using 'go generate'. DO NOT EDIT. + +// +build illumos + +package sys + +const GOOS = `illumos` + +const GoosAix = 0 +const GoosAndroid = 0 +const GoosDarwin = 0 +const GoosDragonfly = 0 +const GoosFreebsd = 0 +const GoosHurd = 0 +const GoosIllumos = 1 +const GoosJs = 0 +const GoosLinux = 0 +const GoosNacl = 0 +const GoosNetbsd = 0 +const GoosOpenbsd = 0 +const GoosPlan9 = 0 +const GoosSolaris = 0 +const GoosWindows = 0 +const GoosZos = 0 diff --git a/src/runtime/internal/sys/zgoos_js.go b/src/runtime/internal/sys/zgoos_js.go index c6cca49bd9b9d67c6d92a586ad38335360b61d6e..74c9943d9bf2522e332861930d57691043c9bf4c 100644 --- a/src/runtime/internal/sys/zgoos_js.go +++ b/src/runtime/internal/sys/zgoos_js.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 1 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_linux.go b/src/runtime/internal/sys/zgoos_linux.go index 088dbc105b0a9a7fc0d21618c5eecd05708bf65f..1d5fcb06856a47b768bb13d45fd92282b6713d5b 100644 --- a/src/runtime/internal/sys/zgoos_linux.go +++ b/src/runtime/internal/sys/zgoos_linux.go @@ -13,6 +13,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 1 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_nacl.go b/src/runtime/internal/sys/zgoos_nacl.go index 65bec4af9e85a403bc6c2fb30c8c142033217572..9e65b6f1855278551c4416c307fae8e00e2a5c89 100644 --- a/src/runtime/internal/sys/zgoos_nacl.go +++ b/src/runtime/internal/sys/zgoos_nacl.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 1 diff --git a/src/runtime/internal/sys/zgoos_netbsd.go b/src/runtime/internal/sys/zgoos_netbsd.go index 93d0fa7e11303fea3b7954978f884ee12c90a49f..194fa6e4326efe423c746a586a289ef0710dbef0 100644 --- a/src/runtime/internal/sys/zgoos_netbsd.go +++ b/src/runtime/internal/sys/zgoos_netbsd.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_openbsd.go b/src/runtime/internal/sys/zgoos_openbsd.go index 79193593f5cffb21f032ce6e49b4c560500e7709..210869167999db56bf4532928747f39c4ae30f01 100644 --- a/src/runtime/internal/sys/zgoos_openbsd.go +++ b/src/runtime/internal/sys/zgoos_openbsd.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_plan9.go b/src/runtime/internal/sys/zgoos_plan9.go index 2b95e0808019746a50264c51d3a85685ed08868e..e632a90b2e01bd2de5e62f7d6ddea77cae76ca0d 100644 --- a/src/runtime/internal/sys/zgoos_plan9.go +++ b/src/runtime/internal/sys/zgoos_plan9.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_solaris.go b/src/runtime/internal/sys/zgoos_solaris.go index 6e3988aed0c2e993f97483d1d26e4d9eaf60694d..67b2ffbfcd9501af0ef479b184c9014d5bcf7f13 100644 --- a/src/runtime/internal/sys/zgoos_solaris.go +++ b/src/runtime/internal/sys/zgoos_solaris.go @@ -1,5 +1,6 @@ // Code generated by gengoos.go using 'go generate'. DO NOT EDIT. +// +build !illumos // +build solaris package sys @@ -12,6 +13,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_windows.go b/src/runtime/internal/sys/zgoos_windows.go index a56e12544a4cf8ac9847b52141872e427a2fc837..cf2d6f4fb08f15d8dd5256e701507efe6a1e6464 100644 --- a/src/runtime/internal/sys/zgoos_windows.go +++ b/src/runtime/internal/sys/zgoos_windows.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/internal/sys/zgoos_zos.go b/src/runtime/internal/sys/zgoos_zos.go index 0f56e46002569cc7967f20d3c0bfb902f968950a..e5d79accb4c5158778e73ecb6ae805374250918b 100644 --- a/src/runtime/internal/sys/zgoos_zos.go +++ b/src/runtime/internal/sys/zgoos_zos.go @@ -12,6 +12,7 @@ const GoosDarwin = 0 const GoosDragonfly = 0 const GoosFreebsd = 0 const GoosHurd = 0 +const GoosIllumos = 0 const GoosJs = 0 const GoosLinux = 0 const GoosNacl = 0 diff --git a/src/runtime/mem_bsd.go b/src/runtime/mem_bsd.go index cc70e806ead1f89061817af0615949ed8d812365..3977e4ae9eff96167e006ac41fbb40f7bd2e07ff 100644 --- a/src/runtime/mem_bsd.go +++ b/src/runtime/mem_bsd.go @@ -56,7 +56,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *uint64) { mSysStatInc(sysStat, n) p, err := mmap(v, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_FIXED|_MAP_PRIVATE, -1, 0) - if err == _ENOMEM || (GOOS == "solaris" && err == _sunosEAGAIN) { + if err == _ENOMEM || ((GOOS == "solaris" || GOOS == "illumos") && err == _sunosEAGAIN) { throw("runtime: out of memory") } if p != v || err != 0 { diff --git a/src/runtime/netpoll.go b/src/runtime/netpoll.go index 0de67c63e75ae4fa6641a52f7a3ce99ed6482c38..73bbc5e3c7b8619c57ebb2d251c5a4b4f4d1d1bb 100644 --- a/src/runtime/netpoll.go +++ b/src/runtime/netpoll.go @@ -177,8 +177,8 @@ func poll_runtime_pollWait(pd *pollDesc, mode int) int { if err != 0 { return err } - // As for now only Solaris and AIX use level-triggered IO. - if GOOS == "solaris" || GOOS == "aix" { + // As for now only Solaris, illumos, and AIX use level-triggered IO. + if GOOS == "solaris" || GOOS == "illumos" || GOOS == "aix" { netpollarm(pd, mode) } for !netpollblock(pd, int32(mode), false) { diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 39d171bd182dd160549f737b741696d398bc4b81..59dee268678ff0a84adc45d6e078f9d54390cde9 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -191,7 +191,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri } switch runtime.GOOS { - case "darwin", "dragonfly", "netbsd", "solaris": + case "darwin", "dragonfly", "netbsd", "illumos", "solaris": t.Skipf("ignoring failure on %s; see golang.org/issue/13841", runtime.GOOS) case "openbsd": if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { diff --git a/src/runtime/proc.go b/src/runtime/proc.go index b8ee616eaa42eb203db968f00f160ef7bf1dba2a..035b71011f76228ca81482a782c65889b801dee0 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -486,7 +486,7 @@ func cpuinit() { var env string switch GOOS { - case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "solaris", "linux": + case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "illumos", "solaris", "linux": cpu.DebugOptions = true // Similar to goenv_unix but extracts the environment value for @@ -638,7 +638,7 @@ func mcommoninit(mp *m) { unlock(&sched.lock) // Allocate memory to hold a cgo traceback if the cgo call crashes. - if iscgo || GOOS == "solaris" || GOOS == "windows" { + if iscgo || GOOS == "solaris" || GOOS == "illumos" || GOOS == "windows" { mp.cgoCallers = new(cgoCallers) } } @@ -1167,8 +1167,8 @@ func mstart() { mstart1() // Exit this thread. - if GOOS == "windows" || GOOS == "solaris" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "aix" { - // Window, Solaris, Darwin, AIX and Plan 9 always system-allocate + if GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "aix" { + // Windows, Solaris, illumos, Darwin, AIX and Plan 9 always system-allocate // the stack, but put it in _g_.stack before mstart, // so the logic above hasn't set osStack yet. osStack = true @@ -1488,9 +1488,9 @@ func allocm(_p_ *p, fn func()) *m { mp.mstartfn = fn mcommoninit(mp) - // In case of cgo or Solaris or Darwin, pthread_create will make us a stack. + // In case of cgo or Solaris or illumos or Darwin, pthread_create will make us a stack. // Windows and Plan 9 will layout sched stack on OS stack. - if iscgo || GOOS == "solaris" || GOOS == "windows" || GOOS == "plan9" || GOOS == "darwin" { + if iscgo || GOOS == "solaris" || GOOS == "illumos" || GOOS == "windows" || GOOS == "plan9" || GOOS == "darwin" { mp.g0 = malg(-1) } else { mp.g0 = malg(8192 * sys.StackGuardMultiplier) @@ -3747,7 +3747,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) { // Normal traceback is impossible or has failed. // See if it falls into several common cases. n = 0 - if (GOOS == "windows" || GOOS == "solaris" || GOOS == "darwin" || GOOS == "aix") && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 { + if (GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "darwin" || GOOS == "aix") && mp.libcallg != 0 && mp.libcallpc != 0 && mp.libcallsp != 0 { // Libcall, i.e. runtime syscall on windows. // Collect Go stack that leads to the call. n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, 0) diff --git a/src/runtime/rt0_illumos_amd64.s b/src/runtime/rt0_illumos_amd64.s new file mode 100644 index 0000000000000000000000000000000000000000..54d35b77966c9351a4918f626d8369ec8ca4ba65 --- /dev/null +++ b/src/runtime/rt0_illumos_amd64.s @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +TEXT _rt0_amd64_illumos(SB),NOSPLIT,$-8 + JMP _rt0_amd64(SB) + +TEXT _rt0_amd64_illumos_lib(SB),NOSPLIT,$0 + JMP _rt0_amd64_lib(SB) diff --git a/src/syscall/exec_unix.go b/src/syscall/exec_unix.go index 4421c449cffb4d70e702057ab0eb84f282d6914e..b3798b6e04e55811c0ba5a01325561246737d5f4 100644 --- a/src/syscall/exec_unix.go +++ b/src/syscall/exec_unix.go @@ -275,8 +275,8 @@ func Exec(argv0 string, argv []string, envv []string) (err error) { runtime_BeforeExec() var err1 error - if runtime.GOOS == "solaris" || runtime.GOOS == "aix" { - // RawSyscall should never be used on Solaris or AIX. + if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "aix" { + // RawSyscall should never be used on Solaris, illumos, or AIX. err1 = execveLibc( uintptr(unsafe.Pointer(argv0p)), uintptr(unsafe.Pointer(&argvp[0])), diff --git a/src/syscall/sockcmsg_unix.go b/src/syscall/sockcmsg_unix.go index fd5bfaf5494c8582f49c7ade76aff7c4becfab18..71efd464707e611aafd888db22cc7f037eea87fa 100644 --- a/src/syscall/sockcmsg_unix.go +++ b/src/syscall/sockcmsg_unix.go @@ -21,7 +21,7 @@ func cmsgAlignOf(salen int) int { case "aix": // There is no alignment on AIX. salign = 1 - case "darwin", "dragonfly", "solaris": + case "darwin", "dragonfly", "illumos", "solaris": // NOTE: It seems like 64-bit Darwin, DragonFly BSD and // Solaris kernels still require 32-bit aligned access to // network subsystem. diff --git a/src/syscall/syscall_unix.go b/src/syscall/syscall_unix.go index f73f55462af74828d6db7db5617d3c5b9afda83a..faaa432136029969158d6a56182e0ed2f0b9a9f5 100644 --- a/src/syscall/syscall_unix.go +++ b/src/syscall/syscall_unix.go @@ -25,6 +25,7 @@ const ( dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8 netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8 + illumos64Bit = runtime.GOOS == "illumos" && sizeofPtr == 8 ) func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)