From: Michael Kerrisk <mtk-manpages@gmx.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
Linux Torvalds <torvalds@linux-foundation.org>,
Davide Libenzi <davidel@xmailserver.org>,
drepper@redhat.com, stable@kernel.org
Subject: Re: Problems with timerfd()
Date: Mon, 23 Jul 2007 10:02:10 +0200 [thread overview]
Message-ID: <46A46082.7030301@gmx.net> (raw)
In-Reply-To: <20070722234204.10d0f9a9.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Sun, 22 Jul 2007 23:38:26 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
>
>>> Davide has already submitted a patch to you to make read() from a timerfd
>>> file descriptor return an 8 byte integer, and I understand it to have been
>>> accepted into -mm.
>> argh. Nobody told me it was an ABI change! We'll need to consider merging
>> make-timerfd-return-a-u64-and-fix-the-__put_user.patch into 2.6.22.x as
>> well.
>>
>
> So I'm trying to write a halfway respectable description of that patch and
> I'm stuck when it comes to describing what will happen if someone tries
> to run a future timerfd-enabled glibc on 2.2.22 base. In what manner
> will it misbehave? What are the consequences of this decision?
>
The difference would be that read() will only return 4 bytes, while the
application will expect 8. If the application is checking the size of
returned value, as it should, then it will be able to detect the problem
(it could even be sophisticated enough to know that if this is a 4-byte
return, then it is running on an old 2.6.22 kernel). If the application is
not checking the return from read(), then its 8-byte buffer will not be
filled -- the contents of the last 4 bytes will be undefined, so the u64
value as a whole will be junk.
Cheers,
Michael
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.
next prev parent reply other threads:[~2007-07-23 7:57 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 6:32 Problems with timerfd() Michael Kerrisk
2007-07-23 6:38 ` Andrew Morton
2007-07-23 6:42 ` Andrew Morton
2007-07-23 8:02 ` Michael Kerrisk [this message]
2007-07-25 18:18 ` Michael Kerrisk
2007-07-25 22:12 ` Andrew Morton
2007-08-07 6:55 ` Michael Kerrisk
2007-08-07 7:36 ` Andrew Morton
2007-08-07 9:14 ` Michael Kerrisk
2007-08-09 21:11 ` [PATCH] Revised timerfd() interface Michael Kerrisk
2007-08-13 23:34 ` Randy Dunlap
2007-08-15 14:40 ` Jonathan Corbet
2007-07-23 16:55 ` Problems with timerfd() Ray Lee
2007-07-24 7:40 ` Michael Kerrisk
2007-07-24 15:22 ` Ray Lee
2007-07-24 15:56 ` Michael Kerrisk
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=46A46082.7030301@gmx.net \
--to=mtk-manpages@gmx.net \
--cc=akpm@linux-foundation.org \
--cc=davidel@xmailserver.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).