Skip to main content

landlock_supported_abi

Function landlock_supported_abi 

Source
pub fn landlock_supported_abi() -> Result<u32, Errno>
Expand description

Retourne la version ABI Landlock supportée par le kernel courant.

Utilise landlock_create_ruleset(NULL, 0, LANDLOCK_CREATE_RULESET_VERSION). Retourne ENOSYS si le kernel ne supporte pas Landlock (< 5.13).

Valeur retournéeVersion LandlockKernel minimum
1v1Linux 5.13
2v2 (REFER)Linux 5.19
3v3 (TRUNCATE)Linux 6.2
5v5 (IOCTL_DEV)Linux 6.10

§Errors

  • ENOSYS : Landlock non supporté ou non compilé dans le kernel.

§Examples

use air_sys_syscall::security::landlock_supported_abi;

match landlock_supported_abi() {
    Ok(v) => println!("Landlock ABI v{v}"),
    Err(_) => println!("Landlock non disponible"),
}