$ apropos mkfifo
mkfifo (1) - make FIFOs (named pipes)
mkfifo (1posix) - make FIFO special files
mkfifo (3) - make a FIFO special file (a named pipe)
mkfifo (3posix) - make a FIFO special file
mkfifoat (3) - make a FIFO (named pipe) relative to a directory file
我正在linux和mac上编写bash脚本。
我使用linux操作系统在远程服务器上运行这个命令,它运行得非常好。
CURRENT_TIME=$(date '+%s%N')
echo "$CURRENT_TIME"
但是,当我在mac终端上运行相同的命令时,它会显示以下错误:
1654778186N: value too great for base (error token is "1654778186N")
看来mac终端没有识别'%N‘。我该怎么做才能解决mac终端上的问题?
我在我的Linux系统中使用了socket()的手册页面,我想知道它所记录的函数属于什么功能。
例如,函数int socket(int domain, int type, int protocol)。胶质细胞的功能部分吗?它是Linux内核的直接部分吗?手册的标题是Linux程序员手册。
我很想得到一个解释和澄清。
当我使用man -a close时,第一页是POSIX手册页,然后是close(2) (2表示系统api或内核函数)。这意味着至少有两个版本的close()。
例如,像这样的代码片段:
int fd = open("xxx");
........
close(fd); -----here, which version is called,
is that one from the POSIX lib, or the raw system API?
附注:因此我的linux系统为大多数系统API调用都包含了一个POSIX包装器,如何辨别我的
C搜索结果中只有rand,而man 3 random Linux手册页中只有random()。
据我所知,3在random(3)中意味着它是一个库函数。此外,您还可以从手册中看出这一点:
SYNOPSIS
#include <stdlib.h> //from the standard library
long int random(void);
那么,为什么在cppreference中没有这个random函数?