Questions tagged [ioctl]
The ioctl tag has no summary.
53 questions
2 votes
1 answer
271 views
What is holding a file descriptor to this block device aka why didn't losetup -d remove a block device
There's a number of posts about losetup -d /dev/loop0 not removing a lookback device, even though it returned a successful return code. I believe the root cause of those posts is that the block device ...
0 votes
1 answer
174 views
Why does running "amidi -l" produce an error message that says "Inappropriate ioctl for device"?
When I run amidi -l on my Thinkpad X1 Carbon (Generation 5) running Manjaro Linux, instead of no device info appearing in the output (which I'd expect since no MIDI hardware devices are connected) I ...
1 vote
1 answer
517 views
Can I trigger an auto-negotiation of an interface using the ethtool userspace API with NETLINK sockets?
I would like to replicate the behavior of ethtool -r when auto-negotiation is active in my C++ code with NETLINK sockets. I search the CLI ethtool source code and I found that they use IOCTL sockets ...
0 votes
0 answers
214 views
What is the right usage of SIOCGIWSCAN to scan WIFI AP?
I am working on an embedded Linux system (kernel 5.10.24), there is a WLAN interface in the system. Now I want to scan the nearby AP, I think I can use socket and SIOCGIWSCAN command to get the AP ...
0 votes
2 answers
138 views
uname: what ioctl does it use?
Does anyone know if uname() makes an ioctl() call directly or indirectly? I reviewed the source, however didn't see that it does. I also used strace and did not see the kernel call made. Thanks ...
1 vote
1 answer
304 views
Is there ever a reason to query ioctl for hardware info when we have sysfs?
My assumption is that sysfs is built using ioctl queries, meaning all the information you would want (or at least most of it) is already available by simply reading files on sysfs. I notice some ...
-3 votes
1 answer
667 views
Reparenting a process
I create a Linux Kernel Module and I try to find a way to re-parent a given process or change a given process PID. Is there any way of doing that? I found the following link but I could not make it ...
0 votes
2 answers
1k views
Two different function prototypes for Linux kernel module ioctl
As pointed out in this question, the prototype for the ioctl function inside a Linux kernel module is: (version 1) int ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned long arg); or (...