Skip to content

Commit

Permalink
linux-user: Add some random ioctls
Browse files Browse the repository at this point in the history
Signed-off-by: Marco A L Barbosa <malbarbo@gmail.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
malbarbo authored and Michael Tokarev committed Oct 16, 2017
1 parent f3245d6 commit d6d6d6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linux-user/ioctls.h
Expand Up @@ -173,6 +173,11 @@
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(TYPE_INT))
IOCTL(RNDZAPENTCNT, 0, TYPE_NULL)
IOCTL(RNDCLEARPOOL, 0, TYPE_NULL)

IOCTL(CDROMPAUSE, 0, TYPE_NULL)
IOCTL(CDROMSTART, 0, TYPE_NULL)
IOCTL(CDROMSTOP, 0, TYPE_NULL)
Expand Down
1 change: 1 addition & 0 deletions linux-user/syscall.c
Expand Up @@ -59,6 +59,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#include <linux/icmp.h>
#include <linux/icmpv6.h>
#include <linux/errqueue.h>
#include <linux/random.h>
#include "qemu-common.h"
#ifdef CONFIG_TIMERFD
#include <sys/timerfd.h>
Expand Down
7 changes: 7 additions & 0 deletions linux-user/syscall_defs.h
Expand Up @@ -1060,6 +1060,13 @@ struct target_pollfd {

#define TARGET_SIOCGIWNAME 0x8B01 /* get name == wireless protocol */

/* From <linux/random.h> */

#define TARGET_RNDGETENTCNT TARGET_IOR('R', 0x00, int)
#define TARGET_RNDADDTOENTCNT TARGET_IOW('R', 0x01, int)
#define TARGET_RNDZAPENTCNT TARGET_IO('R', 0x04)
#define TARGET_RNDCLEARPOOL TARGET_IO('R', 0x06)

/* From <linux/fs.h> */

#define TARGET_BLKROSET TARGET_IO(0x12,93) /* set device read-only (0 = read-write) */
Expand Down

0 comments on commit d6d6d6f

Please sign in to comment.