PIPE 管道
官方参考手册 https://manpages.courier-mta.org/htmlman7/pipe.7.html 示例代码 // O_NOATIME 宏定义的扩展要求 #define _GNU_SOURCE 1 #include <fcntl.h>#undef _GNU_SOURCE #include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <stdlib.h>#include <pthread.h>#include <sys/time.h>#include <sys/types.h>#include <sys/stat.h>#include <linux/unistd.h>#include <assert.h>#include <limits.h> static int pip[2]; void sleep_select(int sec) { struct timeval timeout; timeout.tv_usec = 0; timeout.tv_sec = sec; select(0, NULL, NULL, NULL, &timeout); } static void *thread_read(void *userdata) { char data[5] = {0};