|
|
Subscribe / Log in / New account

How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.

How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.

Posted Nov 5, 2025 13:55 UTC (Wed) by corbet (editor, #1)
In reply to: How is this an API quirk? It's normal and expected behaviour with file-handles in Unix. by paulj
Parent article: Namespace reference counting and listns()

Please, do not confuse file handles with file descriptors. A file handle is best thought of, perhaps, as an alternative name for the file. Just as the possession of a file's name does not cause its persistence, holding a file handle doesn't keep a file around.


to post comments

How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.

Posted Nov 5, 2025 15:26 UTC (Wed) by paulj (subscriber, #341) [Link] (1 responses)

I stand corrected. So these are a new class of handles, distinct from file descriptors, as per open_by_handle_at, and with a separate struct in the kernel it appears. I didn't realise. Thanks.

How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.

Posted Nov 5, 2025 15:46 UTC (Wed) by corbet (editor, #1) [Link]

They are new with regard to namespaces, but file handles are a fairly old concept; I think they had their origin with NFS many years ago.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds