Re: size of files in procfs

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

 



On 5/15/06, fred xvii <fredxvii@xxxxxxxxxxx> wrote:
Hi,

I'd like to pass some data from kernel to user space. So, I create an
entry in procfs, and want to have a process read this new entry to get
its data.  However, I can have big data, more than the available
place.

As far as I understand it, the read() function one creates to read a
proc entry is called by fs/proc/generic.c:proc_file_read(). There max
available size is given by:

count = min_t(size_t, PROC_BLOCK_SIZE, nbytes);
where PROC_BLOCK_SIZE is 1024.

So, at most, I can write no more than 1k in my proc
entry. Unfortunately, I need to write more.

So my (first) question is simple: how to write more?

However, if this is not possible, it can mean that /proc is not
appropriate to what I want to do. So, is there another solution, more
correct?

What about using a character device? It is easier to implement and you
pass data of larger size.


regards
Manish Regmi

--
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