当前位置: 动力学知识库 > 问答 > 编程问答 >

understanding system call dup()?

问题描述:

Wanted to know what happens to the global file table and inode table when I do dup()

I know it returns an int, and it opens a new file descriptor in the file descriptor table

网友答案:

The dup call does not alter the inode or any system table. It only alters the file descriptor table which is a process related table.

I think these 2 questions might help you understand what dup actually does. Difference between creating a duplicate file descriptor using dup() and creating a hard link? dup2 / dup - why would I need to duplicate a file descriptor ?

Bottom-line : Dup doesn't affect the system in anyway , just the process.

分享给朋友:
您可能感兴趣的文章:
随机阅读: