Questions tagged [ioctl]

ioctl (Input Output ConTroL) is a system call for device-specific I/O operations and other operations which cannot be expressed by regular system calls and it provides an interface through which an application can communicate directly with a device driver(or any other global kernel space variables). Applications can use the standard control codes or device-specific control codes to perform direct input and output operations.

691 questions
0
votes
0 answers

ioctl to detect a disc in upside direction

I am trying to find whether a disc is inverted in upside direction, or there is no disc.Till now I am getting NO_DISC even when I am inserting a disc in Upside direction.Please anyone tell me if there is any possible ioctl available through which I…
Sanjeev Kumar
  • 55
  • 1
  • 9
0
votes
1 answer

ioctl HDIO_GET_IDENTITY fails on USB storage devices

I am trying to get the identity of a USB Hard Drive connected through a SATA-to-USB adapter. The little program I wrote is in Python and uses this: def getID(dev): HDIO_GET_IDENTITY = 0x030d with open(dev, 'r') as fd: buf =…
dragosmc
  • 11
  • 1
0
votes
1 answer

ipadm show-addr on Solaris shows ? in the interface description

I tried to plumb an IP address on an IPMP interface using the below sample code, the interface gets plumbed correctly (correct output in ifconfig -a). But running just the "ipadm" command does not show the plumbed interface and the running "ipadm…
ktime
  • 63
  • 13
0
votes
3 answers

ioctl TIOCGWINSZ in GNAT Ada returns errno 25, but C program work fine

On Mac OS X 10.9.5... I'm tryng to get screen size using ioctl C-function #include #include int main(int argc, char **argv) { struct winsize sz; ioctl(0, TIOCGWINSZ, &sz); printf("Screen width: %i Screen height:…
drblez
  • 11
  • 2
0
votes
1 answer

Docker daemon on Debian 7 returns "inappropriate ioctl for device"

I just installed Docker on my Debian 7 system according to this guide. When trying to start the Docker daemon via docker -d, I receive the following output: INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] WARNING: You are running…
magic_al
  • 1,930
  • 1
  • 18
  • 26
0
votes
2 answers

What's the best way to spy on IOCTLs?

I have a U9 Telit modem which, at first, appears as a disk drive on USB bus. Then, the native software after autorun and install, sends a couple of IOCTLs to tell the device to reappear as other things. I can see them in procmon. I want to better…
Pavel Radzivilovsky
  • 18,794
  • 5
  • 57
  • 67
0
votes
0 answers

Setting private ioctls without iwpriv

I need to write function that will set private ioctls such as: iwpriv wlan5 p2p_set enable=0 iwpriv wlan0 p2p_set intent=1 I found in this code function which set integer private ioctls, so I tried to modify it but I have yet a poor understanding…
trivelt
  • 1,913
  • 3
  • 22
  • 44
0
votes
0 answers

how to attach to a TAP interface from two different processes

I have a tap interface created like this: ip tuntap add dev tap0 mode tap user myusername ip link set tap0 up I then attach to tap0 using python and another program written in C++ Python: def tapAlloc(tapname, mode): tap =…
brainydexter
  • 19,826
  • 28
  • 77
  • 115
0
votes
0 answers

mount error in android terminal emulator: ioctl loop_set_fd failed device or resource busy

I am using PuTTY to open up a SSH terminal to my Android phone which has BusyBox 1.21.1 installed. I was trying to mount an ISO image with the following command in the terminal, mind the fact that I was already in superuser mode and my phone is…
saishme
  • 51
  • 1
  • 1
  • 7
0
votes
1 answer

framebuffer output graphic tearing, FBIO_WAITFORVSYNC and FBIOPAN_DISPLAY failed

the question is about linux framebuffer, the graphic is tearing. recently i work for the output desktop to SDI graphic card, then i catch the idea that using framebuffer. That's ok, it output success, but it has a big problem, the graphic is…
SimpleDrunk
  • 1
  • 1
  • 4
0
votes
1 answer

How are ioctl() and/or fcntl() used for writing a non-blocking socket?

I am trying to learn how to write a non-blocking socket. Can anyone please explain that what roles do ioctl() and fcntl() play in this (i.e. what are the roles of file descriptors in creating a non-blocking socket. A code snippet as an example with…
Mac
  • 3
  • 3
0
votes
2 answers

ioct multiple arguments passing

I try to pass two arguments from user space program to change a buffer size and number of buffer on char device. I tried multiple cast I get always cast errors error: cannot convert to a pointer type copy_from_user((char *)msg, arg,…
user2948075
0
votes
0 answers

copy_from_user() failed for intel x-86 processor but execute fine to ppc e500 processor

I am working on Linux Kernel Usrspace and Kernel space communication, I am using two target boards, 1) Board with PPC -e500 processor 2) Board with intel x-86 processor Following peace of code working on e500 processor but same code is giving…
0
votes
1 answer

ioctl call program compiling error

I want to call kernel module driver.ko ioctl from user space with c program. when compiling I got this error header.h:13:38: error: expected expression before ‘char’ #define IOCTL_CMD _IORW(MAGIC_NO, 0, char *) by definition I put the right…
user2948075
0
votes
2 answers

Is possible to check rights to ioctl

I'm writing network configuring system for embedded device, which uses ioctl calls. On starting system I need to check rights to future calls. Is possible to check enough or have not enough privileges to ioctl(ID) call without calling that ioctl?
Dcow
  • 1,413
  • 1
  • 19
  • 42