1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// top-level files
#[doc(inline)]
pub mod buddyinfo;
pub mod cmdline;
pub mod consoles;
pub mod cpuinfo;
pub mod crypto;
pub mod devices;
pub mod diskstats;
pub mod dma;
pub mod execdomains;
pub mod fb;
pub mod filesystems;
pub mod interrupts;
pub mod iomem;
pub mod ioports;
pub mod kcore;
pub mod loadavg;
pub mod locks;
pub mod mdstat;
pub mod meminfo;
pub mod misc;
pub mod modules;
pub mod mounts;
pub mod mtrr;
pub mod partitions;
pub mod slabinfo;
pub mod stat;
pub mod swaps;
pub mod uptime;
pub mod version;

pub mod _self;

// Process Directories

/// functions in this module has two differences compare to the functions reside in other moduels:
///
/// 1. receive an argument of u32, which represent the process pid number.
/// 2. append "_of" suffix to the function.
pub mod pid {

    macro_rules! pid_path {
        ($pid: expr, $fname: expr) => {
            format!("/proc/{}/{}", $pid, $fname)
        };
    }

    macro_rules! pself_path {
        ($fname: expr) => {
            format!("/proc/self/{}", $fname)
        };
    }

    pub mod cmdline;
    pub mod cwd;
    pub mod environ;
    pub mod exe;
    pub mod maps;
    pub mod root;
    pub mod stat;
    pub mod statm;
    pub mod status;
    pub mod task;
}

// other subdirectories
pub mod acpi {
    pub mod wakeup;
}
pub mod driver {
    pub mod rtc;
}
pub mod net {
    pub mod arp;
    pub mod dev;
    pub mod dev_mcast;
    pub mod ip_tables_names;
    pub mod netstat;
    pub mod route;
}