Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Terminology nit: "file descriptor" is the reference itself. "Open file description" is the thing referenced. dup(2) and fork(2) create new file descriptors which reference the same underlying open file descriptions.


Correct, sorry! My phrasing was off-the-cuff and less than precise.

File descriptor = reference/pointer-ish thing.

File description = referenced data.

close(2) = decrement refcount to description by closing descriptor; actual destruction of the file's open-ness doesn't happen until refcount == 0.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: