Commit glibc-2.33~117 introduced RET_SCV macro that treats any negative value returned by syscall via scv ABI as an error, but this is not correct. This bug was found by strace test suite. Proposed fix was posted by Nicholas Piggin at https://sourceware.org/pipermail/libc-alpha/2021-May/126534.html
Issue fixed on master for glibc 2.34: commit 7de36744ee1325f35d3fe0ca079dd33c40b12267 Author: Nicholas Piggin <npiggin@gmail.com> Date: Thu May 20 11:00:36 2021 -0300 powerpc: Fix handling of scv return error codes [BZ #27892] When using scv for templated ASM syscalls, current code interprets any negative return value as error, but the only valid error codes are in the range -4095..-1 according to the ABI. This commit also fixes 'signal.gen.test' strace test, where the issue was first identified. Reviewed-by: Matheus Castanho <msc@linux.ibm.com> This patch was also backported to 2.33 by commit 0ef0e6de7fdfa18328b09ba2afb4f0112d4bdab4.