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 renamex_np, renameatx_np #48425

Open
elagergren-spideroak opened this issue Sep 16, 2021 · 4 comments
Open

x/sys/unix: add renamex_np, renameatx_np #48425

elagergren-spideroak opened this issue Sep 16, 2021 · 4 comments

Comments

@elagergren-spideroak
Copy link

@elagergren-spideroak elagergren-spideroak commented Sep 16, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/elagergren/git/flow/bin"
GOCACHE="/Users/elagergren/Library/Caches/go-build"
GOENV="/Users/elagergren/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/elagergren/gopath/pkg/mod"
GONOPROXY="*.spideroak-ms.com,*.spideroak.com"
GONOSUMDB="*.spideroak-ms.com,*.spideroak.com"
GOOS="darwin"
GOPATH="/Users/elagergren/gopath"
GOPRIVATE="*.spideroak-ms.com,*.spideroak.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/elagergren/git/flow/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/2b/74fz3jhd4wz4vnbf4z7ywzww0000gp/T/go-build1702522330=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Looked in golang.org/x/sys/unix for Renameatx_np.

What did you expect to see?

Renameatx_np.

What did you see instead?

Not Renameatx_np. :)

The use case here is wanting to use RENAME_EXCL.

@HowJMay
Copy link
Contributor

@HowJMay HowJMay commented Oct 23, 2021

Hi I am interested in this issue, but I kinda need more description for it. Does this issue mean I need to implement Renameatx_np under darwin just like how we implement Renameat?

Loading

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 26, 2021

Basically, yes. Although of course the argument types are different.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 7, 2021

Change https://golang.org/cl/361958 mentions this issue: unix: implements RenamexNp and RenameatxNp for darwin

Loading

@zchee
Copy link
Contributor

@zchee zchee commented Nov 7, 2021

@elagergren-spideroak @HowJMay
How about this implementation? (stil WIP)
cc @ianlancetaylor

https://golang.org/cl/361958


I found sys package doesn't provide the copyfile.h related functions.
Basically, it's Standard C Library copyfile(3), but Apple implements additional features which are APFS filesystem CoW clone. I also planning to implement those.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants