Skip to content

Instantly share code, notes, and snippets.

@kerie
Created November 19, 2010 17:05
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/706788 to your computer and use it in GitHub Desktop.
Save kerie/706788 to your computer and use it in GitHub Desktop.
static int rwbuf_open(struct inode *node, struct file *filep)
{
if(inuse==1)
return -1;
inuse=1;
printk(KERN_ALERT "open ok\n");
return 0;
}
static int rwbuf_close(struct inode *node, struct file *filep)
{
inuse = 0;
printk(KERN_ALERT "close ok\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment