proc file system - write function

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

 



I have an existing and working code that uses the proc file system.
 
One of the functions in the code, foo_write, is being called whenever something
is written into my file in the proc.
 
My observations are as follows:
- The return code of foo_write affects the original "write" that wrote to the file
- If foo_write returns a positive X, the "write" returns with X, and errno is 0
- If foo_write returns a negative X, the "write" returns -1, and errno is set to -X (i.e. a positive value)
- If foo_write returns a zero... I am not sure.
 
Is this correct ?
What happens with a zero value ?
Where can I find more information ?
Side issue: if I "write" using "echo" in a shell script, is there any way to access errno ?
 
TIA
 
 

[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