On 12/31/2017 7:24 AM, Carlos E. R. wrote:
On Sunday, 2017-12-31 at 02:37 -0600, David C. Rankin wrote:
All,
getrandom() was added with the 3.17 kernel, yet Leap 42.2 does not contain a prototype in /usr/include/linux/random.h and does not include /usr/include/sys/random.h at all. Anybody know why??
kernel source tree installed?
Telcontar:~ # locate random.h ... /usr/include/linux/random.h ... /usr/src/linux-4.4.79-18.23/include/config/arch/random.h /usr/src/linux-4.4.79-18.23/include/config/hw/random.h /usr/src/linux-4.4.79-18.23/include/config/net/team/mode/random.h /usr/src/linux-4.4.79-18.26/include/config/arch/random.h /usr/src/linux-4.4.79-18.26/include/config/hw/random.h /usr/src/linux-4.4.79-18.26/include/config/net/team/mode/random.h /usr/src/linux-4.4.87-18.29/include/config/arch/random.h /usr/src/linux-4.4.87-18.29/include/config/hw/random.h /usr/src/linux-4.4.87-18.29/include/config/net/team/mode/random.h /usr/src/linux-4.4.90-18.32/include/config/arch/random.h /usr/src/linux-4.4.90-18.32/include/config/hw/random.h /usr/src/linux-4.4.90-18.32/include/config/net/team/mode/random.h /usr/src/linux-4.4.92-18.36/arch/powerpc/include/asm/archrandom.h /usr/src/linux-4.4.92-18.36/arch/x86/include/asm/archrandom.h /usr/src/linux-4.4.92-18.36/include/config/arch/random.h /usr/src/linux-4.4.92-18.36/include/config/hw/random.h /usr/src/linux-4.4.92-18.36/include/config/net/team/mode/random.h /usr/src/linux-4.4.92-18.36/include/linux/hw_random.h /usr/src/linux-4.4.92-18.36/include/linux/random.h /usr/src/linux-4.4.92-18.36/include/trace/events/random.h /usr/src/linux-4.4.92-18.36/include/uapi/linux/random.h /usr/src/linux-4.4.92-18.36-obj/x86_64/default/include/config/arch/random.h /usr/src/linux-4.4.92-18.36-obj/x86_64/default/include/config/hw/random.h /usr/src/linux-4.4.92-18.36-obj/x86_64/default/include/config/net/team/mode/random.h
Telcontar:~ # Telcontar:~ # head -20 /usr/include/linux/random.h /* * include/linux/random.h * * Include file for the random number generator. */
#ifndef _LINUX_RANDOM_H #define _LINUX_RANDOM_H
#include <linux/types.h> #include <linux/ioctl.h> #include <linux/irqnr.h>
/* ioctl()'s for the random number generator */
/* Get the entropy count. */ #define RNDGETENTCNT _IOR( 'R', 0x00, int )
/* Add to (or subtract from) the entropy count. (Superuser only.) */ #define RNDADDTOENTCNT _IOW( 'R', 0x01, int ) Telcontar:~ # Telcontar:~ # rpm -qf /usr/include/linux/random.h linux-glibc-devel-4.4-2.15.noarch Telcontar:~ #
Ah, it is from another package.
Yes, yes, I have glibc-devel installed and I have /usr/include/linux/random.h, but notice: it does not contain a prototype for getrandom() that's the funky missing part. With arch, it is now in sys/random.h, but for leap, it should be in linux/random.h -- at least according to the man page on Leap. Checkout man getrandom. Why is the prototype missing? -- David C. Rankin, J.D.,P.E.