[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH] linux-user: Add random ioctls
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-trivial] [PATCH] linux-user: Add random ioctls |
Date: |
Thu, 5 Oct 2017 09:12:21 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 05/10/2017 00:06, Marco A L Barbosa wrote:
> I don't know how (and if it is necessary) to add buf field to
> rand_pool_info struct. See
> https://github.com/torvalds/linux/blob/5924bbecd0267d87c24110cbe2041b5075173a25/include/uapi/linux/random.h#L17
I doesn't look really trivial...
To manage the buf field you must read buf_size and it cannot be done in
a generic way: you must define a function to translate the buffer, use
IOCTL_SPECIAL() with RNDADDENTROPY and RNDGETPOOL.
You should send your patch using "git send-email" or "git publish"
instead of adding it in you email client.
> Signed-off-by: Marco A L Barbosa <address@hidden
> <mailto:address@hidden>>
> ---
> linux-user/ioctls.h | 7 +++++++
> linux-user/syscall.c | 1 +
> linux-user/syscall_defs.h | 9 +++++++++
> linux-user/syscall_types.h | 4 ++++
> 4 files changed, 21 insertions(+)
>
> diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
> index e6997ff230..9240a83f30 100644
> --- a/linux-user/ioctls.h
> +++ b/linux-user/ioctls.h
> @@ -173,6 +173,13 @@
> IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
> IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
>
> + IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
> + IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rand_pool_info)))
..., MK_PTR(TYPE_INT)
> + IOCTL(RNDGETPOOL, IOC_R, MK_PTR(TYPE_INT))
... MK_PTR(MK_STRUCT(STRUCT_rand_pool_info))
Thanks,
Laurent