linux: fix arm64 SYS__sysctl build breakage
The arm64 architecture never had a _sysctl system call and therefore doesn't have a SYS__sysctl define either. Always return UV_ENOSYS. Fixes: https://github.com/libuv/libuv/issues/2522 PR-URL: https://github.com/libuv/libuv/pull/2524 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
cb7e5a6aff
commit
83f59ff1c1
@ -65,9 +65,18 @@ int uv__random_sysctl(void* buf, size_t buflen) {
|
||||
* an okay trade-off for the fallback of the fallback: this function is
|
||||
* only called when neither getrandom(2) nor /dev/urandom are available.
|
||||
* Fails with ENOSYS on kernels configured without CONFIG_SYSCTL_SYSCALL.
|
||||
* At least arm64 never had a _sysctl system call and therefore doesn't
|
||||
* have a SYS__sysctl define either.
|
||||
*/
|
||||
#ifdef SYS__sysctl
|
||||
if (syscall(SYS__sysctl, &args) == -1)
|
||||
return UV__ERR(errno);
|
||||
#else
|
||||
{
|
||||
(void) &args;
|
||||
return UV_ENOSYS;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (n != sizeof(uuid))
|
||||
return UV_EIO; /* Can't happen. */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user