dpns_listreplicax man page

DPNS_LISTREPLICAX(3)        DPNS Library Functions        DPNS_LISTREPLICAX(3)

      dpns_listreplicax    -    list    replica    entries    for   a   given

      [1m#include <sys/types.h>[0m
      [1m#include "dpns_api.h"[0m

      [1mstruct dpns_filereplica *dpns_listreplicax (const char *[4m[22mpoolname[24m[1m, const[0m
      [1mchar *[4m[22mserver[24m[1m, const char *[4m[22mfs[24m[1m, int [4m[22mflags[24m[1m, dpns_list *[4m[22mlistp[24m[1m)[0m

      [1mdpns_listreplicax     [22mlists     replica    entries    for    a    given
      pool/server/filesystem.  This routine returns a pointer to a  structure
      containing the current replica entry.

      struct dpns_filereplica {
           u_signed64     fileid;
           u_signed64     nbaccesses;
           time_t         atime;         /* last access to replica */
           time_t         ptime;         /* replica pin time */
           char      status;
           char      f_type;        /* 'V' for Volatile, 'P' for Permanent */
           char      poolname[CA_MAXPOOLNAMELEN+1];
           char      host[CA_MAXHOSTNAMELEN+1];
           char      fs[80];
           char      sfn[CA_MAXSFNLEN+1];

             specifies the disk pool (only meaningful for the DPM).

      [4mserver[24m specifies the Storage Element or disk server hostname.

      [4mfs[24m     specifies the file system (only meaningful for the DPM).

      [4mflags[24m  may be one of the following constant:

                    the  first  call must have this flag set to allocate buf-
                    fers and initialize pointers.

                    all the following calls must have this flag set.

                    final call to terminate the list and free resources.

      This routine returns a pointer to a structure  containing  the  current
      replica  entry  if  the operation was successful or NULL if all entries
      have been returned or if the operation failed. In the latter case, [1mser-[0m
      [1mrno [22mis set appropriately.

      A  C  program  listing  the files residing on a given server could look

           int flags;
           dpns_list list;
           struct dpns_filereplica *lp;

           flags = CNS_LIST_BEGIN;
           while ((lp = dpns_listreplicax (NULL, server, NULL, flags, &list))) {
                flags = CNS_LIST_CONTINUE;
                /* process the entry */
           (void) dpns_listreplicax (NULL, server, NULL, CNS_LIST_END, &list);

      [1mENOMEM       [22mMemory could not be allocated for the output buffer.

      [1mEFAULT       [4m[22mpoolname[24m, [4mserver[24m and [4mfs[24m are NULL pointers or  [4mlistp[24m  is  a
                   NULL pointer.

      [1mEINVAL       [22mThe  length  of  [4mpoolname[24m exceeds [1mCA_MAXPOOLNAMELEN [22mor the
                   length of [4mserver[24m exceeds [1mCA_MAXHOSTNAMELEN [22mor  the  length
                   of [4mfs[24m exceeds 79.

      [1mSENOSHOST    [22mHost unknown.

      [1mSENOSSERV    [22mService unknown.

      [1mSECOMERR     [22mCommunication error.

      [1mENSNACT      [22mName server is not running or is being shutdown.

[1mSEE ALSO[0m
      [1mCastor_limits(4)[22m, [1mdpns_addreplica(3)[0m

DPNS                     $Date: 2005/07/21 08:31:48 $     DPNS_LISTREPLICAX(3)