Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

nshmget(3) [osf1 man page]

nshmget(3)						     Library Functions Manual							nshmget(3)

NAME
nshmget - Returns (or creates) the ID for a shared memory region (libnuma library) SYNOPSIS
#include <numa.h> #include <sys/shm.h> int nshmget( key_t key, size_t size, int shmflg, memalloc_attr_t *attr ); PARAMETERS
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
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
Success. Failure. In this case, errno is set to indicate the error. ERRORS
In addition to the error conditions for the shmget() function, the nshmget()function sets errno to one of the specified values for the specified condition: 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 invalid RAD. The striped allocation was requested with a stride of 0. SEE ALSO
Functions: shmget(2), nmadvise(3), numa_intro(3) Files: numa_types(4), shmid_ds(4) nshmget(3)

Check Out this Related Man Page

SHMGET(2)						      BSD System Calls Manual							 SHMGET(2)

NAME
shmget -- get shared memory area identifier SYNOPSIS
#include <sys/shm.h> int shmget(key_t key, size_t size, int shmflg); DESCRIPTION
shmget() returns the shared memory identifier associated with the key key. A shared memory segment is created if either key is equal to IPC_PRIVATE, or key does not have a shared memory segment identifier associated with it, and the IPC_CREAT bit is set in shmflg. If a new shared memory segment is created, the data structure associated with it (the shmid_ds structure, see shmctl(2)) is initialized as follows: o shm_perm.cuid and shm_perm.uid are set to the effective uid of the calling process. o shm_perm.gid and shm_perm.cgid are set to the effective gid of the calling process. o shm_perm.mode is set to the lower 9 bits of shmflg. o shm_lpid, shm_nattch, shm_atime, and shm_dtime are set to 0 o shm_ctime is set to the current time. o shm_segsz is set to the value of size. o The ftok(3) function may be used to generate a key from a pathname. RETURN VALUES
Upon successful completion a positive shared memory segment identifier is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS
The shmget() system call will fail if: [EACCES] A shared memory segment is already associated with key and the caller has no permission to access it. [EEXIST] Both IPC_CREAT and IPC_EXCL are set in shmflg, and a shared memory segment is already associated with key. [EINVAL] No shared memory segment is to be created, and a shared memory segment exists for key, but the size of the segment associ- ated with it is less than size, which is non-zero. [ENOENT] IPC_CREAT was not set in shmflg and no shared memory segment associated with key was found. [ENOMEM] There is not enough memory left to created a shared memory segment of the requested size. [ENOSPC] A new shared memory identifier could not be created because the system limit for the number of shared memory identifiers has been reached. LEGACY SYNOPSIS
#include <sys/types.h> #include <sys/ipc.h> #include <sys/shm.h> int shmget(key_t key, int size, int shmflg); All of these include files are necessary. The type of size has changed. SEE ALSO
ftok(3), shmat(2), shmctl(2), shmdt(2), compat(5) BSD
August 17, 1995 BSD
Man Page