It looks like the way df works is via statfs(2). I would go this route.
If you still decide to parse the output of df, you probably want popen(3) to get its output. For more direct control, you could duplicate popen()'s functionality with fork(2), pipe(2), dup2(2), and execl(3).
|