FAQ Database Discussion Community


IOCtlSocket Ruby Winapi

ruby,sockets,winapi,ioctl
Well, I'm trying to get the value of packets to be read by the recv with ioctlsocket(FIONREAD), But the function is not returning any value. Look: IOCtlSocket = Win32API.new('ws2_32', 'ioctlsocket', 'llp', 'i') ret_val = -1 result = IOCtlSocket.call @descriptor, 0x4004667f, ret_val if ret_val > 0 print "Há pacotes a receber"...

How to issue a READ CD command to a CD-ROM drive in Windows?

c,winapi,windows-xp,ioctl,cd-rom
I'm working on an application that needs to issue raw SCSI commands to a CD-ROM drive. Currently, I'm struggling with sending a READ CD (0xBE) command to the drive and getting back the data from a given sector of the CD. Consider the following code : #include <windows.h> #include <winioctl.h>...

Linux I2C-Dev IOCTL-Call produces wrong message

linux,i2c,ioctl
I am working with an I2C-Device under Linux and tried to use the device interface like described under folowing Link. So if we assume following code: char outbuf[SIZE] = { 'e', 'b' }; struct i2c_rdwr_ioctl_data msgset; struct i2c_msg msg[1]; msg[0].addr = 0x53; // access address 0x53 msg[0].flags = 0; //...

unknown field 'ioctl' specified in initializer

linux,linux-kernel,filesystems,ioctl
I implement a simple example to study the usage of ioctl interface according to the book LDD3. When I compiling the codes, unknown field 'ioctl' specified in initializer. is reported. I guess the difference of kernel version between LDD3's and mine causes this error. I'm now using Debian 8 with...

I2C Read returns incorrect value

c,i2c,ioctl
I am trying to read in an i2c value like you would with i2cget, but it is returning the wrong value in one of the cases. i2cget -y 0 0x57 0x40 returns 0x57 i2cget -y 0 0x3b 0x09 returns 0x86 When I run my program with #define I2C_ADDR 0x57 and...

How to share same header files between kernel modules and userspace applications.

linux-kernel,macros,linux-device-driver,header-files,ioctl
I want to implement a simple module in which an ioctl() method is used. In the kernel module, I use kernel macros, such as _IO(), _IOWR(), etc., to define my own ioctl sub-commands. In facts, I don't care the actual values of these definitions for that I will always use...