Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ioctl]

The tag has no usage guidance.

5
votes
1answer
37 views

Get all ioctl code and which module they map

By doc. , ioctl signature is int ioctl(int fd, int request, ...) . request is the code of ioctl. Is there any way to know what are all the possible ioctl request code that available in my linux? And ...
3
votes
1answer
108 views

Why is CAP_NET_ADMIN insufficient permissions for ioctl(TUNSETIFF)?

I'm trying to write a tun/tap program in Rust. Since I don't want it to run as root I've added CAP_NET_ADMIN to the binary's capabilities: $sudo setcap cap_net_admin=eip target/release/tunnel $getcap ...
0
votes
0answers
32 views

Plugging USB causes parallel port to hang

I am developing a parallel port C++ application (on Ubuntu 18.04). Whenever a USB is plugged into the PC while the application is running, it causes one of the following ioctl calls to hang forever. ...
0
votes
1answer
793 views

netcat error: Inappropriate ioctl for device

Im trying to create a 'reverse shell' using a bash oneliner and a netcat listener. This combination worked great a few days ago however now it only gives errors when connection. Does anyone know what ...
2
votes
0answers
372 views

How to prevent DTR on open for cdc_acm?

I have an Arduino Uno attached over USB, using the cdc_acm driver. It is available at /dev/ttyACM0. The convention for the Arduino's serial interface is for the DTR signal to be used for a reset ...
0
votes
1answer
234 views

mapping of ioctl to its definition

The prototype of ioctl in linux driver modules is int ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned long arg); or long ioctl(struct file *f, unsigned int cmd, unsigned long arg);...
0
votes
1answer
2k views

Inappropriate ioctl for device while reading flags on <file>

I am unable to set or view file attributes using lsattr and chattr commands on Reiser File System. Following result is observed: chattr +i Temp.txt chattr: Inappropriate ioctl for device while ...
3
votes
1answer
276 views

What does a rmlint's “clone” for btrfs do?

I was reading the rmlint manual, and one of the duplicate handlers are clone and reflink: · clone: btrfs only. Try to clone both files with the BTRFS_IOC_FILE_EXTENT_SAME ioctl(3p). This will ...
1
vote
0answers
113 views

Max transfer size in SG_IO/SG_ATA_16

I need to pass a direct, raw ATA request to a hard drive (0x25, READ DMA EXT), to disobey max sector count (long story), and to bypass all possible OS caches, buffers, reorderings et al. ...
0
votes
1answer
84 views

How detect playing video by ioctl?

Is it possible to detect video playing by ioctl in linux. Maybe detect decoding of the video file. How about this is working with flash player and html5 video? Can you provide some information how ...
0
votes
1answer
111 views

Why does libdevmapper have data structures?

As I'm looking through libdevmapper.h for clues on how to properly use device mapper ioctls (or potentially use libdevmapper instead), I'm confused as to why there is code in here for creating/...
4
votes
0answers
368 views

Documentation on Device Mapper ioctls?

In the Red Hat documentation on Device Mapper, it reads: "the application interface to the Device Mapper is the ioctl system call." So far, I understand that the ioctls are sent to /dev/mapper/...
2
votes
1answer
860 views

Does keyboard input always go through a controlling terminal?

Am I right that all input typed from the keyboard goes through a controlling terminal? That means that if a program is run without a controlling terminal, it won't be able to receive any user input. ...
5
votes
1answer
1k views

How can I list net work devices and ipv4 address on linux without ifconfig/ip command [duplicate]

I already figured out that on Linux I can list network devices (cd /proc/net/dev_snmp6/ && for device in *; do echo $device; done|sort) but how can I get the ipv4 address of the device? I ...
10
votes
1answer
2k views

Usage difference between device files, ioctl, sysfs, netlink

I'm trying to clarify which is the most useful (in terms of functionality) method of interacting with devices in Linux. As I understand, device files expose only part of functionality (address blocks ...
1
vote
0answers
966 views

how to detect CD physically inserted into drive

How to detect that CD was physically inserted into CD mechanics ASAP? The CD is mounted automatically but it takes like 20 seconds sometimes - and it is just then that I know the CD is inserted.. ...
1
vote
0answers
314 views

Changing readahead value using blockdev command

I am trying to modify read ahead value using blockdev. When I issue this command blockdev --setra xxx /dev/sda - it changes the readahead value of the entire partition in that device, which is fine. ...
10
votes
1answer
7k views

bash: no job control in this shell

I have a minimal Linux system. init is /bin/bash, only bare minimum of libraries in /lib/, /dev/ is populated statically, no daemons running (no udev, ..) When bash starts, I get following error: ...
1
vote
1answer
920 views

HDIO_GETGEO and HDIO_GET_IDENTITY in Linux using C++

Can anyone explain the core difference between HDIO_GETGEO and HDIO_GET_IDENTITY? From the Linux documentation and this document titled: Summary of HDIO_ ioctl calls., I know that the former is for ...
8
votes
1answer
9k views

Is it possible to get network interface index not via /sys?

So what I'm looking for is an interface index (or name) but the real one. if_nametoindex(3) and ioctl(2) don't seem to help me here. Now the only way I found how to do this is via /sys. Let me ...
6
votes
1answer
5k views

GNU/Linux: “device mapper: create ioctl failed” “device or resource busy”

I can't mount my encrypted devices anymore. The error is: device mapper: create ioctl failed device or resource busy This error arises both with two different programs to access TrueCrypt ...
2
votes
0answers
342 views

How do I assign the controlling terminal to other process?

I use TIOCSCTTY to forcibly take over the controlling terminal in other "remote" application. But after the application finishes running, controlling terminal gets orphaned and bash stops reacting to ...
5
votes
1answer
4k views

Where do I find ioctl EVIOCGRAB documented?

I want to use the ioctl EVIOCGRAB function in a C based program, and from googling around I have found various bits of example source code that use the function, but I am struggling to find explicit ...