diff mbox

[2/3] Set invalid syscall as -1 instead of 0

Message ID 1367588717-18162-3-git-send-email-riku.voipio@linaro.org
State Superseded, archived
Headers show

Commit Message

Riku Voipio May 3, 2013, 1:45 p.m. UTC
From: Riku Voipio <riku.voipio@linaro.org>

System call number 0 might be in use in selected syscalls.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
 testcases/kernel/include/regen.sh |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/testcases/kernel/include/regen.sh b/testcases/kernel/include/regen.sh
index 86cdc09..08a2669 100755
--- a/testcases/kernel/include/regen.sh
+++ b/testcases/kernel/include/regen.sh
@@ -27,7 +27,7 @@  cat << EOF > "${output_pid}"
 
 #define ltp_syscall(NR, ...) ({ \\
 	int __ret; \\
-	if (NR == 0) { \\
+	if (NR == __LTP__NR_INVALID_SYSCALL) { \\
 		errno = ENOSYS; \\
 		__ret = -1; \\
 	} else { \\
@@ -71,11 +71,12 @@  done
 echo -n "Generating stub list ... "
 echo "" >> "${output_pid}"
 echo "/* Common stubs */" >> "${output_pid}"
+echo "#define __LTP__NR_INVALID_SYSCALL -1" >> "${output_pid}"
 for nr in $(awk '{print $1}' "${srcdir}/"*.in | sort -u) ; do
 	nr="__NR_$nr"
 	cat <<-EOF >> "${output_pid}"
 	# ifndef $nr
-	#  define $nr 0
+	#  define $nr __LTP__NR_INVALID_SYSCALL
 	# endif
 	EOF
 done