From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 7966D383556C; Wed, 7 Dec 2022 13:48:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7966D383556C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1670420938; bh=REmY7/akpnR8MVXby+cQ2mCn/Va5A/sd2lTBgZDDQts=; h=From:To:Subject:Date:From; b=EpGPi/QRO+wHK5DJEZdbQuDRNYV1JgSJdN6eTsKcQ6qPG7jJFP5+yy0s2qe4CslM8 hs0gzhqfAJswtMkolTRrn4OqKRBmZIfCMBIiSAyxWsCDtasdyG6HEMC8wvGTTwC2ZW IETHGC62yuPH3x9p/uuOS87OjrMAVwQmTZ0/iIxI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] linux: Use long int for syscall return value X-Act-Checkin: glibc X-Git-Author: Xing Li X-Git-Refname: refs/heads/master X-Git-Oldrev: 9f482b73f41a9a1bbfb173aad0733d1c824c788a X-Git-Newrev: 36d423e2032e98305799071b831691fc4c06deea Message-Id: <20221207134858.7966D383556C@sourceware.org> Date: Wed, 7 Dec 2022 13:48:58 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=36d423e2032e98305799071b831691fc4c06deea commit 36d423e2032e98305799071b831691fc4c06deea Author: Xing Li Date: Tue Nov 29 19:24:43 2022 +0800 linux: Use long int for syscall return value 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. Reviewed-by: Adhemerval Zanella Diff: --- 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);