public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: QingFeng Hao
	<haoqf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
	linux-man <linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Christian Borntraeger
	<borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/1] s390_sthyi.2: New page for s390-specific s390_sthyi(2)
Date: Tue, 21 Nov 2017 11:23:14 +0100	[thread overview]
Message-ID: <20171121102314.GB4046@osiris> (raw)
In-Reply-To: <CAKgNAkiRRqLpADiObHVGqxfgwYSqU23LuMEnThQmU1xXTTNMZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Nov 21, 2017 at 09:48:02AM +0100, Michael Kerrisk (man-pages) wrote:
> >> What does "On other cases" mean? When do those cases happen?
> >> Could you reword please.
> >
> > The case is:
> > If the STHYI facility is enabled and the system call fails to execute the
> > underlying
> > STHYI instruction, the value of condition code is returned, which currently
> > is only
> > 3 indicating "unsupported function code".
> > Is this OK to put it here?
> 
> Let me see if I understand correctly. There are three possible return
> values for this system call:
> 
> 0 ==> success
> -1 ==> failure (and errno is set)
> [condition code value is returned -- e,g,, 3]
> 
> This last case is a kind of failure in the system call, right?
> 
> If this is correct, this is a highly unusual--possibly even
> unique--model for the system call return value. Most (in fact, I think
> all) system calls indicate errors by returning -1. Values >= 0 always
> mean success. I think it may be worth revisiting this design, to make
> it more consistent with the usual conventions. For example, why not
> handle the last case by returning -1, setting errno to some value
> (maybe ENOTSUP), and return the condition code in *buffer?.

Well, I would have written this differently: on success the return value
matches the condition code of the STHYI instructions, which is a value
between 0-3 (that is: emulation succeeded). If a condition code, which is
not 0, is an error or not, may not be the same in the future, if the
instruction gets extended.

That being said, if you think this still doesn't make much sense, we might
have to reconsider the interface.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-11-21 10:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-20 13:34 [PATCH 1/1] s390_sthyi.2: New page for s390-specific s390_sthyi(2) QingFeng Hao
     [not found] ` <20171120133420.4700-1-haoqf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2017-11-20 15:37   ` Michael Kerrisk (man-pages)
     [not found]     ` <8b4188fa-bdda-c3eb-5184-cecf78267f0f-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-21  8:26       ` QingFeng Hao
     [not found]         ` <10afe17f-9874-06c6-acd3-7da8fe14af55-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2017-11-21  8:48           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkiRRqLpADiObHVGqxfgwYSqU23LuMEnThQmU1xXTTNMZA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-21 10:23               ` Heiko Carstens [this message]
2017-11-21 11:04                 ` Michael Kerrisk (man-pages)
     [not found]                   ` <CAKgNAkjmx9aNsFpeXDbum1m8zkCV3EYGrrdXs8Z7V1RZnJTsuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-21 11:51                     ` Heiko Carstens
2017-11-22  3:02                       ` QingFeng Hao

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=20171121102314.GB4046@osiris \
    --to=heiko.carstens-ta70fqpds9bqt0dzr+alfa@public.gmane.org \
    --cc=borntraeger-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
    --cc=haoqf-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox