All of lore.kernel.org
 help / color / mirror / Atom feed
From: Libor Vanek <libor@conet.cz>
To: linux-kernel@vger.kernel.org
Subject: Read from file fails
Date: Mon, 3 May 2004 02:00:04 +0200	[thread overview]
Message-ID: <20040503000004.GA26707@Loki> (raw)

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


             reply	other threads:[~2004-05-03  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-03  0:00 Libor Vanek [this message]
2004-05-03 13:11 ` Read from file fails 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040503000004.GA26707@Loki \
    --to=libor@conet.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.