/*
* 编写一个与3.12节中dup2功能相同的函数,要求不调用fcntl函数,并且要有正确的出错处理
* If oldfd is not a valid file descriptor, then the call fails, and newfd is not closed.
* If oldfd is a valid file descriptor, and newfd has the same value as oldfd,
* then dup2() does nothing, and returns newfd.
*/
#include <unistd.h>
#include <stdio.h>
int mydup2(int oldfd,
编写一个与dup2功能相同的函数,要求不调用fcntl函数,并且要有正确的出错处理
最新推荐文章于 2020-09-29 21:21:20 发布