Skip to content

Instantly share code, notes, and snippets.

@kerie
Created November 19, 2010 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerie/706802 to your computer and use it in GitHub Desktop.
Save kerie/706802 to your computer and use it in GitHub Desktop.
static int rwbuf_ioctl(struct inode *node, struct file * filep, unsigned int cmd, unsigned long arg)
{
if(cmd==RWBUF_CLEAR)
{
rwlen = 0;
printk(KERN_ALERT "rwbuf in kernel zero-ed\n");
return 0;
}
else if(cmd==RWBUF_LENGTH)
{
printk(KERN_ALERT "length of buffer\n");
return rwlen;
}
else if(cmd==RWBUF_NUM)
{
printk(KERN_ALERT "num of writing\n");
return writenum;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment