Re: Man page for revised timerfd API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Matti Aarnio <matti.aarnio@...>
Cc: Davide Libenzi <davidel@...>, <rdunlap@...>, Andrew Morton <akpm@...>, <hch@...>, <geoff@...>, <tglx@...>, <david@...>, Ulrich Drepper <drepper@...>, <subrata@...>, <corbet@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Thursday, October 4, 2007 - 2:19 pm

Matti,

Matti Aarnio wrote:

As you correctly surmise, the uint64_t returned by read() is in host byte
order.  But I almost wonder if adding this detail would create confusion,
with some readers less familiar with network programming asking: "what's
host byte order?".  (It never occurred to me that it could be anything
else, until I saw your note.)   Anyway to eliminate possible confusion, I
added this sentence to the eventfd.2 and timerfd_create.2 pages:

    (The returned value is in host byte order, i.e., the native
    byte order for integers on the host machine.)



I agree that it's not a smart thing to do in a real-world program.  I'm
just not sure whether each man page example is the right place to teach
those skills.  The problem is that decent error handling can require quite
a bit of code, and the details of error handling can drown out the concepts
being demonstrated by the example code.  So, I'm inclined not to do this.
(I have to draw the line somewhere -- to some extent arbitrarily -- and my
line is this: example programs should always at least check every system to
see whether an error occurred (a surprising number of real-world programs
do not even do that); I leave it to the reader to actually master enough
programming skills to realize that a program should behave robustly in the
face of errors.)

But, if you are prepared to make a good case for specific that should  be
handled, send ti to me with a patch.

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'.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Man page for revised timerfd API, Michael Kerrisk, (Wed Sep 26, 3:12 am)
Re: Man page for revised timerfd API, Geoff Clare, (Thu Sep 27, 4:20 am)
Re: Man page for revised timerfd API, Michael Kerrisk, (Thu Sep 27, 6:50 am)
Re: Man page for revised timerfd API, Davide Libenzi, (Wed Sep 26, 2:06 pm)
Re: Man page for revised timerfd API, Michael Kerrisk, (Thu Sep 27, 6:35 am)
Re: Man page for revised timerfd API, Davide Libenzi, (Thu Sep 27, 12:45 pm)
Re: Man page for revised timerfd API, Michael Kerrisk, (Wed Oct 3, 2:50 am)
Re: Man page for revised timerfd API, Matti Aarnio, (Wed Oct 3, 4:14 am)
Re: Man page for revised timerfd API, Michael Kerrisk, (Thu Oct 4, 2:19 pm)
Re: Man page for revised timerfd API, Michael Kerrisk, (Wed Sep 26, 5:13 pm)