summary refs log tree commit diff stats
path: root/lib/std/sysrand.nim
diff options
context:
space:
mode:
authorJacek Sieka <arnetheduck@gmail.com>2022-07-07 15:26:58 +0200
committerGitHub <noreply@github.com>2022-07-07 21:26:58 +0800
commitad0aee535435ac9b22c2ee9ef02085ffdc901d48 (patch)
tree33568880e968fbbbf7fdab9e43390004cc38fe7d /lib/std/sysrand.nim
parentdcb28fd061743ba141b3914501512b5eb352aa1b (diff)
downloadNim-ad0aee535435ac9b22c2ee9ef02085ffdc901d48.tar.gz
sysrand: fix syscall signature [backport] (#19982)
sysrand: fix syscall signature

`syscall` is a `C` varags function
Diffstat (limited to 'lib/std/sysrand.nim')
-rw-r--r--lib/std/sysrand.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/std/sysrand.nim b/lib/std/sysrand.nim
index 1b7b2c024..4ee25d01e 100644
--- a/lib/std/sysrand.nim
+++ b/lib/std/sysrand.nim
@@ -170,9 +170,8 @@ elif defined(linux) and not defined(nimNoGetRandom) and not defined(emscripten):
   const syscallHeader = """#include <unistd.h>
 #include <sys/syscall.h>"""
 
-  proc syscall(
-    n: clong, buf: pointer, bufLen: cint, flags: cuint
-  ): clong {.importc: "syscall", header: syscallHeader.}
+  proc syscall(n: clong): clong {.
+      importc: "syscall", varargs, header: syscallHeader.}
     #  When reading from the urandom source (GRND_RANDOM is not set),
     #  getrandom() will block until the entropy pool has been
     #  initialized (unless the GRND_NONBLOCK flag was specified).  If a
@@ -211,7 +210,7 @@ elif defined(zephyr):
   proc sys_csrand_get(dst: pointer, length: csize_t): cint {.importc: "sys_csrand_get", header: "<random/rand32.h>".}
     # Fill the destination buffer with cryptographically secure
     # random data values
-    # 
+    #
 
   proc getRandomImpl(p: pointer, size: int): int {.inline.} =
     # 0 if success, -EIO if entropy reseed error