All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Kerrisk <mtk.manpages-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
To: WANG Cong <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jens Axboe <jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Subject: Re: Man page bugs?
Date: Thu, 31 Jan 2008 13:56:45 +0100	[thread overview]
Message-ID: <47A1C58D.9060101@gmail.com> (raw)
In-Reply-To: <20080119130029.GC2466@hacking>

Hi Cong,

WANG Cong wrote:
> Hi, Michael and list!
> 
> I found two problems in the man pages. The first one should
> be a bug. It is that the type of the 2nd and 4th arguments
> of splice(2) is wrong. The current prototype of splice(2)
> in current man page is:
> 
>        long splice(int fd_in, off_t *off_in, int fd_out,
>                    off_t *off_out, size_t len, unsigned int flags);
> 
> However, they should be 'loff_t' instead of 'off_t'. If we
> use 'off_t', gcc will generate a warning. Patch is in the end
> of this email and it's against 2.76 release. ;)

Thanks for spotting that.  Fixed as you suggest, for man-pages-2.77.

> The second one is a bit confused. The example given in tee(2)
> even can not run normally. I got this error:
> 
> $ ./example bar.txt
> tee: Invalid argument
> 
> I looked at tee(2), it is said that:
> 
> EINVAL fd_in  or  fd_out  does not refer to a pipe; or fd_in and fd_out
>        refer to the same pipe.
> 
> So the first two arguments of tee(2) in the example is wrong,
> since neither STDIN_FILENO nor STDOUT_FILENO refers to a pipe.
> But I am not so sure, because I am new to tee(2). ;) If you can
> comfirm this is really a bug, I can send a patch to fix this too.
> 
> I have checked the newest release of man pages and my kernel version
> is 2.6.21-1.3194.fc7. Did I miss something obvious?

I'm not sure.  Perhaps Jens, the implementer of tee(2) can provide a little
help.  Jens, what's an example of a command line for running the example
program in the tee.2 man page?

Cheers,

Michael

> Index: man-pages-2.76/man2/splice.2
> ===================================================================
> --- man-pages-2.76.orig/man2/splice.2
> +++ man-pages-2.76/man2/splice.2
> @@ -31,8 +31,8 @@ splice \- splice data to/from a pipe
>  .B #define _GNU_SOURCE
>  .B #include <fcntl.h>
>  
> -.BI "long splice(int " fd_in ", off_t *" off_in ", int " fd_out ,
> -.BI "            off_t *" off_out ", size_t " len \
> +.BI "long splice(int " fd_in ", loff_t *" off_in ", int " fd_out ,
> +.BI "            loff_t *" off_out ", size_t " len \
>  ", unsigned int " flags );
>  .fi
>  .SH DESCRIPTION
> 

-- 
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug?  Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html

  reply	other threads:[~2008-01-31 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19 13:00 Man page bugs? WANG Cong
2008-01-31 12:56 ` Michael Kerrisk [this message]
     [not found]   ` <47A1C58D.9060101-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-31 13:02     ` Jens Axboe
     [not found]       ` <20080131130202.GT15220-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-01-31 13:19         ` Michael Kerrisk
     [not found]           ` <47A1CAF1.9090802-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-31 13:28             ` Jens Axboe
     [not found]               ` <20080131132858.GZ15220-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-01-31 14:39                 ` WANG Cong
2008-01-31 15:03                   ` Jens Axboe
     [not found]                     ` <20080131150345.GC15220-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
2008-01-31 15:11                       ` WANG Cong

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=47A1C58D.9060101@gmail.com \
    --to=mtk.manpages-gm/ye1e23mwn+bqq9rbeug@public.gmane.org \
    --cc=jens.axboe-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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.