Create a node in the path space that represents the mountpoint of a device or filesystem
#include <sys/pathmgr.h> int pathmgr_link( const char *path, uint32_t nd, pid_t pid, int chid, unsigned handle, enum _file_type file_type, unsigned flags );
For more information, see “The flags argument,” below.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pathmgr_link() function creates a node in the path space that represents the mountpoint of a device or filesystem. It implements high-level APIs such as name_attach() and resmgr_attach(). You probably don't need to call pathmgr_link() directly.
The nd, pid, chid, and handle together identify who handles the specified path; for more information, see “The client's view” in the Resource Managers chapter of Getting Started with QNX Neutrino.
The flags argument specifies additional information to control the pathname resolution:
|Attached path||Opened path||PATHMGR_FLAG_DIR set||PATHMGR_FLAG_DIR clear|
|/a/b||/a/b||Match ""||Match ""|
|/a/b||/a/b/c||Match c||No match|
|/a/b||/a/b/c/d||Match c/d||No match|
|/a/b||/a/bc||No match||No match|
You can't attach a directory pathname that contains, as a subset, an existing file pathname. Likewise, you can't attach a file pathname that's a subset of an existing directory pathname.
|Existing path||New path||New path allowed?|
|Directory /a/b||Directory /a||Yes|
|Directory /a/b||Directory /a/b/c||Yes|
|File /a/b||Directory /a||Yes|
|File /a/b||Directory /a/b/c||No; the directory is beneath a file|
|Directory /a/b||File /a||No; the directory is beneath a file|
|Directory /a/b||File /a/b/c||Yes|
|File /a/b||File /a||Yes|
|File /a/b||File /a/b/c||Yes|
|Be very careful if you set PATHMGR_FLAG_SELF because it's possible for a deadlock to occur. For more information, see “Robust implementations with Send/Receive/Reply” in the Interprocess Communication (IPC) chapter of the System Architecture guide.|
The nd (node descriptor) is a temporary numeric description of a remote node. For more information, see the Qnet Networking chapter of the System Architecture guide.
|To:||Use this function:|
|Compare two nd objects||ND_NODE_CMP()|
|Convert a nd to text||netmgr_ndtostr()|
|Convert text to a nd||netmgr_strtond()|
A unique ID for the link, or -1 if an error occurred (errno is set).
pathmgr_symlink(), pathmgr_unlink(), resmgr_attach()