sysrand: fix syscall signature [backport] (#19982)

sysrand: fix syscall signature

`syscall` is a `C` varags function
This commit is contained in:
Jacek Sieka 2022-07-07 15:26:58 +02:00 • committed by GitHub
commit ad0aee5354
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,9 +170,8 @@ elif defined(linux) and not defined(nimNoGetRandom) and not defined(emscripten):
const syscallHeader = """#include <unistd.h> const syscallHeader = """#include <unistd.h>
#include <sys/syscall.h>""" #include <sys/syscall.h>"""
proc syscall( proc syscall(n: clong): clong {.
n: clong, buf: pointer, bufLen: cint, flags: cuint importc: "syscall", varargs, header: syscallHeader.}
): clong {.importc: "syscall", header: syscallHeader.}
# When reading from the urandom source (GRND_RANDOM is not set), # When reading from the urandom source (GRND_RANDOM is not set),
# getrandom() will block until the entropy pool has been # getrandom() will block until the entropy pool has been
# initialized (unless the GRND_NONBLOCK flag was specified). If a # initialized (unless the GRND_NONBLOCK flag was specified). If a