Hi All,
Thank you for help.
I try to build a device driver and have build it Successfully.
When I call the ioctl system call, it prompts "Killed".
Then I run with
strace
command, it say "
ioctl(3, 0x22 <unfinished ...=""> +++ killed by SIGKILL +++ Killed".
The related driver code is:
#define TEST_IOC_MAGIC 0x00
#define TEST_IOCRESET _IO(TEST_IOC_MAGIC, 0x22)
....
static const struct file_operations globalfifo_fops =
{
.unlocked_ioctl = globalfifo_ioctl,
};
...
static int globalfifo_ioctl(struct inode *inode,struct file *filp,unsigned int cmd,unsigned long arg)
{
...
case TEST_IOCRESET:
....
}
The related program code is:
int main()
{
fd = open("/dev/globalfifopoll", O_CREAT|O_RDWR|O_NONBLOCK);
ioctl(fd, TEST_IOCRESET, 0);
}
The device driver and the program are both build Successfully. Meanwhile, the device driver can work well when you write buffer data to it or read buffer data from it.
I don't know where is wrong. In the program, the function
open()
return value 3 to fd. But when run the code
ioctl()
, it says "
ioctl(3, 0x22 <unfinished ...=""> ".
If I delete the code
ioctl(fd, TEST_IOCRESET, 0)
, the program can run well.
Thank you for your help.