Commit f686a289 authored by Joshua M. Clulow's avatar Joshua M. Clulow Committed by Brad Fitzpatrick

all: add new GOOS=illumos, split out of GOOS=solaris

Like GOOS=android which implies the "linux" build tag, GOOS=illumos
implies the "solaris" build tag. This lets the existing ecosystem of
packages still work on illumos, but still permits packages to start
differentiating between solaris and illumos.

Fixes #20603

Change-Id: I8f4eabf1a66060538dca15d7658c1fbc6c826622
Reviewed-on: https://go-review.googlesource.com/c/go/+/174457
Run-TryBot: Benny Siegert <bsiegert@gmail.com>
Reviewed-by: default avatarBenny Siegert <bsiegert@gmail.com>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 0c9e0c25
...@@ -55,7 +55,7 @@ import ( ...@@ -55,7 +55,7 @@ import (
func testSigaltstack(t *testing.T) { func testSigaltstack(t *testing.T) {
switch { 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) t.Skipf("switching signal stack not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
case runtime.GOOS == "darwin" && runtime.GOARCH == "386": case runtime.GOOS == "darwin" && runtime.GOARCH == "386":
t.Skipf("sigaltstack fails on darwin/386") t.Skipf("sigaltstack fails on darwin/386")
......
...@@ -124,7 +124,7 @@ func testMain(m *testing.M) int { ...@@ -124,7 +124,7 @@ func testMain(m *testing.M) int {
if GOARCH == "arm" || GOARCH == "arm64" { if GOARCH == "arm" || GOARCH == "arm64" {
libbase += "_shared" libbase += "_shared"
} }
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
libbase += "_shared" libbase += "_shared"
} }
} }
......
...@@ -105,7 +105,7 @@ func testMain(m *testing.M) int { ...@@ -105,7 +105,7 @@ func testMain(m *testing.M) int {
if GOARCH == "arm" || GOARCH == "arm64" { if GOARCH == "arm" || GOARCH == "arm64" {
libgodir += "_shared" libgodir += "_shared"
} }
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
libgodir += "_shared" libgodir += "_shared"
} }
cc = append(cc, "-I", filepath.Join("pkg", libgodir)) cc = append(cc, "-I", filepath.Join("pkg", libgodir))
......
...@@ -80,6 +80,7 @@ var okgoarch = []string{ ...@@ -80,6 +80,7 @@ var okgoarch = []string{
var okgoos = []string{ var okgoos = []string{
"darwin", "darwin",
"dragonfly", "dragonfly",
"illumos",
"js", "js",
"linux", "linux",
"android", "android",
...@@ -936,7 +937,7 @@ func matchtag(tag string) bool { ...@@ -936,7 +937,7 @@ func matchtag(tag string) bool {
} }
return !matchtag(tag[1:]) 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. // shouldbuild reports whether we should build this file.
...@@ -950,7 +951,7 @@ func shouldbuild(file, dir string) bool { ...@@ -950,7 +951,7 @@ func shouldbuild(file, dir string) bool {
name := filepath.Base(file) name := filepath.Base(file)
excluded := func(list []string, ok string) bool { excluded := func(list []string, ok string) bool {
for _, x := range list { for _, x := range list {
if x == ok || ok == "android" && x == "linux" { if x == ok || (ok == "android" && x == "linux") || (ok == "illumos" && x == "solaris") {
continue continue
} }
i := strings.Index(name, x) i := strings.Index(name, x)
...@@ -1486,6 +1487,7 @@ var cgoEnabled = map[string]bool{ ...@@ -1486,6 +1487,7 @@ var cgoEnabled = map[string]bool{
"freebsd/386": true, "freebsd/386": true,
"freebsd/amd64": true, "freebsd/amd64": true,
"freebsd/arm": true, "freebsd/arm": true,
"illumos/amd64": true,
"linux/386": true, "linux/386": true,
"linux/amd64": true, "linux/amd64": true,
"linux/arm": true, "linux/arm": true,
......
...@@ -81,8 +81,11 @@ func main() { ...@@ -81,8 +81,11 @@ func main() {
if gohostarch == "" { if gohostarch == "" {
fatalf("$objtype is unset") fatalf("$objtype is unset")
} }
case "solaris": case "solaris", "illumos":
// Even on 64-bit platform, solaris uname -m prints i86pc. // 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") out := run("", CheckExit, "isainfo", "-n")
if strings.Contains(out, "amd64") { if strings.Contains(out, "amd64") {
gohostarch = "amd64" gohostarch = "amd64"
......
...@@ -4139,7 +4139,7 @@ func TestCgoConsistentResults(t *testing.T) { ...@@ -4139,7 +4139,7 @@ func TestCgoConsistentResults(t *testing.T) {
t.Skip("skipping because cgo not enabled") t.Skip("skipping because cgo not enabled")
} }
switch runtime.GOOS { switch runtime.GOOS {
case "solaris": case "solaris", "illumos":
testenv.SkipFlaky(t, 13247) testenv.SkipFlaky(t, 13247)
} }
......
...@@ -102,7 +102,9 @@ func printOSDetails(w io.Writer) { ...@@ -102,7 +102,9 @@ func printOSDetails(w io.Writer) {
printGlibcVersion(w) printGlibcVersion(w)
case "openbsd", "netbsd", "freebsd", "dragonfly": case "openbsd", "netbsd", "freebsd", "dragonfly":
printCmdOut(w, "uname -v: ", "uname", "-v") 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") out, err := ioutil.ReadFile("/etc/release")
if err == nil { if err == nil {
fmt.Fprintf(w, "/etc/release: %s\n", out) fmt.Fprintf(w, "/etc/release: %s\n", out)
......
...@@ -202,6 +202,7 @@ var KnownOS = map[string]bool{ ...@@ -202,6 +202,7 @@ var KnownOS = map[string]bool{
"dragonfly": true, "dragonfly": true,
"freebsd": true, "freebsd": true,
"hurd": true, "hurd": true,
"illumos": true,
"js": true, "js": true,
"linux": true, "linux": true,
"nacl": true, "nacl": true,
......
...@@ -159,7 +159,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) { ...@@ -159,7 +159,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) {
f2 := mustOpen(t, f.Name()) f2 := mustOpen(t, f.Name())
defer f2.Close() 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 // 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 // same inode through two different descriptors at the same time: when the
// first descriptor is closed, the second descriptor would still be open but // first descriptor is closed, the second descriptor would still be open but
...@@ -167,8 +169,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) { ...@@ -167,8 +169,9 @@ func TestRLockExcludesOnlyLock(t *testing.T) {
lockF2 := mustBlock(t, "RLock", f2) lockF2 := mustBlock(t, "RLock", f2)
unlock(t, f) unlock(t, f)
lockF2(t) lockF2(t)
} else { default:
rLock(t, f2) rLock(t, f2)
doUnlockTF = true
} }
other := mustOpen(t, f.Name()) other := mustOpen(t, f.Name())
...@@ -176,7 +179,7 @@ func TestRLockExcludesOnlyLock(t *testing.T) { ...@@ -176,7 +179,7 @@ func TestRLockExcludesOnlyLock(t *testing.T) {
lockOther := mustBlock(t, "Lock", other) lockOther := mustBlock(t, "Lock", other)
unlock(t, f2) unlock(t, f2)
if runtime.GOOS != "solaris" && runtime.GOOS != "aix" { if doUnlockTF {
unlock(t, f) unlock(t, f)
} }
lockOther(t) lockOther(t)
......
...@@ -326,7 +326,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) { ...@@ -326,7 +326,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) {
var buf bytes.Buffer var buf bytes.Buffer
if cfg.Goos == "aix" { if cfg.Goos == "aix" {
fmt.Fprintf(&buf, "\t.csect .go.buildid[XO]\n") 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") fmt.Fprintf(&buf, "\t"+`.section .go.buildid,"e"`+"\n")
} else if cfg.Goarch == "sparc" || cfg.Goarch == "sparc64" { } else if cfg.Goarch == "sparc" || cfg.Goarch == "sparc64" {
fmt.Fprintf(&buf, "\t"+`.section ".go.buildid",#exclude`+"\n") fmt.Fprintf(&buf, "\t"+`.section ".go.buildid",#exclude`+"\n")
...@@ -345,7 +345,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) { ...@@ -345,7 +345,7 @@ func (b *Builder) gccgoBuildIDFile(a *Action) (string, error) {
fmt.Fprintf(&buf, "%#02x", a.buildID[i]) fmt.Fprintf(&buf, "%#02x", a.buildID[i])
} }
fmt.Fprintf(&buf, "\n") fmt.Fprintf(&buf, "\n")
if cfg.Goos != "solaris" && cfg.Goos != "aix" { if cfg.Goos != "solaris" && cfg.Goos != "illumos" && cfg.Goos != "aix" {
secType := "@progbits" secType := "@progbits"
if cfg.Goarch == "arm" { if cfg.Goarch == "arm" {
secType = "%progbits" secType = "%progbits"
......
...@@ -713,7 +713,7 @@ func (b *Builder) build(a *Action) (err error) { ...@@ -713,7 +713,7 @@ func (b *Builder) build(a *Action) (err error) {
// This is read by readGccgoArchive in cmd/internal/buildid/buildid.go. // This is read by readGccgoArchive in cmd/internal/buildid/buildid.go.
if a.buildID != "" && cfg.BuildToolchainName == "gccgo" { if a.buildID != "" && cfg.BuildToolchainName == "gccgo" {
switch cfg.Goos { 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) asmfile, err := b.gccgoBuildIDFile(a)
if err != nil { if err != nil {
return err return err
......
...@@ -95,7 +95,7 @@ func buildModeInit() { ...@@ -95,7 +95,7 @@ func buildModeInit() {
codegenArg = "-shared" codegenArg = "-shared"
default: default:
switch cfg.Goos { switch cfg.Goos {
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "dragonfly", "freebsd", "illumos", "linux", "netbsd", "openbsd", "solaris":
if platform == "linux/ppc64" { if platform == "linux/ppc64" {
base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) base.Fatalf("-buildmode=c-archive not supported on %s\n", platform)
} }
......
...@@ -73,7 +73,7 @@ func (h *HeadType) Set(s string) error { ...@@ -73,7 +73,7 @@ func (h *HeadType) Set(s string) error {
*h = Hopenbsd *h = Hopenbsd
case "plan9": case "plan9":
*h = Hplan9 *h = Hplan9
case "solaris": case "illumos", "solaris":
*h = Hsolaris *h = Hsolaris
case "windows": case "windows":
*h = Hwindows *h = Hwindows
......
...@@ -574,8 +574,8 @@ func TestInlinedRoutineRecords(t *testing.T) { ...@@ -574,8 +574,8 @@ func TestInlinedRoutineRecords(t *testing.T) {
if runtime.GOOS == "plan9" { if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" {
t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168")
} }
t.Parallel() t.Parallel()
...@@ -801,8 +801,8 @@ func TestAbstractOriginSanity(t *testing.T) { ...@@ -801,8 +801,8 @@ func TestAbstractOriginSanity(t *testing.T) {
if runtime.GOOS == "plan9" { if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" {
t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168")
} }
if wd, err := os.Getwd(); err == nil { if wd, err := os.Getwd(); err == nil {
...@@ -819,8 +819,8 @@ func TestAbstractOriginSanityIssue25459(t *testing.T) { ...@@ -819,8 +819,8 @@ func TestAbstractOriginSanityIssue25459(t *testing.T) {
if runtime.GOOS == "plan9" { if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" {
t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168")
} }
if runtime.GOARCH != "amd64" && runtime.GOARCH != "x86" { if runtime.GOARCH != "amd64" && runtime.GOARCH != "x86" {
t.Skip("skipping on not-amd64 not-x86; location lists not supported") t.Skip("skipping on not-amd64 not-x86; location lists not supported")
...@@ -840,8 +840,8 @@ func TestAbstractOriginSanityIssue26237(t *testing.T) { ...@@ -840,8 +840,8 @@ func TestAbstractOriginSanityIssue26237(t *testing.T) {
if runtime.GOOS == "plan9" { if runtime.GOOS == "plan9" {
t.Skip("skipping on plan9; no DWARF symbol table in executables") t.Skip("skipping on plan9; no DWARF symbol table in executables")
} }
if runtime.GOOS == "solaris" || runtime.GOOS == "darwin" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "darwin" {
t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") t.Skip("skipping on solaris, illumos, and darwin, pending resolution of issue #23168")
} }
if wd, err := os.Getwd(); err == nil { if wd, err := os.Getwd(); err == nil {
gopathdir := filepath.Join(wd, "testdata", "issue26237") gopathdir := filepath.Join(wd, "testdata", "issue26237")
......
...@@ -21,9 +21,9 @@ func cmsgAlignOf(salen int) int { ...@@ -21,9 +21,9 @@ 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", "dragonfly", "solaris": case "darwin", "dragonfly", "solaris", "illumos":
// NOTE: It seems like 64-bit Darwin, DragonFly BSD and // NOTE: It seems like 64-bit Darwin, DragonFly BSD, illumos,
// Solaris kernels still require 32-bit aligned access to // and Solaris kernels still require 32-bit aligned access to
// network subsystem. // network subsystem.
if SizeofPtr == 8 { if SizeofPtr == 8 {
salign = 4 salign = 4
......
// 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
...@@ -55,7 +55,7 @@ func endtest() { ...@@ -55,7 +55,7 @@ func endtest() {
// These tests open and examine the test binary, and use elf.Open to do so. // These tests open and examine the test binary, and use elf.Open to do so.
func skipIfNotELF(t *testing.T) { func skipIfNotELF(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris", "illumos":
// OK. // OK.
default: default:
t.Skipf("skipping on non-ELF system %s", runtime.GOOS) t.Skipf("skipping on non-ELF system %s", runtime.GOOS)
......
...@@ -1685,6 +1685,9 @@ func (ctxt *Context) match(name string, allTags map[string]bool) bool { ...@@ -1685,6 +1685,9 @@ func (ctxt *Context) match(name string, allTags map[string]bool) bool {
if ctxt.GOOS == "android" && name == "linux" { if ctxt.GOOS == "android" && name == "linux" {
return true return true
} }
if ctxt.GOOS == "illumos" && name == "solaris" {
return true
}
// other tags // other tags
for _, tag := range ctxt.BuildTags { for _, tag := range ctxt.BuildTags {
......
...@@ -147,6 +147,9 @@ ...@@ -147,6 +147,9 @@
// Using GOOS=android matches build tags and files as for GOOS=linux // Using GOOS=android matches build tags and files as for GOOS=linux
// in addition to android tags and files. // 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 // Binary-Only Packages
// //
// In Go 1.12 and earlier, it was possible to distribute packages in binary // In Go 1.12 and earlier, it was possible to distribute packages in binary
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
package build 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 " 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 "
...@@ -185,7 +185,7 @@ func TestDialError(t *testing.T) { ...@@ -185,7 +185,7 @@ func TestDialError(t *testing.T) {
func TestProtocolDialError(t *testing.T) { func TestProtocolDialError(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "nacl", "solaris": case "nacl", "solaris", "illumos":
t.Skipf("not supported on %s", runtime.GOOS) t.Skipf("not supported on %s", runtime.GOOS)
} }
......
...@@ -81,12 +81,12 @@ func (fd *netFD) connect(ctx context.Context, la, ra syscall.Sockaddr) (rsa sysc ...@@ -81,12 +81,12 @@ func (fd *netFD) connect(ctx context.Context, la, ra syscall.Sockaddr) (rsa sysc
runtime.KeepAlive(fd) runtime.KeepAlive(fd)
return nil, nil return nil, nil
case syscall.EINVAL: case syscall.EINVAL:
// On Solaris we can see EINVAL if the socket has // On Solaris and illumos we can see EINVAL if the socket has
// already been accepted and closed by the server. // already been accepted and closed by the server. Treat this
// Treat this as a successful connection--writes to // as a successful connection--writes to the socket will see
// the socket will see EOF. For details and a test // EOF. For details and a test case in C see
// case in C see https://golang.org/issue/6828. // https://golang.org/issue/6828.
if runtime.GOOS == "solaris" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" {
return nil, nil return nil, nil
} }
fallthrough fallthrough
......
...@@ -61,7 +61,7 @@ func TestInterfaces(t *testing.T) { ...@@ -61,7 +61,7 @@ func TestInterfaces(t *testing.T) {
t.Fatal(err) t.Fatal(err)
} }
switch runtime.GOOS { switch runtime.GOOS {
case "solaris": case "solaris", "illumos":
if ifxi.Index != ifi.Index { if ifxi.Index != ifi.Index {
t.Errorf("got %v; want %v", ifxi, ifi) t.Errorf("got %v; want %v", ifxi, ifi)
} }
...@@ -278,7 +278,7 @@ func checkUnicastStats(ifStats *ifStats, uniStats *routeStats) error { ...@@ -278,7 +278,7 @@ func checkUnicastStats(ifStats *ifStats, uniStats *routeStats) error {
func checkMulticastStats(ifStats *ifStats, uniStats, multiStats *routeStats) error { func checkMulticastStats(ifStats *ifStats, uniStats, multiStats *routeStats) error {
switch runtime.GOOS { switch runtime.GOOS {
case "aix", "dragonfly", "nacl", "netbsd", "openbsd", "plan9", "solaris": case "aix", "dragonfly", "nacl", "netbsd", "openbsd", "plan9", "solaris", "illumos":
default: default:
// Test the existence of connected multicast route // Test the existence of connected multicast route
// clones for IPv4. Unlike IPv6, IPv4 multicast // clones for IPv4. Unlike IPv6, IPv4 multicast
......
...@@ -534,8 +534,8 @@ func TestIPv4MulticastListener(t *testing.T) { ...@@ -534,8 +534,8 @@ func TestIPv4MulticastListener(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "android", "nacl", "plan9": case "android", "nacl", "plan9":
t.Skipf("not supported on %s", runtime.GOOS) t.Skipf("not supported on %s", runtime.GOOS)
case "solaris": case "solaris", "illumos":
t.Skipf("not supported on solaris, see golang.org/issue/7399") t.Skipf("not supported on solaris or illumos, see golang.org/issue/7399")
} }
if !supportsIPv4() { if !supportsIPv4() {
t.Skip("IPv4 is not supported") t.Skip("IPv4 is not supported")
...@@ -609,8 +609,8 @@ func TestIPv6MulticastListener(t *testing.T) { ...@@ -609,8 +609,8 @@ func TestIPv6MulticastListener(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "plan9": case "plan9":
t.Skipf("not supported on %s", runtime.GOOS) t.Skipf("not supported on %s", runtime.GOOS)
case "solaris": case "solaris", "illumos":
t.Skipf("not supported on solaris, see issue 7399") t.Skipf("not supported on solaris or illumos, see issue 7399")
} }
if !supportsIPv6() { if !supportsIPv6() {
t.Skip("IPv6 is not supported") t.Skip("IPv6 is not supported")
...@@ -674,7 +674,7 @@ func checkMulticastListener(c *UDPConn, ip IP) error { ...@@ -674,7 +674,7 @@ func checkMulticastListener(c *UDPConn, ip IP) error {
func multicastRIBContains(ip IP) (bool, error) { func multicastRIBContains(ip IP) (bool, error) {
switch runtime.GOOS { 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 return true, nil // not implemented yet
case "linux": case "linux":
if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" { if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" {
......
...@@ -651,7 +651,7 @@ func TestTCPSelfConnect(t *testing.T) { ...@@ -651,7 +651,7 @@ func TestTCPSelfConnect(t *testing.T) {
n = 1000 n = 1000
} }
switch runtime.GOOS { 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 // Non-Linux systems take a long time to figure
// out that there is nothing listening on localhost. // out that there is nothing listening on localhost.
n = 100 n = 100
......
...@@ -831,7 +831,7 @@ func TestHelperProcess(*testing.T) { ...@@ -831,7 +831,7 @@ func TestHelperProcess(*testing.T) {
// the cloned file descriptors that result from opening // the cloned file descriptors that result from opening
// /dev/urandom. // /dev/urandom.
// https://golang.org/issue/3955 // https://golang.org/issue/3955
case "solaris": case "illumos", "solaris":
// TODO(aram): This fails on Solaris because libc opens // TODO(aram): This fails on Solaris because libc opens
// its own files, as it sees fit. Darwin does the same, // its own files, as it sees fit. Darwin does the same,
// see: https://golang.org/issue/2603 // see: https://golang.org/issue/2603
......
...@@ -2226,8 +2226,8 @@ func TestPipeThreads(t *testing.T) { ...@@ -2226,8 +2226,8 @@ func TestPipeThreads(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "freebsd": case "freebsd":
t.Skip("skipping on FreeBSD; issue 19093") t.Skip("skipping on FreeBSD; issue 19093")
case "solaris": case "illumos", "solaris":
t.Skip("skipping on Solaris; issue 19111") t.Skip("skipping on Solaris and illumos; issue 19111")
case "windows": case "windows":
t.Skip("skipping on Windows; issue 19098") t.Skip("skipping on Windows; issue 19098")
case "plan9": case "plan9":
......
...@@ -159,7 +159,7 @@ func TestRemoveAllLarge(t *testing.T) { ...@@ -159,7 +159,7 @@ func TestRemoveAllLarge(t *testing.T) {
func TestRemoveAllLongPath(t *testing.T) { func TestRemoveAllLongPath(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris":
break break
default: default:
t.Skip("skipping for not implemented platforms") t.Skip("skipping for not implemented platforms")
......
...@@ -132,7 +132,7 @@ func TestGroupIds(t *testing.T) { ...@@ -132,7 +132,7 @@ func TestGroupIds(t *testing.T) {
if runtime.GOOS == "aix" { if runtime.GOOS == "aix" {
t.Skip("skipping GroupIds, see golang.org/issue/30563") 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") t.Skip("skipping GroupIds, see golang.org/issue/14709")
} }
user, err := Current() user, err := Current()
......
...@@ -171,6 +171,10 @@ needtls: ...@@ -171,6 +171,10 @@ needtls:
// skip TLS setup on Solaris // skip TLS setup on Solaris
JMP ok JMP ok
#endif #endif
#ifdef GOOS_illumos
// skip TLS setup on illumos
JMP ok
#endif
#ifdef GOOS_darwin #ifdef GOOS_darwin
// skip TLS setup on Darwin // skip TLS setup on Darwin
JMP ok JMP ok
......
...@@ -92,7 +92,7 @@ type cgoCallers [32]uintptr ...@@ -92,7 +92,7 @@ type cgoCallers [32]uintptr
// Call from Go to C. // Call from Go to C.
//go:nosplit //go:nosplit
func cgocall(fn, arg unsafe.Pointer) int32 { func cgocall(fn, arg unsafe.Pointer) int32 {
if !iscgo && GOOS != "solaris" && GOOS != "windows" { if !iscgo && GOOS != "solaris" && GOOS != "illumos" && GOOS != "windows" {
throw("cgocall unavailable") throw("cgocall unavailable")
} }
......
...@@ -35,7 +35,7 @@ func init() { ...@@ -35,7 +35,7 @@ func init() {
func TestCrashDumpsAllThreads(t *testing.T) { func TestCrashDumpsAllThreads(t *testing.T) {
switch runtime.GOOS { switch runtime.GOOS {
case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "illumos", "solaris":
default: default:
t.Skipf("skipping; not supported on %v", runtime.GOOS) t.Skipf("skipping; not supported on %v", runtime.GOOS)
} }
......
...@@ -49,6 +49,9 @@ func main() { ...@@ -49,6 +49,9 @@ func main() {
if target == "linux" { if target == "linux" {
fmt.Fprintf(&buf, "// +build !android\n") // must explicitly exclude android for 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, "// +build %s\n\n", target) // must explicitly include target for bootstrapping purposes
fmt.Fprintf(&buf, "package sys\n\n") fmt.Fprintf(&buf, "package sys\n\n")
fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target) fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 1 ...@@ -12,6 +12,7 @@ const GoosDarwin = 1
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 1 const GoosDragonfly = 1
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 1 const GoosFreebsd = 1
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 1 const GoosHurd = 1
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
// 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
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 1 const GoosJs = 1
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -13,6 +13,7 @@ const GoosDarwin = 0 ...@@ -13,6 +13,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 1 const GoosLinux = 1
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 1 const GoosNacl = 1
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
// Code generated by gengoos.go using 'go generate'. DO NOT EDIT. // Code generated by gengoos.go using 'go generate'. DO NOT EDIT.
// +build !illumos
// +build solaris // +build solaris
package sys package sys
...@@ -12,6 +13,7 @@ const GoosDarwin = 0 ...@@ -12,6 +13,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -12,6 +12,7 @@ const GoosDarwin = 0 ...@@ -12,6 +12,7 @@ const GoosDarwin = 0
const GoosDragonfly = 0 const GoosDragonfly = 0
const GoosFreebsd = 0 const GoosFreebsd = 0
const GoosHurd = 0 const GoosHurd = 0
const GoosIllumos = 0
const GoosJs = 0 const GoosJs = 0
const GoosLinux = 0 const GoosLinux = 0
const GoosNacl = 0 const GoosNacl = 0
......
...@@ -56,7 +56,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *uint64) { ...@@ -56,7 +56,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *uint64) {
mSysStatInc(sysStat, n) mSysStatInc(sysStat, n)
p, err := mmap(v, n, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_FIXED|_MAP_PRIVATE, -1, 0) 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") throw("runtime: out of memory")
} }
if p != v || err != 0 { if p != v || err != 0 {
......
...@@ -177,8 +177,8 @@ func poll_runtime_pollWait(pd *pollDesc, mode int) int { ...@@ -177,8 +177,8 @@ func poll_runtime_pollWait(pd *pollDesc, mode int) int {
if err != 0 { if err != 0 {
return err return err
} }
// As for now only Solaris and AIX use level-triggered IO. // As for now only Solaris, illumos, and AIX use level-triggered IO.
if GOOS == "solaris" || GOOS == "aix" { if GOOS == "solaris" || GOOS == "illumos" || GOOS == "aix" {
netpollarm(pd, mode) netpollarm(pd, mode)
} }
for !netpollblock(pd, int32(mode), false) { for !netpollblock(pd, int32(mode), false) {
......
...@@ -191,7 +191,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri ...@@ -191,7 +191,7 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri
} }
switch runtime.GOOS { 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) t.Skipf("ignoring failure on %s; see golang.org/issue/13841", runtime.GOOS)
case "openbsd": case "openbsd":
if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" {
......
...@@ -486,7 +486,7 @@ func cpuinit() { ...@@ -486,7 +486,7 @@ func cpuinit() {
var env string var env string
switch GOOS { switch GOOS {
case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "solaris", "linux": case "aix", "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "illumos", "solaris", "linux":
cpu.DebugOptions = true cpu.DebugOptions = true
// Similar to goenv_unix but extracts the environment value for // Similar to goenv_unix but extracts the environment value for
...@@ -638,7 +638,7 @@ func mcommoninit(mp *m) { ...@@ -638,7 +638,7 @@ func mcommoninit(mp *m) {
unlock(&sched.lock) unlock(&sched.lock)
// Allocate memory to hold a cgo traceback if the cgo call crashes. // 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) mp.cgoCallers = new(cgoCallers)
} }
} }
...@@ -1167,8 +1167,8 @@ func mstart() { ...@@ -1167,8 +1167,8 @@ func mstart() {
mstart1() mstart1()
// Exit this thread. // Exit this thread.
if GOOS == "windows" || GOOS == "solaris" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "aix" { if GOOS == "windows" || GOOS == "solaris" || GOOS == "illumos" || GOOS == "plan9" || GOOS == "darwin" || GOOS == "aix" {
// Window, Solaris, Darwin, AIX and Plan 9 always system-allocate // Windows, Solaris, illumos, Darwin, AIX and Plan 9 always system-allocate
// the stack, but put it in _g_.stack before mstart, // the stack, but put it in _g_.stack before mstart,
// so the logic above hasn't set osStack yet. // so the logic above hasn't set osStack yet.
osStack = true osStack = true
...@@ -1488,9 +1488,9 @@ func allocm(_p_ *p, fn func()) *m { ...@@ -1488,9 +1488,9 @@ func allocm(_p_ *p, fn func()) *m {
mp.mstartfn = fn mp.mstartfn = fn
mcommoninit(mp) 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. // 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) mp.g0 = malg(-1)
} else { } else {
mp.g0 = malg(8192 * sys.StackGuardMultiplier) mp.g0 = malg(8192 * sys.StackGuardMultiplier)
...@@ -3747,7 +3747,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) { ...@@ -3747,7 +3747,7 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) {
// Normal traceback is impossible or has failed. // Normal traceback is impossible or has failed.
// See if it falls into several common cases. // See if it falls into several common cases.
n = 0 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. // Libcall, i.e. runtime syscall on windows.
// Collect Go stack that leads to the call. // 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) n = gentraceback(mp.libcallpc, mp.libcallsp, 0, mp.libcallg.ptr(), 0, &stk[0], len(stk), nil, nil, 0)
......
// 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)
...@@ -275,8 +275,8 @@ func Exec(argv0 string, argv []string, envv []string) (err error) { ...@@ -275,8 +275,8 @@ func Exec(argv0 string, argv []string, envv []string) (err error) {
runtime_BeforeExec() runtime_BeforeExec()
var err1 error var err1 error
if runtime.GOOS == "solaris" || runtime.GOOS == "aix" { if runtime.GOOS == "solaris" || runtime.GOOS == "illumos" || runtime.GOOS == "aix" {
// RawSyscall should never be used on Solaris or AIX. // RawSyscall should never be used on Solaris, illumos, or AIX.
err1 = execveLibc( err1 = execveLibc(
uintptr(unsafe.Pointer(argv0p)), uintptr(unsafe.Pointer(argv0p)),
uintptr(unsafe.Pointer(&argvp[0])), uintptr(unsafe.Pointer(&argvp[0])),
......
...@@ -21,7 +21,7 @@ func cmsgAlignOf(salen int) int { ...@@ -21,7 +21,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", "dragonfly", "solaris": case "darwin", "dragonfly", "illumos", "solaris":
// NOTE: It seems like 64-bit Darwin, DragonFly BSD and // NOTE: It seems like 64-bit Darwin, DragonFly BSD and
// Solaris kernels still require 32-bit aligned access to // Solaris kernels still require 32-bit aligned access to
// network subsystem. // network subsystem.
......
...@@ -25,6 +25,7 @@ const ( ...@@ -25,6 +25,7 @@ const (
dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8 dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8
netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4
solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8 solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8
illumos64Bit = runtime.GOOS == "illumos" && sizeofPtr == 8
) )
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment