Closed ncw closed 9 months ago
We need to move the types to a platform dependent file I guess.
fs_statfs_type.go
was initially checked in with build tags:
//go:build !netbsd && !openbsd && !solaris
and now has even more verbose tags:
//go:build !netbsd && !openbsd && !solaris && !windows && !nostatfs
!plan9
could be added to these, but maybe it's more concise to specify the GOOS values which do support Statfs_t
.
GOOS which have a syscall.Statfs()
func: aix, darwin, dragonfly, freebsd, linux, openbsd.
GOOS which have a syscall.Statfs_t
struct containing a Type
member: aix, darwin, dragonfly, freebsd, linux.
Note the absence of openbsd in the latter. The intersection of those GOOS may be used as the build tags for fs_statfs_type.go
, i.e.
//go:build aix || darwin || dragonfly || freebsd || linux
However, the isRealProc()
function compares stat.Type
to a magic number (PROC_SUPER_MAGIC
, 0x9fa0), which is highly likely to be Linux-specific. It is defined on FreeBSD due to its Linux compatibility layer, but I'm skeptical that it would be defined (or relevant) on AIX, Darwin or DragonFly BSD.
I'm leaning towards the opinion that this function should be built on Linux (and maybe FreeBSD) only.
I had same issue too
This no longer compiles on plan9 which it used to.
This means that
"github.com/prometheus/client_golang/prometheus"
no longer compiles on plan9.