Return the pathname associated with an ID
#include <sys/iofunc.h>
#include <sys/resmgr.h>
int resmgr_pathname( int id,
                     unsigned flags, 
                     char* path, 
                     int maxbuf );
libc
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).
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | Yes | 
| Thread | Yes |