libproc 0.1.0

A rust wrapper of libproc to get information about running processes - currently Mac OS X only
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate libproc;
extern crate libc;

use std::str;
use std::io::Write;
use libproc::libproc::kmesg_buffer;

fn main() {
    if kmesg_buffer::am_root() {
        match kmesg_buffer::kmsgbuf() {
            Ok(message) => println!("{}", message),
            Err(err) => writeln!(&mut std::io::stderr(), "Error: {}", err).unwrap()
        }
    } else {
        writeln!(&mut std::io::stderr(), "Must be run as root").unwrap()
    }
}