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

Fix build tags for isRealProc function #560

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

dswarbrick
Copy link
Contributor

Only aix, darwin, dragonfly freebsd and linux GOOS have a Type member in their syscall.Statfs_t struct. However, since the isRealProc compares that Type to a magic number (PROC_SUPER_MAGIC, 0x9fa0) which is only relevant to Linux (and possibly FreeBSD with Linux compatibility), adjust build tags accordingly.

This drops the previous nostatfs build tag workaround, since the "tamago" GOOS for which it was originally added won't match the updated build tags.

Fixes: #554.

Only aix, darwin, dragonfly freebsd and linux GOOS have a Type member in
their syscall.Statfs_t struct. However, since the isRealProc compares
that Type to a magic number (PROC_SUPER_MAGIC, 0x9fa0) which is only
relevant to Linux (and possibly FreeBSD with Linux compatibility),
adjust build tags accordingly.

This drops the previous nostatfs build tag workaround, since the
"tamago" GOOS for which it was originally added won't match the updated
build tags.

Fixes: prometheus#554.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@SuperQ SuperQ merged commit 607adcf into prometheus:master Sep 22, 2023
7 checks passed
@dswarbrick dswarbrick deleted the statfs-type branch September 22, 2023 13:37
jritter pushed a commit to jritter/procfs that referenced this pull request Jul 15, 2024
Only aix, darwin, dragonfly freebsd and linux GOOS have a Type member in
their syscall.Statfs_t struct. However, since the isRealProc compares
that Type to a magic number (PROC_SUPER_MAGIC, 0x9fa0) which is only
relevant to Linux (and possibly FreeBSD with Linux compatibility),
adjust build tags accordingly.

This drops the previous nostatfs build tag workaround, since the
"tamago" GOOS for which it was originally added won't match the updated
build tags.

Fixes: prometheus#554.

Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No longer compiles on plan9
3 participants