netbsd port: round 0#1518
Open
lzcunt wants to merge 8 commits into
Open
Conversation
73f88f1 to
5733689
Compare
It turns out, NetBSD does not use these values. It should be safe to not require them.
NetBSD doesn't follow the common values for these a_types so we should move them to ABI.
BSDs do not have these errno values, they're Linux-isms.
`fchown` was implemented with `fchownat` using `AT_EMPTY_PATH` which is sadly a Linux extension. Let's make fchown a sysdep so it can be implemented separately for the NetBSD port.
CBAUD is not POSIX and NetBSD does not have CBAUD. These functions can probably be implemented without CBAUD but I do not know how.
This defines _GNU_SOURCE and other macros to expose as much as possible from the mlibc headers when building mlibc itself.
1aeaa55 to
6400ac9
Compare
no92
reviewed
Dec 10, 2025
| } | ||
|
|
||
| int fchown(int fd, uid_t uid, gid_t gid) { | ||
| MLIBC_CHECK_OR_ENOSYS(mlibc::sys_fchownat, -1); |
Member
There was a problem hiding this comment.
Another possibility would be to try to use sys_fchownat and fall back to a sys_fchown.
Contributor
Author
There was a problem hiding this comment.
Any reason would that be preferred?
| #include <bits/ensure.h> | ||
| #include <mlibc/posix-sysdeps.hpp> | ||
|
|
||
| #ifdef CBAUD |
Member
There was a problem hiding this comment.
CBAUD is XSI-reserved, technically; the solution here would be to have a sysdep to implement this in the OS-specific way.
| mlibc_c_args = ['-Wno-unused-function', '-D__MLIBC_BUILDING_MLIBC', '-nostdinc', '-fno-builtin', '-ffreestanding'] | ||
| mlibc_link_args = ['-nostdlib'] | ||
| add_project_arguments('-Werror=misleading-indentation', language: ['c', 'cpp']) | ||
| add_project_arguments('-D_DEFAULT_SOURCE', '-D_GNU_SOURCE', language: ['c', 'cpp']) |
Member
There was a problem hiding this comment.
All arguments but _GNU_SOURCE are certainly wrong; _DEFAULT_SOURCE should be set by mlibc-config.h, and the rest is set to sane values by default.
The _GNU_SOURCE case is more interesting on BSDs - I assume it is not defined there, even for C++?
Contributor
Author
|
I have no idea why the dripOS and friends keep reappearing every time I get rid of them |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These are some various patches with the common theme of reducing Linux-isms and GNU-isms that are needed to port to NetBSD.