Quantcast
Channel: Active questions tagged ioctl - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 31 View Live

Linux ioctl VT_GETSTATE fails if process is run manually

I'm using the ioctl syscall on Linux to get the current tty in a C program.I don't know why the ioctl fails if the program is run manually (as root) while it works as expected if the init.d script is...

View Article



Is it possible to access AES key of Self-encrypting drives (SEDs) in userspace?

In AES Hardware Encryption, is it possible to send or access AES key to and from hardware to userspace/software? Is there an available IOCTL for this?

View Article

device-mapper: reload ioctl on osprober-linux-nvme0n1p7 failed: Device or...

I ran into the error device-mapper: reload ioctl on osprober-linux-nvme0n1p7 failed: Device or resource busy while compiling the kernel in Ubuntu Studio. I use ZFS for my main drive. Apparently, this...

View Article

How can I run a program in its own tty?

I'm messing with TIOCSTI which shoves data into the terminal's input buffer. I want to be able to capture this data before it arrives at the shell or redirects it to a file.To better illustrate what...

View Article

Does BTRFS support the ioctl(fd, FIFREEZE) system call?

the manpage of fsfreeze states:FSFREEZE(8) System Administration FSFREEZE(8) NAME fsfreeze - suspend access to a filesystem (Ext3/4, ReiserFS, JFS, XFS)Which leaves me puzzled with regards if BTRFS is...

View Article


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...

View Article

What could go wrong with sending input to /dev/tty?

My setup entails sending inputs to another terminal program running Bash in the same machine and same X session. I'm using ttyecho for that which, to put it short, sends input to /dev/tty/[id],...

View Article

How is ioctl handled in Linux?

When I trigger ioctl. Does linux just call ioctl from some fops struct, or does it do something more (handle some basic operations). I think I heard this once, but there is little information about...

View Article


Set can baudrate with ioctl or similar from C/C++

I'm currently setting the baudrate of my can0 with ip link:/sbin/ip link set can0 up type can bitrate 250000I'm just wondering how to do the same from within C/C++?

View Article


Is socket sys (libc) function supposed to always return the same result for...

I am writing a C# app that basically does a similar job that iwlist.I am having trouble, though, in porting the IOCTL calls into .NET. I mean, the interop code I have written so far (to enable my .NET...

View Article

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...

View Article

Is there any way to change the I2C slave device address on a Linux board?

Aim: setAddress in i2c Slave Devices software side.example :3 sensor with same address 0x29. through some method sensor1 to set 0x22, sensor2 to set 0x25, sersor3 to set 0x28.info:I have 3 similar...

View Article

FIDEDUPERANGE ioctl doesn't behave as expected on btrfs

According to ioctl_fideduperange,The maximum size of src_length is filesystem dependentand is typically 16 MiB.However, I've been able use src_length of > 1 Gib successfully with a single call to...

View Article


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...

View Article

Efficiently disable fs-verity on large files

If the FS_IOC_ENABLE_VERITY ioctl was used to enable fs-verity on a file (e.g., with the fsverity enable command), and then I want to write to that file again, how can I disable fs-verity on it? Right...

View Article


Not understanding the use of EVIOCGRAB for touchscreen devices

I am looking at a userspace library which handles touchscreen events from the Linux kernel.The following line of code, I can't understand what it does. What is the purpose of EVIOCGRAB when passed to...

View Article

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 busyThis error arises both with two different programs to access TrueCrypt encrypted...

View Article


ioctl SIOCGIWSTATS signal level constantly 0

I have a block of C code that gets a variety of information about a network interface, namely the SSID and the signal level in dBm:#include <ctype.h>#include <errno.h>#include...

View Article

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...

View Article

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...

View Article

Are ioctl calls blocking?

I am writing some code around libgpiod's interface. For example, I want to set a line to output high. Under the hood, libgpiod opens an fd provided by the kernel for the line, and then calls ioctl(fd,...

View Article


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.Thanksstrace...

View Article


Any tool to do ioctl() from bash?

I try to make an ioctl() call from bash. This is very easy to do in C, so there are tools ( https://github.com/jerome-pouiller/ioctl ) which wrap this functionality.But it would make the distribution...

View Article

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 list,...

View Article

Errors when trying to bring ethernet interface up on embedded Linux

I am trying to compile the Linux kernel (3.0.8, buildroot-gcc-12.3.0, ARMv7) to run on my IP camera.eth0 is not able to get up.At first, kernel boot just crashed at Starting network step:Unable to...

View Article


Non-root access to a wifi adapter via ioctl in Linux app - how to grant?

I'm trying to debug a Qt5 c app in Ubuntu 20.04 on Odroid board. The app communicates with wifi adapter via ioctl(), eg:int fd = iw_sockets_open();struct ifreq ifreq;//ifreq.ifr_name holds...

View Article

Can I trigger an auto-negotiation of an interface using the ethtool userspace...

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 ethtoolsource code and I found that they use IOCTL sockets and...

View Article

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...

View Article

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:bash:...

View Article



How does the Linux Kernel store hardware TX and RX filter modes?

I am working on a C program which gets the timestamping information for a given network interface, like my own version of ethtool. My goal is to get the information printed by $ ethtool -T myNetIf....

View Article
Browsing latest articles
Browse All 31 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>