Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Fix FreeBSD's statvfs #2265

Merged
merged 3 commits into from
Aug 7, 2018
Merged

Fix FreeBSD's statvfs #2265

merged 3 commits into from
Aug 7, 2018

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented Aug 2, 2018

For some reason, FreeBSD's declarations for core.sys.posix.sys.statvfs are statfs declarations that come from sys/mount.h rather than sys/statvfs.h. This adds core.sys.freebsd.sys.mount and moves the statfs stuff to there and then adds the correct declarations to core.sys.posix.sys.statvfs.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @jmdavis!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + druntime#2265"

}


enum ulong MNT_RDONLY = 0x0000000000000001;
Copy link
Member

Choose a reason for hiding this comment

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

I would have grouped the constants in an enum MNT : ulong { /+ ... +/ } aggregate and then "exported" out the individual members as aliases. Easily automatable via static foreach + mixin.

Copy link
Member Author

Choose a reason for hiding this comment

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

Except that we haven't been doing enums like that in druntime. This file does with FFlag, but it's the only one, and I'm actually planning to create a PR after this to remove it so that they're just enums directly in the module like we've done everywhere else when porting constants from C in druntime. While it's not how I'd do it if I were writing proper D code, it's closer to how the C code actually is and thus makes using the C bindings more like using the actual C functions and constants in C.

I also don't see much benefit in having all of the values in there twice, even if the generation of the second set of them is automated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants