Re: query related to /proc and read_write.c file

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

 



Hi,
I am trying to understand data transfer with /proc . Pls let me know if my understanding is valid or not.
1. Create a directory in /proc fs using proc_mkdir
2. If the entry is read only in the sense user can only read it but cant write to it then call create_proc_read_entry else call create_proc_entry with a call back function
3. When user reads or writes to the created entry in /proc the registered call back function will be called.


I have few doubts
1. How much size of data can be transferred at one time from kernel space to user space using /proc fs
2. How much max size of a file can be created in /proc. If this is platform dependent, then what is the value for x86 board with Kernel version as 2.4.18-14
3. Pls differentiate eloborately between read_proc and get_info


Thanks for any help,
-Ravi




Shine Mohamed Jabbar wrote:


On Wed, 2004-04-28 at 11:19, bunty wrote:


hi Gabor,
let me explain you what exactly i want. i want to read and write to /proc entry file that i created in /proc after Praveen help me how to create proc entry.My questio whether i can use read and write and open funcion calls on /proc entry to update its contents if not can you tell me how can i acheive it?



In my opinion, u can use the system calls on proc files.


Eg:-

open("/proc/ur_entry",...)

or

prompt# echo something > /proc/ur_entry

Please refer the chapter for proc filesytem
for more details...



regards,
parag.




Regards, Shine Mohamed Jabbar



On Tue, 27 Apr 2004 Gabor Fekete wrote :


Hi

On Monday 26 April 2004 16.54, bunty wrote:


2)what is the use of read_write.c file in fs directory of kernel
source? the file contains sys_read, sys_write. why there is no function
that will read a user space file and write to it.


what do you mean by "user space file"?
actually these two functions read from and write to files.
They are system calls, called by write() and read() from user space.

feketga


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





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







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