mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
Use Genode::size_t in rumpuser_getrandom_backend()
This streamlines the Genode-specific interface for both 32-bit and 64-bit architectures and fixes dynamic-linking issue with the rump VFS due to differing size_t types.
This commit is contained in:
parent
eb869ab2dc
commit
f1c877f205
@ -16,6 +16,6 @@
|
||||
|
||||
#include <base/stdint.h>
|
||||
|
||||
int rumpuser_getrandom_backend(void *buf, Genode::size_t buflen, int flags, __SIZE_TYPE__ *retp);
|
||||
int rumpuser_getrandom_backend(void *buf, Genode::size_t buflen, int flags, Genode::size_t *retp);
|
||||
|
||||
#endif /* _INCLUDE__UTIL__RANDOM_H_ */
|
||||
|
@ -60,12 +60,11 @@ append config {
|
||||
<start name="test-libc_vfs">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log">
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<rump fs="ext2fs" writeable="yes"/>
|
||||
</vfs>
|
||||
</libc>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<rump fs="ext2fs" writeable="yes"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>}
|
||||
|
@ -69,12 +69,11 @@ append config {
|
||||
<start name="test-libc_vfs">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log">
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<fs/>
|
||||
</vfs>
|
||||
</libc>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<fs/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>}
|
||||
|
@ -318,9 +318,14 @@ int rumpuser_clock_sleep(int enum_rumpclock, int64_t sec, long nsec)
|
||||
** Random pool **
|
||||
*****************/
|
||||
|
||||
int rumpuser_getrandom(void *buf, size_t buflen, int flags, __SIZE_TYPE__ *retp)
|
||||
int rumpuser_getrandom(void *buf, size_t buflen, int flags, size_t *retp)
|
||||
{
|
||||
return rumpuser_getrandom_backend(buf, buflen, flags, retp);
|
||||
/*
|
||||
* Cast retp to Genode::size_t to prevent compiler error because
|
||||
* the type of rump's size_t is int on 32 bit and long 64 bit archs.
|
||||
*/
|
||||
return rumpuser_getrandom_backend(buf, buflen, flags,
|
||||
(Genode::size_t *)retp);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,9 +56,8 @@ struct Entropy
|
||||
};
|
||||
|
||||
|
||||
int rumpuser_getrandom_backend(void *buf, size_t buflen, int flags, __SIZE_TYPE__ *retp)
|
||||
int rumpuser_getrandom_backend(void *buf, size_t buflen, int flags, Genode::size_t *retp)
|
||||
{
|
||||
*retp = Entropy::e()->read((char *)buf, buflen);
|
||||
*retp = buflen;
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <util/random.h>
|
||||
|
||||
|
||||
int rumpuser_getrandom_backend(void *buf, Genode::size_t buflen, int flags, __SIZE_TYPE__ *retp)
|
||||
int rumpuser_getrandom_backend(void *buf, Genode::size_t buflen, int flags, Genode::size_t *retp)
|
||||
{
|
||||
*retp = buflen;
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user