From: Andreas Dilger <adilger@clusterfs.com>
To: linux-kernel@vger.kernel.org
Subject: Re: extending callbacks?
Date: Tue, 19 Mar 2002 12:32:28 -0700 [thread overview]
Message-ID: <20020319193228.GS470@turbolinux.com> (raw)
In-Reply-To: <Pine.GSO.4.44.0203191111320.20995-100000@speedy> <a78gd7$jk$1@cesium.transmeta.com>
Matthias Scheidegger <mscheid@iam.unibe.ch> writes:
> I've got the following problem: I want to register a callback in a kernel
> structure, but I need to supply an additional argument to my own code. I.e. I
> need a callback
>
> int (*cb)(int u)
>
> to really call
>
> int (*real_cb)(int u, void* my_arg)
>
> At the moment, I'm only focussing on the i386 architecture.
In general, you would pass "my_arg" in a private pointer in a data
struct somewhere. What function is it that you are calling? That
may already have the possibility of passing the extra data somewhere.
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
next prev parent reply other threads:[~2002-03-19 23:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-19 10:23 extending callbacks? Matthias Scheidegger
2002-03-19 23:08 ` H. Peter Anvin
2002-03-19 19:32 ` Andreas Dilger [this message]
2002-03-20 15:55 ` Eric W. Biederman
2002-03-20 18:32 ` H. Peter Anvin
2002-03-20 15:59 ` Eric W. Biederman
2002-03-20 21:02 ` Matthias Scheidegger
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=20020319193228.GS470@turbolinux.com \
--to=adilger@clusterfs.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