dup2补丁工具,Linux 系统库函数 -- dup 和 dup2

    The dupsystem calls provide a way of duplicating a file descriptor, giving us two or more different descriptors that access the same file. These might be used for reading and writing to different locations in the file. The dupsystem call duplicates a file descriptor, fildes, returning a new descriptor. The dup2 system call effectively copies one file descriptor to another by specifying the descriptor to use for the copy.

    Here’s the syntax:


#include
int dup(int fildes);
int dup2(int fildes, int fildes2);


    These calls can also be useful when you’re using multiple processes communicating via pipes.

Tags:  linux系统 系统调用库函数 dupdup2 dup2补丁工具

延伸阅读

最新评论

发表评论