On Tue, Jun 28, 2022 at 4:40 PM Waldek Kozaczuk <jwkozac...@gmail.com>
wrote:

> Excellent! Now I can upgrade to Fedora 36 as well.
>
> Do unit tests build and pass as well?
>

I have to admit I didn't check - just getting "make" and "build
image=rogue" (my favorite image :-)) to work took much longer than I
thought it would
(and resulted in over a dozen patch), so I didn't get around to making the
test pass.

I did try "build image=test" but got errors in building Java, which I lost
track on how it's built, so I didn't continue to fix it
(and also didn't try to work around the Java and just try to build the C++
tests).
Maybe if you have time you can try - I'm sure it will be easier for you to
fix the Java problems.


>
> On Sunday, June 26, 2022 at 6:28:34 AM UTC-4 Commit Bot wrote:
>
>> From: Nadav Har'El <n...@scylladb.com>
>> Committer: Nadav Har'El <n...@scylladb.com>
>> Branch: master
>>
>> libc: implement getentropy()
>>
>> Starting in gcc commit
>> https://gcc.gnu.org/g:3439657b02869299685d259c3a77aa38714565b7,
>> libstdc++
>> started to use the getentropy() function, so the OSv kernel cannot be
>> linked without implementing it.
>>
>> It's easy to implement getentropy() by calling getrandom().
>>
>> Musl also has its own getentropy.c but it has a silly compilation error
>> (when len=0, it returns an uninitialized "ret") so let's just write
>> one of our own and later reconsider taking Musl's one.
>>
>> After this patch, OSv can finally build on Fedora 36 with Gcc 12.1.1.
>>
>> Fixes #1198.
>>
>> Signed-off-by: Nadav Har'El <n...@scylladb.com>
>>
>> ---
>> diff --git a/include/api/unistd.h b/include/api/unistd.h
>> --- a/include/api/unistd.h
>> +++ b/include/api/unistd.h
>> @@ -179,6 +179,7 @@ char *getusershell(void);
>> int acct(const char *);
>> long syscall(long, ...);
>> long __syscall(long, ...);
>> +int getentropy(void *, size_t);
>> #endif
>>
>> #ifdef _GNU_SOURCE
>> diff --git a/libc/random.c b/libc/random.c
>> --- a/libc/random.c
>> +++ b/libc/random.c
>> @@ -1,5 +1,6 @@
>> /*
>> * Copyright (C) 2018 Waldemar Kozaczuk
>> + * Copyright (C) 2022 Nadav Har'El
>> *
>> * This work is open source software, licensed under the terms of the
>> * BSD license as described in the LICENSE file in the top-level
>> directory.
>> @@ -49,3 +50,14 @@ ssize_t getrandom(void *buf, size_t count, unsigned
>> int flags)
>> close(fd);
>> return read;
>> }
>> +
>> +int getentropy(void *buf, size_t len)
>> +{
>> + if (len > 256) {
>> + errno = EIO;
>> + return -1;
>> + } else if (len == 0) {
>> + return 0;
>> + }
>> + return getrandom(buf, len, 0) >= 0;
>> +}
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osv-dev/36d2b09a-c689-446e-83c0-1222c6d9bd52n%40googlegroups.com
> <https://groups.google.com/d/msgid/osv-dev/36d2b09a-c689-446e-83c0-1222c6d9bd52n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/CANEVyjuGDdrGhmBJ%3DrMk0ddzssgiX_9eZ5vmJ07bWWTc1TXQ5Q%40mail.gmail.com.

Reply via email to