Return the pathname associated with an ID
#include <sys/resmgr.h> int resmgr_pathname( int id, unsigned flags, char* path, int maxbuf );
- The link ID that resmgr_attach() returned.
- Flags that affect the operation:
- _RESMGR_PATHNAME_LOCALPATH — get a shortened pathname that's usable only on the local machine. By default, this function gets a globally unique pathname.
- A pointer to a buffer where the function can store the path name.
- The size of the buffer.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The resmgr_pathname() function returns the pathname associated with an id that's returned from resmgr_attach(), it's also the ctp->id value of all the resmgr callout functions.
If the id was obtained from calling resmgr_attach() with _RESMGR_FLAG_DIR specified, then the path name includes a trailing slash.
By default, this function calls:
netmgr_ndtostr(ND2S_DIR_SHOW, nd, buf, sizeofbuf)
If you specify _RESMGR_PATHNAME_LOCALPATH, it calls
netmgr_ndtostr(ND2S_DIR_SHOW|ND2S_LOCAL_STR, nd, buf, sizeofbuf)
to return a shortened path that's usable on your local node only. This is useful for display.
The length of the path, including the terminating NULL character, or -1 if an error occurs ( errno is set).
- A fault occurred in a server's address space when it tried to access the caller's message buffers.
- The thread indicated by ctp -> rcvid doesn't exist or its connection is detached.
- A fault occurred when the kernel tried to access the buffers provided.
Last modified: 2013-12-23