Skip to content

x/sys/unix: does not define O_LARGEFILE for FreeBSD #48160

@igalic

Description

@igalic

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

$ go version
go version go1.17 freebsd/amd64

Does this issue reproduce with the latest release?

yes (this is the latest version)

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/meena/.cache/go-build"
GOENV="/home/meena/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/home/meena/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/home/meena/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="go1.17"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build3854317626=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I tried to use unix.O_LARGEFILE:

package main

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

func main() {
	fmt.Println(unix.O_LARGEFILE)
}

What did you expect to see?

meena@76ix ~/s/g/o_largefile> ./o_largefile
0
meena@76ix ~/s/g/o_largefile>

like on the playground: https://play.golang.org/p/9EYN2Wd4xGD

What did you see instead?

meena@beasdix ~/s/g/o_largefile> go get
# eena.me/o_largefile
./o_largefile.go:9:14: undefined: unix.O_LARGEFILE
meena@beasdix ~/s/g/o_largefile [2]> 

in modernc or ccgo there's a work-around in place to define O_LARGEFILE as 0: https://gitlab.com/cznic/libc/-/issues/10

we believe this should be in x/sys/unix

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions