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

Fix build with musl and older Linux kernel #82

Closed
wants to merge 1 commit into from

Commits on Sep 29, 2017

  1. Fix build with musl and older Linux kernel

    The musl libc carries its own copy of Linux system calls. When building
    with Linux headers older than v3.17, musl provides SYS_getrandom
    definition, but not GRND_NONBLOCK. This causes build failure for
    libressl and openntpd:
    
    getentropy_linux.c: In function 'getentropy_getrandom':
    getentropy_linux.c:205:42: error: 'GRND_NONBLOCK' undeclared (first use in this function)
       ret = syscall(SYS_getrandom, buf, len, GRND_NONBLOCK);
                                              ^~~~~~~~~~~~~
    
    Define GRND_NONBLOCK locally when its definition is missing to fix the
    build. There should be no run-time effect. Older kernels return ENOSYS
    for unsupported syscall().
    baruchsiach committed Sep 29, 2017
    Configuration menu
    Copy the full SHA
    b2a34ab View commit details
    Browse the repository at this point in the history