[LTP] [PATCH v5 1/3] Refactor regen.sh script to generate syscalls

Cyril Hrubis chrubis@suse.cz
Wed Oct 30 14:47:04 CET 2024


Hi!
> +(
> +	echo
> +	echo "/* Common stubs */"
> +	while IFS= read -r arch; do
> +		while IFS= read -r line; do
> +			set -- ${line}
> +			syscall_nr="__NR_$1"
> +			shift
> +
> +			echo "# ifndef ${syscall_nr}"
> +			echo "#  define ${syscall_nr} __LTP__NR_INVALID_SYSCALL"
> +			echo "# endif"
> +		done <"${SCRIPT_DIR}/${arch}.in"
> +	done <${SUPPORTED_ARCH}
> +	echo "#endif"
> +) >>${SYSCALLS_FILE}

This will generate multiple fallback definitions, one per architecture
for common syscall, there was a good reason why these files were parsed
by awk with sort -u

> -echo "#define __LTP__NR_INVALID_SYSCALL -1" >> "${output_pid}"
> -for nr in $(awk '{print $1}' "${srcdir}/"*.in | sort -u) ; do

This is the important part that IMHO should stay.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list