Created
November 19, 2010 17:07
-
-
Save kerie/706795 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static ssize_t rwbuf_write(struct file *filep, const char *buf, size_t count, loff_t *ppos) | |
{ | |
if(count<=1024) | |
{ | |
writenum++; | |
//printk(KERN_ALERT "write1\n"); | |
copy_from_user(rwbuf,buf,count); | |
//printk(KERN_ALERT "write2\n"); | |
rwlen = count; | |
//printk(KERN_ALERT "write ok\n"); | |
return rwlen; | |
} | |
else | |
{ | |
writenum++; | |
copy_from_user(rwbuf,buf,1024); | |
rwlen = 1024; | |
printk(KERN_ALERT "write overflow\n"); | |
return rwlen; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment