From: Adhemerval Zanella Netto via Libc-alpha <libc-alpha@sourceware.org>
To: XingLi <lixing@loongson.cn>
Cc: libc-alpha@sourceware.org, i.swmail@xen0n.name,
xry111@xry111.site, caiyinyu@loongson.cn,
wanghongliang@loongson.cn, hejinyang@loongson.cn,
szabolcs.nagy@arm.com
Subject: Re: [PATCH] linux: Use long int for syscall return value
Date: Wed, 30 Nov 2022 10:53:32 -0300 [thread overview]
Message-ID: <7fb959d8-1636-d731-ef6f-4d779ca6226e@linaro.org> (raw)
In-Reply-To: <20221129112443.2325486-1-lixing@loongson.cn>
On 29/11/22 08:24, XingLi wrote:
> From: Xing Li <lixing@loongson.cn>
>
> The linux syscall ABI returns long, so the generic syscall code for
> linux should use long for the return value.
>
> This fixes the truncation of the return value of the syscall function
> when that does not fit into an int.
> ---
> sysdeps/unix/sysv/linux/syscall.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/syscall.c b/sysdeps/unix/sysv/linux/syscall.c
> index 7303ba7188..8cb0b66b1c 100644
> --- a/sysdeps/unix/sysv/linux/syscall.c
> +++ b/sysdeps/unix/sysv/linux/syscall.c
> @@ -33,7 +33,7 @@ syscall (long int number, ...)
> long int a5 = va_arg (args, long int);
> va_end (args);
>
> - int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5);
> + long int r = INTERNAL_SYSCALL_NCS_CALL (number, a0, a1, a2, a3, a4, a5);
> if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (r)))
> {
> __set_errno (-r);
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
prev parent reply other threads:[~2022-11-30 13:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 11:24 [PATCH] linux: Use long int for syscall return value XingLi
2022-11-30 13:53 ` Adhemerval Zanella Netto via Libc-alpha [this message]
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7fb959d8-1636-d731-ef6f-4d779ca6226e@linaro.org \
--to=libc-alpha@sourceware.org \
--cc=adhemerval.zanella@linaro.org \
--cc=caiyinyu@loongson.cn \
--cc=hejinyang@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=lixing@loongson.cn \
--cc=szabolcs.nagy@arm.com \
--cc=wanghongliang@loongson.cn \
--cc=xry111@xry111.site \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).