Re: 'No such device or address' when writing to device driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Srdjan and everyone.

Thanks for pointing that out, I have updated my function.

ssize_t memo_write(struct file *filp, const char __user *buf, size_t count, loff_t *offp){
    printk("write function\n");
    ssize_t temp = -ENOMEM;
    return temp;
}

However with a clean build reboot and insmod, I am having the same error. I'm sure I must be missing something obvious. What could be causing this?

2010/1/12 Srdjan Todorovic <todorovic.s@xxxxxxxxxxxxxx>
On 12/01/2010, Sam Carter <sam.w.carter@xxxxxxxxx> wrote:
> The write function is defined in the same file and is, as of now,
> unimplemented apart from the following.
>
> static int write(char *s){

Correct me if I'm wrong, but shouldn't the function signature be:

ssize_t write(struct file *, const char __user *, size_t, loff_t *);

As per struct file_operations struct:
http://lxr.oss.org.cn/source/include/linux/fs.h#L872

Regards,
Srdjan


>>>> ------------------------------
>>>> *From:* Sam Carter <sam.w.carter@xxxxxxxxx>

>>>> static struct file_operations fops = {
>>>>     .owner = THIS_MODULE,
>>>>     .llseek = NULL,
>>>>     .read = read,
>>>>     .write = write,
>>>>     .ioctl = ioctlManager,
>>>>     .open = NULL,
>>>>     .release = NULL,
>>>> };


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux