From: miod Date: Sun, 7 Jan 2024 20:52:44 +0000 (+0000) Subject: Error out if one syscall ever takes more than 6 arguments. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=642e4c730f6f43ace5e0353cd2f7279987b47967;p=openbsd Error out if one syscall ever takes more than 6 arguments. This is not necessarily wrong per se, but would need special consideration, as not all platforms are currently able to process more than six syscall arguments (and upcoming diffs will rely upon reasonably-sized argument lists), so better break now and reconsider later if need be. ok deraadt@ --- diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index bedc95666de..16d09296037 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,5 +1,5 @@ #! /bin/sh - -# $OpenBSD: makesyscalls.sh,v 1.21 2023/12/21 19:34:07 miod Exp $ +# $OpenBSD: makesyscalls.sh,v 1.22 2024/01/07 20:52:44 miod Exp $ # $NetBSD: makesyscalls.sh,v 1.26 1998/01/09 06:17:51 thorpej Exp $ # # Copyright (c) 1994,1996 Christopher G. Demetriou @@ -326,6 +326,11 @@ function parseline() { parserr($f, "argument definition") } else varargc = argc; + if (argc > 6) { + printf "%s: line %d: too many syscall arguments (%d > 6)\n", \ + infile, NR, argc + exit 1 + } } function putent(nodefs, compatwrap) { # output syscall declaration for switch table.