*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> radsetdestroy (3)              
Title
Content
Arch
Section
 

radsetops(3)

Contents


NAME    [Toc]    [Back]

       radsetops,  radaddset, radandset, radcopyset, radcountset,
       raddelset, raddiffset, rademptyset, radfillset,  radisemptyset,
 radismember, radorset, radsetcreate, radsetdestroy,
       radxorset - Perform operations on a set of Resource Affinity
 Domains (libnuma library)

SYNOPSIS    [Toc]    [Back]

       #include <radset.h>

       int radaddset(
               radset_t set,
               radid_t radid ); int radandset(
               radset_t set_src1,
               radset_t set_src2,
               radset_t set_dst ); int radcopyset(
               radset_t set_src,
               radset_t set_dst ); int radcountset(
               radset_t set ); int raddelset(
               radset_t set,
               radid_t radid ); int raddiffset(
               radset_t set_src1,
               radset_t set_src2,
               radset_t set_dst ); int rademptyset(
               radset_t set ); int radfillset(
               radset_t set ); int radisemptyset(
               radset_t set ); int radismember(
               radset_t set,
               radid_t radid ); int radorset(
               radset_t set_src1,
               radset_t set_src2,
               radset_t set_dst ); int radsetcreate(
               radset_t *set ); int radsetdestroy(
               radset_t *set ); int radxorset(
               radset_t set_src1,
               radset_t set_src2,
               radset_t set_dst );

PARAMETERS    [Toc]    [Back]

       Identifies  the  RAD  for which the function is requesting
       information or on which the function operates.   Specifies
       or  points to a set of Resource Affinity Domains (RADs) on
       which the function operates.  Specifies, depending on  the
       function,  one of the following: A source RAD set that the
       function copies to a destination RAD set One  of  two  RAD
       sets for which the function will find a logical difference
       One of two RAD sets on which the function will  perform  a
       logical  AND,  OR, or XOR operation Specifies the destination
 RAD set where the function stores the results of  the
       logical operation it performs.

DESCRIPTION    [Toc]    [Back]

       The  radsetops  primitives  manipulate  a specified set of
       Resource Affinity Domains (RADs).  These functions operate
       on  data  objects  (of  type radset_t) that are created by
       calls to radsetcreate().

       The radsetcreate() function allocates, and sets to  empty,
       the specified RAD set.

       The  radsetdestroy()  function releases the RAD set memory
       allocated by radsetcreate().

       The radfillset() function initializes  the  specified  RAD
       set,  such  that all RADs that are currently configured in
       the caller's partition are included in that set.

       The radcountset() function returns the number  of  members
       in the specified RAD set.

       The rademptyset() function reinitializes the specified RAD
       set, such that no RADs are included in that set.

       The radisemptyset() function tests whether  the  specified
       RAD set is empty.

       The radismember() function tests whether the specified RAD
       is a member of the specified RAD set.

       The radaddset() and raddelset() functions respectively add
       or delete the specified RAD from the specified RAD set.

       The  raddiffset()  function  finds  the logical difference
       between the RAD sets specified by the  arguments  set_src1
       and  set_src2  and stores the result in the RAD set specified
 by set_dst. (The result is made up of  those  members
       included in set_src1 but not in set_src2.)

       The   radandset(),  radorset(),  and  radxorset()functions
       respectively perform a logical AND, OR, or  XOR  operation
       on  the  RAD  sets specified by the arguments set_src1 and
       set_src2, storing the result in the RAD set  specified  by
       set_dst.

RETURN VALUES    [Toc]    [Back]

       The radisemptyset() and radismember() functions return the
       following values: Success (True).  Success (False).  Failure.
  In  this  case, errno is set to indicate the type of
       error.

       The remaining functions return the following values:  Success.
  Failure. In this case, errno is set to indicate the
       type of error.

ERRORS    [Toc]    [Back]

       If the radcountset(), rademptyset(), radfillset(),  radisemptyset(),
 radorset(), radxorset(), radandset(), raddiffset(),
 and radcopyset() functions fail, they set errno  to
       the following value for the specified condition specified:
       The specified RAD set is invalid, possibly not created  by
       radsetcreate().

       If  the radsetcreate() and radsetdestroy() functions fail,
       they set errno to one of the following values for the condition
  specified:  The  set argument points to an invalid
       address.  (radsetcreate() only) No memory could  be  allocated
 for the RAD set.

       If  the  radaddset(), raddelset(), and radismember() functions
 fail, they set errno to one of the following  values
       for  the  condition  specified:  The  specified RAD set is
       invalid, possibly  not  created  by  radsetcreate().   The
       value  of  radid  is an invalid or unsupported RAD identifier.





EXAMPLES    [Toc]    [Back]

       The following example demonstrates various  operations  on
       RAD sets:


       #include <radset.h>

       int main() {
          radset_t radset, radset2;

          /* Create radsets - initialized as empty */
          radsetcreate(&radset);
          radsetcreate(&radset2);

          /* demonstrate radset operations */

          /* add rad 0 to radset */
          if (radaddset(radset, 0) == -1) {
                  perror("radaddset");
                  return 0;
          }


          /* copy radset to radset2 */
          if (radcopyset(radset, radset2) == -1) {
                  perror("radcopyset");
                  return 0;
          }

          /* add rad 1 to radset */
          if (radaddset(radset, 1) == -1) {
                  perror("radaddset");
                  return 0;
          }

          /* store the difference of radset and radset2 in radset
       */
          if (raddiffset(radset, radset2, radset) == -1) {
                  perror("raddiffset");
                  return 0;
          }

          /* Enumerate radset. */
          while (1) {
                  radid_t id;
                  int flags = SET_CURSOR_CONSUME;
                  rad_cursor_t rad_cursor = SET_CURSOR_INIT;

                  id = rad_foreach(radset, flags, &rad_cursor);

                  if (id == RAD_NONE) {
                          printf("\n");
                          break;
                  } else {
                          printf("%3d ", id);
                  }
          }

          /* Destroy radset and radset2*/
          radsetdestroy(&radset);
          radsetdestroy(&radset2);
          return 0; }



SEE ALSO    [Toc]    [Back]

      
      
       Functions: numa_intro(3), rad_foreach(3)

       Files: numa_types(4)



                                                     radsetops(3)
[ Back ]
 Similar pages
Name OS Title
nloc Tru64 Queries the NUMA Topology or Resource Affinity Domains (libnuma library)
rad_detach_pid Tru64 Detach a process from a Resource Affinity Domain by pid (libnuma library)
rad_foreach Tru64 Enumerates the members of a Resource Affinity Domain (libnuma library)
rad_fork Tru64 Creates a new process on a Resource Affinity Domain (libnuma library)
rad_get_current_home Tru64 Returns the caller's home Resource Affinity Domain (libnuma library)
rad_get_max Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_freemem Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_cpus Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_state Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_num Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service