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

Fallback to 256 w/ no host name max on unix #16

Closed
wants to merge 1 commit into from
Closed

Fallback to 256 w/ no host name max on unix #16

wants to merge 1 commit into from

Commits on Jul 3, 2024

  1. Fallback to 256 w/ no host name max on unix

    POSIX allows sysconf(_SC_HOST_NAME_MAX) to return -1 in case no limit
    is set; in such cases, fallback to an hardcoded 256 as limit for the
    buffer used for libc::gethostname(), which should be more than good
    enough in most/all the cases.
    
    This fixes gethostname() on GNU/Hurd, where there is no limit defined
    by sysconf(_SC_HOST_NAME_MAX).
    pinotree committed Jul 3, 2024
    Configuration menu
    Copy the full SHA
    737f7b5 View commit details
    Browse the repository at this point in the history