[systemd-devel] [PATCH] missing: Correct and extend getrandom syscall defines

Cristian Rodríguez crrodriguez at opensuse.org
Wed Oct 29 10:29:10 PDT 2014


Add syscall numbers for 32 bit x86 and arm and Correct
the system call number for x86_64 (it is 318 not 278)
---
 src/shared/missing.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/shared/missing.h b/src/shared/missing.h
index 00e0287..7fd259a 100644
--- a/src/shared/missing.h
+++ b/src/shared/missing.h
@@ -136,7 +136,11 @@ static inline int memfd_create(const char *name, unsigned int flags) {
 
 #ifndef __NR_getrandom
 #  if defined __x86_64__
-#    define __NR_getrandom 278
+#    define __NR_getrandom 318
+#  elif defined __i386__
+#    define __NR_getrandom 355
+#  elif defined __arm__
+#    define __NR_getrandom (__NR_SYSCALL_BASE+384)
 #  else
 #    warning "__NR_getrandom unknown for your architecture"
 #    define __NR_getrandom 0xffffffff
-- 
2.1.2



More information about the systemd-devel mailing list