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: AT_REMOVEDIR not defined on OpenBSD #46342

Closed
rudis opened this issue May 24, 2021 · 4 comments
Closed

x/sys/unix: AT_REMOVEDIR not defined on OpenBSD #46342

rudis opened this issue May 24, 2021 · 4 comments
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@rudis
Copy link

rudis commented May 24, 2021

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

$ go version
go version go1.16.2 openbsd/amd64

Does this issue reproduce with the latest release?

Yes, also tested with 1.16.4 (cross-compiling to OpenBSD).

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="openbsd"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="openbsd"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/openbsd_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="cc"
CXX="c++"
CGO_ENABLED="1"
GOMOD="/root/a/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 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3757805810=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Program:

package main

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

func main() {
        log.Printf("%v", unix.AT_REMOVEDIR)
}

go.sum:

module a

go 1.16

require golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1

What did you expect to see?

The value of AT_REMOVEDIR.

What did you see instead?

# a
./x.go:9:19: undefined: unix.AT_REMOVEDIR

I noticed this when cross-compiling for OpenBSD but the above tests were run directly on OpenBSD.

The constant is present on the system:

$ grep -r AT_REMOVEDIR /usr/include 
/usr/include/fcntl.h:#define    AT_REMOVEDIR            0x08
/usr/include/sys/fcntl.h:#define        AT_REMOVEDIR            0x08

It's defined on other systems (e.g. FreeBSD, Linux, etc.).

@gopherbot gopherbot added this to the Unreleased milestone May 24, 2021
@mknyszek mknyszek changed the title x/sys: unix.AT_REMOVEDIR not defined on OpenBSD x/sys/unix: AT_REMOVEDIR not defined on OpenBSD May 24, 2021
@mknyszek mknyszek added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels May 24, 2021
@mknyszek
Copy link
Contributor

Labeling as a feature request (albeit a very minor one).

CC @ianlancetaylor via https://dev.golang.org/owners

@ianlancetaylor
Copy link
Contributor

Want to send a patch?

@rudis
Copy link
Author

rudis commented Jun 3, 2021

I'd like to but I cannot sign the CLA.

@gopherbot
Copy link

Change https://golang.org/cl/325431 mentions this issue: unix: add AT_REMOVEDIR and AT_EACCESS on openbsd

@golang golang locked and limited conversation to collaborators Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants