Proc file system bug or i'm to stupid...

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

 



Hi, i tried a little bit around (to my last post) and i run into another
problem...

I modified my proc read function, now i use an big static buffer, copy
all in what i want to put out to the reader. It's not my preffered way,
but i read somewhere it is the normal way.

The problem now is, if i return values bigger than 1446 to the kernel
(the bytes written to the buffer) there will be only these 1446 bytes
send to the reader... why?

Here are again some code, i hope its readable...

int proc_read_tis(char *page, char **start,
		off_t off, int count,
		int *eof, void *data) {
int len;

/* the static buffer */
static char buffer[65535];
char* out = buffer;

/* tell the kernel there is no more to read, because i sent it out in
one big block */	
if (off> 0)
  	return 0;
	
	
	out += snprintf(out,65535- (out-buffer), "BLABLA");

	/* set the start value at our own buffer */
	*start = buffer;
	/* the we have written all we have to write */
	*eof = 1;

	return (out-buffer);
}



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