用system函数调用系统命令就可以了。
比如在freebsd系统下,你可以执行
system("quota sopper | grep / | awk '{print $2;}'")
来取得用户"sopper"的磁盘限额