GithubHelp home page GithubHelp logo

jerome-pouiller / ioctl Goto Github PK

View Code? Open in Web Editor NEW
166.0 166.0 37.0 69 KB

The missing tool to call arbitrary ioctls on devices

License: GNU General Public License v2.0

Makefile 3.82% C 64.93% Shell 31.25%

ioctl's People

Contributors

alexdowad avatar alltradesz avatar andree182 avatar flarn2006 avatar jerome-pouiller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ioctl's Issues

fatal error: linux/gigaset_dev.h: No such file or directory

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

Feature request: assemble ioctl number from raw parameters

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

Another ioctl tool has different features

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

https://android.googlesource.com/platform/system/core/+/68285c00334af57d9077648fb408a34643514df5/toolbox/ioctl.c

Perhaps you or one of the people that has stared/forked your ioctl will find this path of inquiry interesting. Cheers!

undefined reference to `psiginfo'

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?

How to turn on screen using ioctl?

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"?

Cache ioctls into an h file as numbers

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.

XFS ioctls not being included

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.