build failure on systems without sys/sysctl.h
Modern kernels have don't have sysctl since commit:
commit 61a47c1ad3a4dc6882f01ebdc88138ac62d0df03 Author: Eric W. Biederman ebiederm@xmission.com Date: Tue Oct 1 13:01:19 2019 -0500
and header sys/sysctl.h is not guaranteed to exist anymore. In this situations we get apparmor test build failures:
syscall_setscheduler.c: In function ‘main’: syscall_setscheduler.c:19:11: warning: unused parameter ‘argc’ [-Wunused-parameter] 19 | main (int argc, char * argv[]) { | ~~~~^~~~ syscall_setscheduler.c:19:24: warning: unused parameter ‘argv’ [-Wunused-parameter] 19 | main (int argc, char * argv[]) { | ~~~~~~~^~~~~~ cc -g -O0 -Wall -Wsign-compare -Wmissing-field-initializers -Wformat -Wformat-security -Wunused-parameter -Wimplicit-fallthrough syscall_sysctl.c -lapparmor -o syscall_sysctl syscall_sysctl.c:12:10: fatal error: sys/sysctl.h: No such file or directory 12 | #include <sys/sysctl.h> | ^~~~~~~~~~~~~~ compilation terminated. make: *** [: syscall_sysctl] Error 1