mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Amit Ben Shahar <amit.bens@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Why is the 'loff_t *offset' parameter in the file_operations' read function a pointer?
Date: Tue, 26 Apr 2011 14:37:53 +0200	[thread overview]
Message-ID: <201104261437.53925.arnd@arndb.de> (raw)
In-Reply-To: <BANLkTimaJFFCCQOA6=G4i95PsJK_S2bf9Q@mail.gmail.com>

On Tuesday 26 April 2011, Amit Ben Shahar wrote:
> (if i'm off topic or should look elsewhere i apologize - couldn't find
> information anywhere)
> I am coding a kernel module and implementing a file's operations, the
> read operation received an loff_t *offset parameter, why is this a
> pointer? is it in userspace?

The read function must update the offset independent of the return value.
See simple_read_from_buffer() as an example.

	Arnd

  parent reply	other threads:[~2011-04-26 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 11:58 Amit Ben Shahar
2011-04-26 12:30 ` Jiri Slaby
2011-04-26 12:37 ` Arnd Bergmann [this message]
2011-04-26 12:55   ` Amit Ben Shahar

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=201104261437.53925.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=amit.bens@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®