最终,我希望能够不需要在网上查找示例就能知道如何使用函数。
例如,如果我执行man 2 mkfifo
,它会显示:
NAME
mkfifo -- make a fifo file
SYNOPSIS
#include <sys/types.h>
#include <sys/stat.h>
int
mkfifo(const char *path, mode_t mode);
DESCRIPTION
Mkfifo() creates a new fifo file with name path. The access permissions are specified by mode and restricted by the umask(2) of the calling process.
The fifo's owner ID is set to the process's effective user ID. The fifo's group ID is set to that of the parent directory in which it is created.
const char *path
相当容易理解,我没有问题使用它来调用 mkfifo 函数,但我更关心的是 mode_t 参数。 man 手册对 mode 的说明很少,但没有解释如何使用它来调用函数。
有没有办法通过 man 手册来理解这样的参数?
我尝试了 man mode_t
,man mode
,但什么都没有出现。
open()
的模式位。 - jxh