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

Apparent lack of HOST_NAME_MAX on macOS? #84

Closed
artkiver opened this issue Mar 20, 2023 · 2 comments · Fixed by #85
Closed

Apparent lack of HOST_NAME_MAX on macOS? #84

artkiver opened this issue Mar 20, 2023 · 2 comments · Fixed by #85

Comments

@artkiver
Copy link

Hello there!

I have been making efforts to update the MacPorts Portfile from 8.2 to 8.3 and have run into the following issue during an attempted build and installation:


output-ometric.c:131:16: error: use of undeclared identifier 'HOST_NAME_MAX'
        char hostname[HOST_NAME_MAX + 1];
                      ^
1 error generated.
  CC       rpki_client-roa.o
make[1]: *** [rpki_client-output-ometric.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Documented (along with some rabbit holes not worth expounding upon here) and explored by a fellow MacPorts contributor in comment:
https://trac.macports.org/ticket/67126#comment:6

"As far as I can tell, macOS does not currently define HOST_NAME_MAX. I found no references to it by grepping MacOSX.sdk/usr/include on Monterey. The macOS gethostname(3) manpage used to refer to HOST_NAME_MAX so I guess macOS used to define it (or the manpage mentioned it erroneously), but that manpage currently refers to sysconf(_SC_HOST_NAME_MAX) instead. So this is a bug in rpki-client that will have to be discussed with and addressed by its developers before the port can be updated to this version." ー @ryandesign

Similarly, on macOS Ventura (13.2.1) this seems to be the case as well:

% cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/include
 % grep -R HOST_NAME_MAX                   
./limits.h:#define _POSIX_HOST_NAME_MAX    255
./unistd.h:#define	_SC_HOST_NAME_MAX		72
@ryandesign
Copy link

The oldest macOS I had up and running was 10.6.8; it doesn't have HOST_NAME_MAX either.

@artkiver
Copy link
Author

See #85 (comment) for an update from my vantage (and the vantage of the MacPorts CI build bots testing on some other systems).

Thanks!

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 a pull request may close this issue.

2 participants