How to invoke ioctl in shell script?

I wrote ioctl tool exactly for this purpose: https://github.com/jerome-pouiller/ioctl.

Currently, it is not possible to pass multiple argument to ioctl call. Have you an example where it would be usefull?

If you want to call ioctl(open("/dev/console"), 30, 1);, you can run:

ioctl /dev/console 30 -v 1

However, for most ioctl, you want to allocate a buffer and pass a pointer to this buffer in argument to ioctl call. In this case, just forget -v. ioctl will read/write buffer content from/to standard input/output. ioctl try to guess buffer size and direction from ioctl number.

The best is: ioctl understand many (around 2200) ioctl symbolic names. Thus you can call:

ioctl /dev/video0 VIDIOC_QUERYCAP > video_caps

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)