-/* $OpenBSD: getentropy_linux.c,v 1.30 2014/07/21 20:19:47 guenther Exp $ */
+/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */
/*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
static int gotdata(char *buf, size_t len);
static int getentropy_getrandom(void *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int getentropy_sysctl(void *buf, size_t len);
#endif
static int getentropy_fallback(void *buf, size_t len);
if (ret != -1)
return (ret);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
/*
* Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
* sysctl is a failsafe API, so it guarantees a result. This
ret = getentropy_sysctl(buf, len);
if (ret != -1)
return (ret);
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
/*
* Entropy collection via /dev/urandom and sysctl have failed.
return -1;
}
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int
getentropy_sysctl(void *buf, size_t len)
{
errno = EIO;
return -1;
}
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
static int cl[] = {
CLOCK_REALTIME,
-/* $OpenBSD: getentropy_linux.c,v 1.30 2014/07/21 20:19:47 guenther Exp $ */
+/* $OpenBSD: getentropy_linux.c,v 1.31 2014/07/21 23:34:54 deraadt Exp $ */
/*
* Copyright (c) 2014 Theo de Raadt <deraadt@openbsd.org>
static int gotdata(char *buf, size_t len);
static int getentropy_getrandom(void *buf, size_t len);
static int getentropy_urandom(void *buf, size_t len);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int getentropy_sysctl(void *buf, size_t len);
#endif
static int getentropy_fallback(void *buf, size_t len);
if (ret != -1)
return (ret);
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
/*
* Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
* sysctl is a failsafe API, so it guarantees a result. This
ret = getentropy_sysctl(buf, len);
if (ret != -1)
return (ret);
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
/*
* Entropy collection via /dev/urandom and sysctl have failed.
return -1;
}
-#ifdef CTL_MAXNAME
+#ifdef SYS__sysctl
static int
getentropy_sysctl(void *buf, size_t len)
{
errno = EIO;
return -1;
}
-#endif /* CTL_MAXNAME */
+#endif /* SYS__sysctl */
static int cl[] = {
CLOCK_REALTIME,