Skip to content

QNX: enhance config reading#938

Merged
bradh352 merged 4 commits into
c-ares:mainfrom
bradh352:qnx-config
Dec 14, 2024
Merged

QNX: enhance config reading#938
bradh352 merged 4 commits into
c-ares:mainfrom
bradh352:qnx-config

Conversation

@bradh352
Copy link
Copy Markdown
Member

QNX prefers config read from confstr(_CS_RESOLVE, ...) and confstr(_CS_DOMAIN, ...) rather than those read from /etc/resolv.conf and friends which are only used as fallbacks. Its documented that confstr() reads from /etc/net.cfg, but that file format is NOT documented so we can't read directly from there ... however, we can monitor that file for changes to know when the system config has been updated.

This has been validated to successfully build, but has not yet had the tests run on an actual QNX platform. Build results here:
https://github.com/bradh352/c-ares/actions/runs/12324751945/job/34402863134

Signed-off-by: Brad House (@bradh352)

@bradh352
Copy link
Copy Markdown
Member Author

@bagder do you think this PR will finish off your needs for QNX modifications?

@bagder
Copy link
Copy Markdown
Member

bagder commented Dec 14, 2024

Thanks! It certainly looks like this at least fixes the build issues. I'm not completely educated about the purposes of all the QNX specific commits, but if there are additional details that "need" to be fixed we can work on them in follow-up PRs.

@bradh352
Copy link
Copy Markdown
Member Author

bradh352 commented Dec 14, 2024

I just ran through the test cases on a QNX vm i spun up, the only thing that failed was service name lookup due to getservbyname() not returning resuls, likely due to lack of /etc/services ... I think its a seldom-used feature, not sure the proper workaround.

@bradh352
Copy link
Copy Markdown
Member Author

I found one bug in reading confstr, I was able to use setconf on the command line to get a string to parse. anyhow, I think this stuff is looking good now.

@bradh352 bradh352 merged commit 76dbb10 into c-ares:main Dec 14, 2024
@bradh352 bradh352 deleted the qnx-config branch December 14, 2024 14:23
bradh352 added a commit that referenced this pull request Dec 14, 2024
QNX prefers config read from confstr(_CS_RESOLVE, ...) and
confstr(_CS_DOMAIN, ...) rather than those read from /etc/resolv.conf
and friends which are only used as fallbacks. Its documented that
confstr() reads from /etc/net.cfg, but that file format is NOT
documented so we can't read directly from there ... however, we can
monitor that file for changes to know when the system config has been
updated.

This has been validated to successfully build, but has not yet had the
tests run on an actual QNX platform. Build results here:

https://github.com/bradh352/c-ares/actions/runs/12324751945/job/34402863134

Signed-off-by: Brad House (@bradh352)
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
QNX prefers config read from confstr(_CS_RESOLVE, ...) and
confstr(_CS_DOMAIN, ...) rather than those read from /etc/resolv.conf
and friends which are only used as fallbacks. Its documented that
confstr() reads from /etc/net.cfg, but that file format is NOT
documented so we can't read directly from there ... however, we can
monitor that file for changes to know when the system config has been
updated.

This has been validated to successfully build, but has not yet had the
tests run on an actual QNX platform. Build results here:

https://github.com/bradh352/c-ares/actions/runs/12324751945/job/34402863134

Signed-off-by: Brad House (@bradh352)
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.

2 participants