Example code instructions

devnull <[email protected]> Mon, 19 Sep 2022 14:44:15 +0000
Newsgroups dev.linux.lists.landlock
Message-ID <-9ppKooZaoDsv4FW6d6Q5iiA4mC4yyqc-i-bNOKZ-Mflu5OXpqP2ZaSw3awBrLxeQPNljs4FDzhYbXxzQ7iSbwnWjBV7Vxjr3VI4qaBNOfA=@proton.me>
I am trying to figure out how to use landlock to implement into userspace applications and came across this example code
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/samples/landlock/sandboxer.c

However, I find myself unable to successfully build the example code

Perhaps this is an obvious issue for any full time C developer, but it would help increase the use of landlock if there is an example code with step by step instruction on how to actually build it.

So far, any attempt to compile the example "sandboxer.c" (using clang or gcc) will result in the following error:

sandboxer.c:163:9: error: ‘LANDLOCK_ACCESS_FS_REFER’ undeclared (first use in this function)


The affected system is running linux 5.19.8 with landlock enabled.

There may just be a missing compile flag to get it working but I have not found any documentation about it.
Any hints would be appreciated, thank you