reading/writing to a /proc interface

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

 



Hi everyone,
i very new to linux kernel programming and i have a problem.
Iam creating a module which creates a entry in /proc interface like that :
/proc/testfile with permission set to 0666.

Now i want to write an integer value in this file like this:

inval = 8000;
wbytes = write(fd, &inval, sizeof(int));

its giving me error with errno set to EINVAL which means "fd is
attached to an object which is unsuitable for writing"

can anyone plz help me.

thanks in advance.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[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