[libc-commits] [PATCH] D134665: Implement `getrandom` function for linux targets.

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Oct 7 15:30:02 PDT 2022


michaelrj added a comment.

I've left two comments for things to fix, and once you fix those I'll approve the patch and one of us will land it.



================
Comment at: libc/spec/linux.td:132
     Errno,
     SysMMan,
     Signal,
----------------
you need to add `SysRandom` to this list, preferably right after `SysMMan`.


================
Comment at: libc/src/sys/random/linux/getrandom.cpp:21
+                   (void *buf, size_t buflen, unsigned int flags)) {
+  long ret = __llvm_libc::syscall(SYS_getrandom, buf, buflen, flags);
+  if (ret < 0) {
----------------
this needs to be `syscall_impl`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134665/new/

https://reviews.llvm.org/D134665



More information about the libc-commits mailing list