From: ori@eigenstate.org
To: 9front@9front.org
Subject: Re: [9front] tlsclient and hjgit for unix.
Date: Sat, 20 Feb 2021 16:24:50 -0800 [thread overview]
Message-ID: <39A9B17D51CA53B178DD683DA5835699@eigenstate.org> (raw)
In-Reply-To: <C2ADAC79F4EF8B5CF7DCF89F054AE55E@5ess.inri.net>
Quoth sl@stanleylieber.com:
> awesome! i have immediate use for this.
>
> on openbsd, build dies here:
>
> gcc -Wall -Wno-missing-braces -Wno-parentheses -ggdb -I.. -I../include -c -D_THREAD_SAFE -O2 -c genrandom.c
> genrandom.c:6:24: error: sys/random.h: No such file or directory
> genrandom.c: In function 'genrandom':
> genrandom.c:11: warning: implicit declaration of function 'getrandom'
> *** Error 1 in libc (<sys.mk>:87 'genrandom.o')
> *** Error 2 in /home/sl/src/tlsclient (Makefile:34 'libc/libc.a')
>
> sl
Give this a shot.
It should work at least on FreeBSD, OpenBSD, and Ubuntu.
diff --git a/libc/genrandom.c b/libc/genrandom.c
index 42522aa..890c291 100644
--- a/libc/genrandom.c
+++ b/libc/genrandom.c
@@ -3,10 +3,10 @@
#undef long
#undef ulong
-#include <sys/random.h>
+#include <unistd.h>
void
genrandom(uchar *buf, int nbytes)
{
- getrandom(buf, nbytes, 0);
+ getentropy(buf, nbytes);
}
next prev parent reply other threads:[~2021-02-21 0:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-20 22:32 Jacob Moody
2021-02-20 23:39 ` sl
2021-02-21 0:24 ` ori [this message]
2021-02-21 1:39 ` Stanley Lieber
2021-02-21 2:43 ` Jacob Moody
2021-02-21 9:49 ` J D
2021-02-21 16:01 ` Stanley Lieber
2021-02-21 2:23 ` ori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39A9B17D51CA53B178DD683DA5835699@eigenstate.org \
--to=ori@eigenstate.org \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).