Open a file identified by a path--roughly speaking an in-kernel open(2).
- macOS 10.4+
Path to look up.
e.g. O_NONBLOCK, O_APPEND; see bsd/sys/fcntl.h.
Permissions with which to create file if it does not exist.
Same as vnode_lookup().
Destination for vnode.
Context with which to authorize open/creation.
0 for success or an error code.
If vnode_open() succeeds, it returns with both an iocount and a usecount on the returned vnode. These must be released eventually; the iocount should be released with vnode_put() as soon as any initial operations on the vnode are over, whereas the usecount should be released via vnode_close().