libscmp 0.2.0

A safe, sane Rust interface to libseccomp on Linux.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![cfg(feature = "libseccomp-2-4")]

// This must run in a test of its own so it runs in a separate process (not just a separate thread)
// and doesn't interfere with other tests.

#[test]
fn test_api_get_set() {
    let orig_api = libscmp::api_get();

    for &api in [1, 2, 3, orig_api].iter() {
        libscmp::api_set(api).unwrap();
        assert_eq!(libscmp::api_get(), api);
    }

    libscmp::api_set(orig_api).unwrap();
}