From: Arnd Bergmann <arnd@arndb.de>
To: eranian@gmail.com
Cc: "Arjan van de Ven" <arjan@infradead.org>, linux-kernel@vger.kernel.org
Subject: Re: [patch 02/21] perfmon2 minimal: generic headers
Date: Thu, 12 Jun 2008 22:52:46 +0200 [thread overview]
Message-ID: <200806122252.46849.arnd@arndb.de> (raw)
In-Reply-To: <7c86c4470806110049g76247b4ex5e1b77af78d8dd7c@mail.gmail.com>
On Wednesday 11 June 2008, stephane eranian wrote:
> > I'm very nervous when seeing something like this in userspace headers;
> > you need to assume that the app has been compiled with a very different
> > version of the headers than the currently running kernel.... either the
> > version of perfmon doesn't matter, in which case these don't belong
> > here, or it does and it should be a runtime query.
> >
> I think you bring up a good point. There is indeed a way of querying the version
> via /sysfs.
>
> However the question is how does an application know which API version
> it was compiled
> for, so it can compare with what it finds in /sysfs? That ought to be
> somewhere in the
> public headers that the application was compiled with.
>
The normal way for an application is to just use a syscall or file
interface, and check for -ENOENT or -ENOSYS error codes in order to
find kernels that are too old. If older kernels had a different way
of doing things, the application can fall back on that mechanism.
An example for this would be pselect() which you can replace with
select(), but only in a racy way that the user should avoid.
When the kernel changes an interface, it must only do that in a
backwards compatible way, so that old binaries do not break. Ever.
Arnd <><
prev parent reply other threads:[~2008-06-12 20:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-09 22:33 [patch 02/21] perfmon2 minimal: generic headers eranian
2008-06-10 14:29 ` Arjan van de Ven
2008-06-11 7:49 ` stephane eranian
2008-06-12 20:52 ` Arnd Bergmann [this message]
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=200806122252.46849.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=arjan@infradead.org \
--cc=eranian@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 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.