首页 > 解决方案 > 在 C 中运行“parsefmt”的头文件?

问题描述

最近我遇到了“ps”Linux 命令的代码,该命令利用“parsefmt”函数来获取 PID、tty 和路径等信息。但是,我不知道如何使用该功能;我已经包含了实际 ps.c 文件(https://opensource.apple.com/source/adv_cmds/adv_cmds-158/ps/ps.c.auto.html)中的所有头函数,但我仍然收到错误:

implicit declaration of function 'parsefmt' is invalid in C99

如果有人可以指导我如何使用此功能,将不胜感激。

标签: cparsingsystemheader-filestty

解决方案



推荐阅读