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

Use <fcntl.h> instead of <sys/fcntl.h> #15925

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thesamesam
Copy link
Contributor

@thesamesam thesamesam commented Feb 23, 2024

Motivation and Context

<sys/fcntl.h> is deprecated and triggers a warning (-> error) on musl.

Bug: https://bugs.gentoo.org/925235

Description

When building on musl, we get:

In file included from tests/zfs-tests/cmd/getversion.c:22:
/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>

In file included from module/os/linux/zfs/vdev_file.c:36:
/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>                                                                                                                     

How Has This Been Tested?

Tested on musl and glibc on amd64.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@thesamesam thesamesam force-pushed the musl-fcntl branch 3 times, most recently from 17c9384 to 68419c7 Compare February 23, 2024 06:40
@thesamesam thesamesam changed the title tests: use <fcntl.h> instead of <sys/fcntl.h> Use <fcntl.h> instead of <sys/fcntl.h> Feb 23, 2024
@thesamesam thesamesam marked this pull request as draft February 24, 2024 19:30
When building on musl, we get:
```
In file included from tests/zfs-tests/cmd/getversion.c:22:
/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>

In file included from module/os/linux/zfs/vdev_file.c:36:
/usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
```

Bug: https://bugs.gentoo.org/925235
Signed-off-by: Sam James <sam@gentoo.org>
@behlendorf
Copy link
Contributor

@thesamesam is there any reason this is still marked as a draft?

@thesamesam
Copy link
Contributor Author

Completely forgot. I've got a busy few days but I'll put this on my list to come back to.

I need to double check if there's any other missing includes and whether they need a guard - there was one I dropped which it turns out is needed for the kernel build but is wrong for the userland build, or something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants