Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/sys/unix: Add support for flock(3C) to Solaris #21410

Closed
sean- opened this issue Aug 11, 2017 · 2 comments
Closed

x/sys/unix: Add support for flock(3C) to Solaris #21410

sean- opened this issue Aug 11, 2017 · 2 comments

Comments

@sean-
Copy link

sean- commented Aug 11, 2017

Please answer these questions before submitting your issue. Thanks!

Pre-patch

# env GOPATH=/tmp/pre-pr /opt/local/bin/go version
go version go1.8.1 solaris/amd64
# env GOPATH=/tmp/pre-pr /opt/local/bin/go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="solaris"
GOOS="solaris"
GOPATH="/tmp/pre-pr"
GORACE=""
GOROOT="/opt/local/go"
GOTOOLDIR="/opt/local/go/pkg/tool/solaris_amd64"
GCCGO="/opt/local/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build910593760=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
[root@nomad-dev /tmp/t2]# env GOPATH=/tmp/pre-pr /opt/local/bin/go run flock.go
# command-line-arguments
./flock.go:9: undefined: unix.Flock

What did you do?

https://go-review.googlesource.com/c/55230

Post-patch

# env GOPATH=$HOME/go ~/go/bin/go version
go version go1.9rc2 solaris/amd64
# env GOPATH=$HOME/go ~/go/bin/go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="solaris"
GOOS="solaris"
GOPATH="/root/go"
GORACE=""
GOROOT="/root/go-devel"
GOTOOLDIR="/root/go-devel/pkg/tool/solaris_amd64"
GCCGO="/opt/local/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build060664245=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
# env GOPATH=$HOME/go ~/go/bin/go run flock.go
flocked out
# cat flock.go
package main

import (
	"fmt"
	"golang.org/x/sys/unix"
)

func main() {
	if err := unix.Flock(0, 2); err != nil {
		fmt.Printf("err: %v\n", err)
	}
	fmt.Println("flocked out")
}
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/55230 mentions this issue: x/sys/unix: Add flock(3C) support to Solaris.

@mikioh mikioh changed the title Add support for flock(3C) to Solaris x/sys/unix: Add support for flock(3C) to Solaris Aug 11, 2017
@gopherbot gopherbot added this to the Unreleased milestone Aug 11, 2017
@binarycrusader
Copy link
Contributor

binarycrusader commented Aug 14, 2017

Only Illumos has flock; Solaris doesn't support flock (yet) and not all versions of Illumos/SmartOS support it (it was added some time in the past few years, don't know when).

micanzhang pushed a commit to micanzhang/sys that referenced this issue Sep 12, 2017
Fixes: golang/go#21410

Change-Id: Ie1971f7d6e0cfe405603e94c538a15dd5f467392
Reviewed-on: https://go-review.googlesource.com/55230
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants