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

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

nshmget(3)

Contents


NAME    [Toc]    [Back]

       nshmget  - Returns (or creates) the ID for a shared memory
       region (libnuma library)

SYNOPSIS    [Toc]    [Back]

       #include <numa.h> #include <sys/shm.h>

       int nshmget(
               key_t key,
               size_t size,
               int shmflg,
               memalloc_attr_t *attr );

PARAMETERS    [Toc]    [Back]

       Specifies  the  key  that  identifies  the  shared  memory
       region. The value for the key parameter can be IPC_PRIVATE
       or a random number other than zero (0). If  the  value  of
       key is IPC_PRIVATE, it can be used to assure the return of
       a new, unused shared memory region.  Specifies the minimum
       number of bytes to allocate for the region.  Specifies the
       creation flags. See shmget(2) for a description  of  these
       flags.    Points   to   a  memory  allocation  policy  and
       attributes structure. If the specified key does not exist,
       and  a  shared  memory region is created, these attributes
       will be assigned to the memory object  created  to  manage
       the shared memory region.

DESCRIPTION    [Toc]    [Back]

       If  the  attr  argument  is  NULL,  the nshmget() function
       behaves identically to the shmget() function.

       If the attr argument is non-NULL, it points  to  a  memory
       allocation  policy and attributes structure that specifies
       where the pages should be allocated for  a  newly  created
       shared  memory region. To change the policy of an existing
       shared memory region, use the nmadvise() function.

       If the mattr_policy member of the structure pointed to  by
       attr   is   MPOL_DIRECTED  and  the  mattr_rad  member  is
       RAD_NONE, the system will  choose  the  Resource  Affinity
       Domain  (RAD)  where the pages of the shared memory region
       will be allocated from among the  RADs  specified  in  the
       mattr_radset  member of *attr.  If the mattr_radset member
       is the empty set, the system will select  a  RAD  for  the
       memory  object  from among all of the RADs in the caller's
       partition, and the overflow set will be the empty set.

RETURN VALUES    [Toc]    [Back]

       Success.  Failure. In this case, errno is set to  indicate
       the error.

ERRORS    [Toc]    [Back]

       The  nshmget()  function returns errors for all the conditions
 that are documented for the shmget()  function.   In
       addition,  the  nshmget() function sets errno for the following:
 A non-NULL attr  argument  points  to  an  invalid
       address.   The  structure  pointed to by the attr argument
       contains an invalid memory allocation policy or an invalid
       RAD number. (The RAD number is less than 0 or greater than
       nrads.) This error can also occur if the memory allocation
       policy  is  MPOL_STRIPED, but the specified stride (stripe
       width) is 0 pages.

SEE ALSO    [Toc]    [Back]

      
      
       Functions: shmget(2), nmadvise(3), numa_intro(3)

       Files: numa_types(4), shmid_ds(4)



                                                       nshmget(3)
[ Back ]
 Similar pages
Name OS Title
shmdt Tru64 Detach a shared memory region
shmat Tru64 Attach a shared memory region
shmid_ds Tru64 Defines a shared memory region
shmget Tru64 Return (and possibly create) the ID for a shared memory region
msem_init Tru64 Initialize a semaphore in a mapped file or shared memory region
nfork Tru64 Creates a child process (libnuma library)
rad_fork Tru64 Creates a new process on a Resource Affinity Domain (libnuma library)
nsg_get_nsgs Tru64 Returns a list NUMA Scheduling Groups (libnuma library)
numa_query_pid Tru64 Returns NUMA-related information for the specified process identifier (libnuma library)
rad_get_current_home Tru64 Returns the caller's home Resource Affinity Domain (libnuma library)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service