public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: Zhiheng Li <phoenix_lzh@sina.com>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: [PATCH] setbuf.3: fix the error in section BUGS
Date: Mon, 12 Apr 2021 11:22:31 +0200	[thread overview]
Message-ID: <67c8cd43-4a0e-570a-4e4d-7539a3cd3ec8@gmail.com> (raw)
In-Reply-To: <20210412074443.15363-1-phoenix_lzh@sina.com>

On 4/12/21 9:44 AM, Zhiheng Li wrote:
> ---
>   man3/setbuf.3 | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/setbuf.3 b/man3/setbuf.3
> index 5e5d57f89..e6d41b2a9 100644
> --- a/man3/setbuf.3
> +++ b/man3/setbuf.3
> @@ -224,14 +224,15 @@ For example, the following is invalid:
>   .PP
>   .EX
>   #include <stdio.h>
> +#include <unistd.h>
>   
>   int
>   main(void)
>   {
>       char buf[BUFSIZ];
> -    setbuf(stdin, buf);
> +    setbuf(stdout, buf);
>       printf("Hello, world!\en");
> -    return 0;
> +    _exit(0);
>   }
>   .EE
>   .SH SEE ALSO
> 

Hello Zhiheng Li,

I never used setbuf(3), so I don't know much about this example and why 
it is "invalid", and therefore also don't know why it is wrong in being 
invalid.

As far as I can see, 'stdin' just seems to be a typo because it's not 
being used, and probably 'stdout' was meant instead, as you point out.

What about _exit(0)?  Why _exit(2) and not return (or equivalently 
exit(3))?  Could you explain that a bit more?

BTW, Could you please use a mailer that allows you to write plain text 
emails?  Mozilla Thunderbird may be easy to use for you, and it comes 
with most Linux distros.

Thanks,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

       reply	other threads:[~2021-04-12  9:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210412074443.15363-1-phoenix_lzh@sina.com>
2021-04-12  9:22 ` Alejandro Colomar (man-pages) [this message]
     [not found]   ` <37c86142-a8a1-55ec-de3c-0fe48876860b@sina.com>
2021-04-15 11:48     ` [PATCH] setbuf.3: fix the error in section BUGS Stefan Puiu
     [not found]       ` <4fcc0db7-f9b9-a6ec-992b-84205e301618@sina.com>
2021-04-16 10:02         ` Alejandro Colomar (man-pages)

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=67c8cd43-4a0e-570a-4e4d-7539a3cd3ec8@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=phoenix_lzh@sina.com \
    /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