[opensuse] Why is Leap 42.2 missing /usr/include/sys/random.h?? (and no getrandom in linux/random.h)
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?? -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 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. - -- Cheers, Carlos E. R. (from openSUSE 42.2 x86_64 "Malachite" at Telcontar) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlpI5PsACgkQtTMYHG2NR9VLKQCgh+tPloL1+rPfDypJce5xg+s9 Q2IAnRkZXaOOO6RKiJ+nInHHeydiZYYN =vxep -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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.
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
On 01/01/2018 01:16, David C. Rankin wrote:
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?
Just had a look on my 42.3 system, man getrandom bring up the man page and gives prototype int getrandom(void *buf, size_t buflen, unsigned int flags); and clearly states "#include <linux/random.h>" find finds: /usr/include/linux/random.h and rpm says that it comes from: linux-glibc-devel-4.4-5.4.noarch and the man page comes from man-pages-4.02-9.4.noarch but grepping /usr/include/linux/random.h for getrandom only brings up * Flags for getrandom(2) I smell a bug, definitely in the man page but more important in the missing getrandom prototype. Have a look at the Arch man page, maybe that will give a clue as to where it's disappeared to. Happy New Year Dave P -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/01/2018 01:16, David C. Rankin wrote:
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 this link explains something: https://stackoverflow.com/questions/45237324/why-doesnt-getrandom-compile Dave P -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 01/01/2018 02:13 AM, Dave Plater wrote:
Why is the prototype missing?
Maybe this link explains something: https://stackoverflow.com/questions/45237324/why-doesnt-getrandom-compile Dave P
Yes, that indeed does provide a hint that something is in fact missing from linux/random.h and howto workaround the problem, but is this a BUG? Why on earth would we have a man page for getrandom(), but then the implementation is actually missing from the stated header? The quote: "It appears that some Linux systems have a man page for getrandom and the correct syscall definitions, but no C function." doesn't quite answer that question. To me, is looks like a bug, walks like a bug and quacks like a bug.... that leaves you either (1) implementing the workaround function, (2) drawing from /dev/urandom, or (3) polling /dev/random -- all of which the getrandom() function was implemented to avoid having to do :( -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/01/2018 03:51, David C. Rankin wrote:
On 01/01/2018 02:13 AM, Dave Plater wrote:
Why is the prototype missing?
Maybe this link explains something: https://stackoverflow.com/questions/45237324/why-doesnt-getrandom-compile Dave P
Yes, that indeed does provide a hint that something is in fact missing from linux/random.h and howto workaround the problem, but is this a BUG?
Why on earth would we have a man page for getrandom(), but then the implementation is actually missing from the stated header?
The quote:
"It appears that some Linux systems have a man page for getrandom and the correct syscall definitions, but no C function."
doesn't quite answer that question. To me, is looks like a bug, walks like a bug and quacks like a bug.... that leaves you either (1) implementing the workaround function, (2) drawing from /dev/urandom, or (3) polling /dev/random -- all of which the getrandom() function was implemented to avoid having to do :(
It is indeed a bug but the question is, is it a kernel bug or is it a glibc bug or is it only a man pages bug? Dave P -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
01.01.2018 02:16, David C. Rankin пишет:
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()
This is kernel header, why should it contain user-space prototypes.
that's the funky missing part. With arch, it is now in sys/random.h, but
Compare glibc versions.
for leap, it should be in linux/random.h -- at least according to the man page on Leap. Checkout man getrandom.
man page is completely independent of either kernel or glibc. And this is already fixed in actual man-pages.
Why is the prototype missing?
Because it has never been in this file in the first place and glibc in Leap is too old to provide another file.
On 01/01/2018 02:42 AM, Andrei Borzenkov wrote:
Why is the prototype missing? =20 =20
Because it has never been in this file in the first place and glibc in Leap is too old to provide another file.
Andrei, I completely disagree. getrandom() is a user-space function. If it wasn't fixed in Leap 42.3 by implementing the prototype in linux/random.h, then it was not fixed correctly. -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Quoting David C. Rankin <drankinatty@suddenlinkmail.com>:
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??
# rpm -qf /usr/include/linux/random.h linux-glibc-devel-4.4-2.15.noarch -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Andrei Borzenkov
-
Carlos E. R.
-
Dave Plater
-
David C. Rankin
-
Jeffrey L. Taylor