-
Notifications
You must be signed in to change notification settings - Fork 7.4k
posix: unistd.h: Add gethostname() #16009
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
Conversation
I am probably missing something obvious, so forgive me for asking, but how does this relate to the definition in For reference: Lines 628 to 631 in 774d5e8
|
f308026
to
5415a73
Compare
So:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pfalcon thank you for the detailed answer.
These 2 usages shouldn't conflict with each other (e.g., being exclusive).
That is what I mean. Your patch actually makes them conflict with each other.
If you enable all the POSIX stuff in config including sockets and CONFIG_SOCKETS_POSIX_NAMES
, you get a redefinition.
So taking into account that this is meant to be a part of many patches, it should be at least wrapped in an ifdef (#if !defined(CONFIG_SOCKETS_POSIX_NAMES)
? ) - at least temporarily.
CI disagrees. So, please remove your -1, you're blocking next 99 patches ;-). And at the current velocity (based on the #15628 stats), we'll need 4 years to go thru them. OTOH, if you experience an issue, feel free to join "a hundred patches" streak, submit your patch, and we'll see if it goes in the right direction. |
Apparently CI does not test it thoroughly enough, consider the following, example:
The compilation gives:
|
Is this explicit and if not can we make it? Is it valid to have CONFIG_NET_SOCKETS_POSIX_NAMES and CONFIG_POSIX set? Can we make Kconfig such that they are mutually exclusive? Also what do we see as the final goal w/regards to the initial usecase? ie will we remove CONFIG_NET_SOCKETS_POSIX_NAMES? |
you probably want to submit all those 99 patches in one PR. Solving the issues 1 patch at a time is going to make reviewing something like this very difficult without understanding the full picture and an idea where we are going with this. |
Of course it doesn't, or we'd never get issues like #15618 . Yet we have that and a thousand of other issues. And as you remember from #16009 (comment), there's no giant who can solve them up at once.
Patches welcome. |
I am not sure I follow you here. The example I gave compiles just fine without the patch from this PR. So while I agree that there is a lot to be done with POSIX in Zephyr (as you know I encountered some of the issues myself), I don't see why we would want to fix one thing by breaking another (especially that it seems to be fairly simple to avoid, either with the ifdef I suggested or by making the config options exclusive like @galak suggested.) Feel free to remove my -1 if you don't consider that to be a problem. |
In my list, we'll have too, if we haven't yet. Checking and doing that would be subject of one of next hundred of patches. Or I hope @tgorochowik can pick it up.
I'm wary of "final goals". I definitely have some vision in my head, but it's pretty clear that it would differ a lot from visions other folks have. The latest example is @nashif's tirade at yesterday's networking forum regarding usage of POSIX API for networking projects. You see, we already use POSIX API (even if part of it, BSD Sockets) for all things networking, and yet when people want to use even more POSIX API, that surprises @nashif. That shows that there's no common vision across project stakeholders, and achieving that would be the mid-way goal before defining the final ones. Answering specific questions, I personally don't see CONFIG_NET_SOCKETS_POSIX_NAMES going anywhere soon. A prerequisite for considering that would be really-working POSIX subsys, and that's rather distant goal. |
test |
I definitely don't want to do that. And if you want to review PRs like that, you can try #12984 . This patch is nothing but extract from it. (I also regularly try reviews like that in network subsys, which are of course not really reviewable and after which there's a trail of regressions.)
Contrary, it's very easy - is it a step in the right direction (here: does unistd.h really define gethostname() per POSIX)? Does it pass CI? Then merge, rinse, and repeat.
Unfortunately, nobody can understand full picture of everything. That's why there're subsystem maintainers, which have a more or less a full picture of a subset of project. And I'm left as the only POSIX subsys maintainer. Except that I'm not, because an entry in Zephyr's CODEOWNERS doesn't really mean anything like a subsystem maintainer in other projects. That said, I exactly communicate my understanding of the problem and plan to solve it. |
Hopefully the upcoming patches will fix the issues I raised
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I not fond of introducing technical debt with the promise that it will be fixed in the future. Please submit everything to address this issue in one PR.
Not directly related issue of CONFIG_POSIX_API vs CONFIG_SOCKETS_POSIX_NAMES conflict is split into #16141 . |
Per POSIX, gethostname() is declared in unistd.h. Signed-off-by: Paul Sokolovsky <[email protected]>
5415a73
to
5cfbcdf
Compare
Requested change was implemented in #16557
Per POSIX, gethostname() is declared in unistd.h.
Signed-off-by: Paul Sokolovsky [email protected]