来源:微信公众号「编程学习基地」 重定向 dup函数 头文件及函数定义: dup2函数 头文件及其定义 dup函数 头文件及函数定义: #include <unistd.h> int dup(int oldfd); 示例程序: #include<stdio.h> #