[转载] why need dup?# Unix - 噫吁兮,危乎高哉
f*r
1 楼
【 以下文字转载自 Linux 讨论区 】
【 原文由 flyinghair 所发表 】
in some software, when accept a connection and be ready to
read from or write to this socket, it will make a copy of
the file descriptor of this socket by dup(). Then this
copy will be used instead of the real( original) file descriptor.
What is the intention of this?
Sounds useless.
【 原文由 flyinghair 所发表 】
in some software, when accept a connection and be ready to
read from or write to this socket, it will make a copy of
the file descriptor of this socket by dup(). Then this
copy will be used instead of the real( original) file descriptor.
What is the intention of this?
Sounds useless.