Quoting David C. Rankin <drankinatty@suddenlinkmail.com>:
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?
Maybe it's not strictly a function but a macro that's part of some C compiler or preprocessor voodoo. # find /usr/ -name '*.h' -exec grep getrandom \{} \+ /usr/include/asm-arm/unistd.h:#define __NR_getrandom (__NR_SYSCALL_BASE+384) /usr/include/asm-sparc/unistd.h:#define __NR_getrandom 347 /usr/include/linux/random.h: * Flags for getrandom(2) /usr/include/asm-powerpc/unistd.h:#define __NR_getrandom 359 /usr/include/asm-s390/unistd.h:#define __NR_getrandom 349 /usr/include/asm-generic/unistd.h:#define __NR_getrandom 278 /usr/include/asm-generic/unistd.h:__SYSCALL(__NR_getrandom, sys_getrandom) /usr/include/asm-m68k/unistd.h:#define __NR_getrandom 352 /usr/include/asm-microblaze/unistd.h:#define __NR_getrandom 385 /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom /usr/include/bits/syscall.h:#define SYS_getrandom __NR_getrandom /usr/include/asm-x86/unistd_x32.h:#define __NR_getrandom (__X32_SYSCALL_BIT + 318) /usr/include/asm-x86/unistd_64.h:#define __NR_getrandom 318 /usr/include/asm-x86/unistd_32.h:#define __NR_getrandom 355 /usr/include/asm-ia64/unistd.h:#define __NR_getrandom 1339 /usr/include/asm-parisc/unistd.h:#define __NR_getrandom (__NR_Linux + 339) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org