public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Read from file fails
@ 2004-05-03  0:00 Libor Vanek
  2004-05-03 13:11 ` Richard B. Johnson
  0 siblings, 1 reply; 18+ messages in thread
From: Libor Vanek @ 2004-05-03  0:00 UTC (permalink / raw)
  To: linux-kernel

Hi,
can anybody help me with reading from file? I've got this code in my module for 2.6.5-mm6:

char buffer[4096];
ssize_t read;
file *f;
f = filp_open("/some/file",O_RDONLY | O_LARGEFILE,0);
f->f_pos = 0;
read = vfs_read(f,(char __user *) buffer,4096,&f->f_pos);


but here read value is "-14" :-((( any hints?

It seems that file is opened OK (I've tested: 
if (f->f_op->read) {
	read = f->f_op->read(file, buf, count, pos);
}
and result was the same - so I assume that file is opened OK and structure "file f" is filled correctly.

I need to copy files (yes - I know that kernel shouldn't do this but I REALLY need) and  there is nothing like "sys_copy" and "sys_sendfile" is not exported (which seems strange to me but there is nothing like EXPORT_SYMBOL(sys_sendfile) in fs/read_write.c


Thanks,
Libor Vanek


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2004-05-05 11:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-03  0:00 Read from file fails Libor Vanek
2004-05-03 13:11 ` Richard B. Johnson
2004-05-03 15:06   ` Libor Vanek
2004-05-04  0:47     ` Richard B. Johnson
2004-05-04  1:19       ` Libor Vanek
2004-05-04 13:49         ` Richard B. Johnson
2004-05-05 10:34           ` Libor Vanek
2004-05-04 14:31         ` Bart Samwel
2004-05-05  9:54           ` Libor Vanek
2004-05-05 10:04             ` Bart Samwel
2004-05-05 10:19               ` Libor Vanek
2004-05-05 10:45                 ` Bart Samwel
2004-05-05 11:22                   ` Libor Vanek
2004-05-05 11:50                     ` Bart Samwel
2004-05-05 10:54                 ` Denis Vlasenko
2004-05-05 11:58                   ` Michael Clark
2004-05-04 18:45         ` Paulo Marques
2004-05-05  9:47           ` Libor Vanek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox