jerome-pouiller / ioctl Goto Github PK
View Code? Open in Web Editor NEWThe missing tool to call arbitrary ioctls on devices
License: GNU General Public License v2.0
The missing tool to call arbitrary ioctls on devices
License: GNU General Public License v2.0
During compilation:
$ make
gcc -Wall -c -MMD -c -o ioctls_list.o ioctls_list.c
ioctls_list.c:66:10: fatal error: linux/gigaset_dev.h: No such file or directory
66 | #include <linux/gigaset_dev.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:22: ioctls_list.o] Error 1
Hi,
I have a small feature request: It would be helpful if one could specify the ioctl in it's raw (unencoded) form, i.e., like ./ioctl /dev/mydev dir=2,type=1,nr=0,size=4
. This tool then just has to assemble it using the macro _IOC
from ioctl.h
:
#define _IOC(dir,type,nr,size) \
(((dir) << _IOC_DIRSHIFT) | \
((type) << _IOC_TYPESHIFT) | \
((nr) << _IOC_NRSHIFT) | \
((size) << _IOC_SIZESHIFT))
Jérôme, I know you've heard of Android's ioctl tool.
Here is the last version of it that seems to exist before it was removed because it is a "convenient tool for attacking buggy kernels", according to an Android developer... :(
Perhaps you or one of the people that has stared/forked your ioctl will find this path of inquiry interesting. Cheers!
I'm trying build ioctl on a ancient buildroot (BR2_GCC_VERSION="4.4.1"
/ BR2_UCLIBC_VERSION_STRING="0.9.32.1"
) but it fails with the following error:
arm-buildroot-linux-uclibcgnueabi-gcc -Wall -c -MMD -c -o ioctl.o ioctl.c
ioctl.c: In function ‘sighandler’:
ioctl.c:48: warning: implicit declaration of function ‘psiginfo’
arm-buildroot-linux-uclibcgnueabi-gcc ioctl.o ioctls_list_empty.o -o ioctl
ioctl.o: In function `sighandler':
ioctl.c:(.text+0x60): undefined reference to `psiginfo'
collect2: ld returned 1 exit status
make[1]: *** [ioctl] Error 1
To work around the issue I commented out:
psiginfo(pinfo, "ioctl returned with signal");
and added:
fprintf(stderr, "ioctl returned with signal %d", signum);
which is not ideal...
Any ideas on how I can make psiginfo
work?
IOCTL for network devices
(wlan0 for example or any ethernet device)
You add it or I fork and add it myself?
Not being a dev or coder, (how) can I use ioctl to reverse these
/sys/class/drm/card0-eDP-1/status -> "connected"
/sys/class/drm/card0-DP-1/status -> "disconnected"
or make both of them "connected"?
Currently the stuff requires lots of headers to be installed.
The solution is to create a file with exact numeric values of ioctls, so a user doesn't have to install the packages with headers.
fs/xfs/libxfs/xfs_fs.h
contains all of the XFS ioctls, which don't seem to get included in in the building of the list.
I'm most interested in being able to run XFS_IOC_GOINGDOWN
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.