我是否应该包含手册页概要中列出的任何或所有标题?

rig*_*old 7 c linux bsd posix manpage

例如,取open(2),其中包含以下概要:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode);
Run Code Online (Sandbox Code Playgroud)

我应该包括所有这些头文件还是其中任何一个?在前一种情况下,我如何知道哪些头文件包含哪些函数,宏和typedef?

tab*_*top 7

你应该包括所有这些.POSIX规范将告诉您每个中的内容(例如,是fcntl.h的POSIX规范),或者至少保证每个中的内容.