summaryrefslogtreecommitdiff
path: root/linux-user/ioctls.h
AgeCommit message (Collapse)AuthorFilesLines
2014-02-19linux-user: Implement BLKPG ioctlAndreas Färber1-0/+1
Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-09-24linux-user: allow use of TIOCGSIDLaurent Vivier1-0/+1
Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2013-07-05linux-user: add SIOCADDRT/SIOCDELRT supportLaurent Vivier1-2/+4
This allows to pass the device name. You can test this with the "route" command. WITHOUT this patch: $ sudo route add -net default gw 10.0.3.1 eth0 SIOCADDRT: Bad address $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Ifa 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth WITH this patch: $ sudo route add -net default gw 10.0.3.1 eth0 $ netstat -nr Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Ifa 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 0 0 eth 10.0.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitionsPeter Maydell1-2/+2
Fix the SNDCTL_DSP_MAP{IN,OUT}BUF ioctl definitions so that they refer to a suitably defined target struct layout rather than hardcoding the ioctl number. This fixes complaints from the syscall_init() consistency check when running an x86_64-to-x86_64 linux-user qemu. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-04-06linux-user: Add ioctl for BLKBSZGETAlexander Graf1-0/+1
This patch adds the ioctl wrapper definition for BLKBSZGET. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2012-04-06linux-user: add BLKSSZGET ioctl wrapperAlexander Graf1-0/+1
This patch adds an ioctl definition for BLKSSZGET. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2012-04-06linux-user: implement device mapper ioctlsAlexander Graf1-0/+32
This patch implements all ioctls currently implemented by device mapper, enabling us to run dmsetup and kpartx inside of linux-user. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for even more FB ioctlsCédric VINCENT1-0/+5
This patch was validated with programs from DirectFB-1.0 and WebKit/DirectFB. Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for more VT ioctlsCédric VINCENT1-0/+4
DirectFB-1.0 uses at least two of the four added ioctls, and the two others were added for completeness. This patch was validated with the program "vlock -all/-new". Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-07-11linux-user: Add support for KD...LED ioctlsCédric VINCENT1-0/+4
DirectFB-1.0 uses at least one of the four added ioctls, and the three others were added for completeness. This patch was validated with the program "setleds" and the following Makefile: SETLEDS_INIT = setleds -v -num -caps -scroll SETLEDS_TESTS = sh -c ' \ setleds -v +num +caps +scroll; \ setleds -v -num -caps -scroll; \ setleds -v +num -caps -scroll; \ setleds -v +num +caps -scroll; \ setleds -v +num +caps +scroll; \ setleds -v -num +caps +scroll; \ setleds -v -num -caps +scroll; \ setleds -v -num -caps -scroll' SETLEDS_HOST = setleds SETLEDS_QEMU = "SETLEDS_QEMU not set" .PHONY: setleds_tests setleds_tests: rm -f setleds.host setleds.target $(SETLEDS_INIT:setleds=$(SETLEDS_HOST)) $(SETLEDS_TESTS:setleds=$(SETLEDS_HOST)) >> setleds.host $(SETLEDS_INIT:setleds=$(SETLEDS_QEMU)) $(SETLEDS_TESTS:setleds=$(SETLEDS_QEMU)) >> setleds.target cmp setleds.host setleds.target Signed-off-by: Cédric VINCENT <cedric.vincent@st.com> Cc: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
2011-04-26linux-user: add ioctl(SIOCGIWNAME, ...) support.Laurent Vivier1-0/+1
Allow to run properly following program from linux-user: /* cc -o wifi wifi.c */ #include <stdio.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> #include <linux/wireless.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> int main(int argc, char **argv) { int ret; struct ifreq req; struct sockaddr_in *addr; int s; if (argc != 2) { fprintf(stderr, "Need an interface name (like wlan0)\n"); return 1; } s = socket( AF_INET, SOCK_DGRAM, 0 ); if (s < 0) { perror("Cannot open socket"); return 1; } strncpy(req.ifr_name, argv[1], sizeof(req.ifr_name)); ret = ioctl( s, SIOCGIWNAME, &req ); if (ret < 0) { fprintf(stderr, "No wireless extension\n"); return 1; } printf("%s\n", req.ifr_name); printf("%s\n", req.ifr_newname); return 0; } $ ./wifi eth0 No wireless extension $ ./wifi wlan0 wlan0 IEEE 802.11bg Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-04-26linux-user: convert ioctl(SIOCGIFCONF, ...) result.Laurent Vivier1-1/+2
The result needs to be converted as it is stored in an array of struct ifreq and sizeof(struct ifreq) differs according to target and host alignment rules. This patch allows to execute correctly the following program on arm and m68k: #include <stdio.h> #include <sys/ioctl.h> #include <net/if.h> #include <alloca.h> #include <string.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int main(void) { int s, ret; struct ifconf ifc; int i; memset( &ifc, 0, sizeof( struct ifconf ) ); ifc.ifc_len = 8 * sizeof(struct ifreq); ifc.ifc_buf = alloca(ifc.ifc_len); s = socket( AF_INET, SOCK_DGRAM, 0 ); if (s < 0) { perror("Cannot open socket"); return 1; } ret = ioctl( s, SIOCGIFCONF, &ifc ); if (s < 0) { perror("ioctl() failed"); return 1; } for (i = 0; i < ifc.ifc_len / sizeof(struct ifreq) ; i ++) { struct sockaddr_in *s; s = (struct sockaddr_in*)&ifc.ifc_req[i].ifr_addr; printf("%s\n", ifc.ifc_req[i].ifr_name); printf("%s\n", inet_ntoa(s->sin_addr)); } } Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2011-02-09linux-user: fix for loopmount ioctlMartin Mohring1-2/+0
In case a chrooted build uses XEN or KVM, a looped mount needs to be done to setup the chroot. The ioctl for loop mount works correctly for arm, mips, ppc32 and sh4, so its now activated. Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
2011-01-12linux-user: Add configure check for linux/fiemap.h and IOC_FS_FIEMAPPeter Maydell1-1/+1
Add a configure check for the existence of linux/fiemap.h and the IOC_FS_FIEMAP ioctl. This fixes a compilation failure on Linux systems which don't have that header file. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-01-07linux-user: Implement FS_IOC_FIEMAP ioctlPeter Maydell1-0/+4
Implement the FS_IOC_FIEMAP ioctl using the new support for custom handling of ioctls; this is needed because the struct that is passed includes a variable-length array. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2009-10-17linux-user: KD/VT/FB ioctlsUlrich Hecht1-0/+14
everything needed to run SDL on a framebuffer device in the userspace emulator Signed-off-by: Ulrich Hecht <uli@suse.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
2008-09-20Add MTIOCTOP, MTIOCGET and MTIOCPOS ioctls (Kirill Shutemov).balrog1-0/+4
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5271 c046a42c-6fe2-441c-8c8c-71466251a162
2008-04-26Add loop device ioctls (Gary Thomas).balrog1-0/+10
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4257 c046a42c-6fe2-441c-8c8c-71466251a162
2006-03-25Avoid accessing guest memory directly in usermode emulation.pbrook1-1/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1790 c046a42c-6fe2-441c-8c8c-71466251a162
2003-06-15factorized more definitions - suppressed broken sound ioctlsbellard1-4/+8
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@241 c046a42c-6fe2-441c-8c8c-71466251a162
2003-05-10more console ioctlsbellard1-1/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@139 c046a42c-6fe2-441c-8c8c-71466251a162
2003-05-08added KDGKBTYPEbellard1-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@132 c046a42c-6fe2-441c-8c8c-71466251a162
2003-04-10TIOCGPTN and TIOCSPTLCK ioctlsbellard1-0/+2
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@90 c046a42c-6fe2-441c-8c8c-71466251a162
2003-03-30added SIOCATMARK and times() syscallbellard1-0/+1
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@70 c046a42c-6fe2-441c-8c8c-71466251a162
2003-03-23better signal/exception supportbellard1-1/+5
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@42 c046a42c-6fe2-441c-8c8c-71466251a162
2003-03-16added loop/xadd/cmpxchg supportbellard1-0/+3
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@29 c046a42c-6fe2-441c-8c8c-71466251a162
2003-02-18This commit was generated by cvs2svn to compensate for changes in r2,bellard1-0/+282
which included commits to RCS files with non-trunk default branches. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3 c046a42c-6fe2-441c-8c8c-71466251a162