Unix and Linux Discussions Tagged with shared memory |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
1 |
3,259 |
Programming |
|
|
|
4 |
1,822 |
Programming |
|
|
|
2 |
2,619 |
Programming |
|
|
|
2 |
3,276 |
Programming |
|
|
|
13 |
4,182 |
Programming |
|
|
|
3 |
3,584 |
Infrastructure Monitoring |
|
|
|
8 |
7,297 |
Programming |
|
|
|
2 |
5,170 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
3,336 |
AIX |
|
|
|
2 |
7,653 |
Programming |
|
|
|
3 |
9,803 |
UNIX for Advanced & Expert Users |
|
|
|
0 |
2,356 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
14,424 |
HP-UX |
|
|
|
1 |
3,963 |
Solaris |
|
|
|
2 |
7,892 |
Linux |
|
|
|
0 |
1,301 |
Software Releases - RSS News |
|
|
|
0 |
4,116 |
AIX |
|
|
|
1 |
6,815 |
Programming |
|
|
|
2 |
5,907 |
Programming |
|
|
|
2 |
5,358 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,798 |
Programming |
|
|
|
2 |
3,503 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,043 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
10,530 |
Programming |
SHMGET(2) BSD System Calls Manual SHMGET(2)
NAME
shmget -- get shared memory area identifier
SYNOPSIS
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int
shmget(key_t key, int 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.
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
[EACESS] 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.
[ENOSPC] A new shared memory indentifier could not be created because the system limit for the number of shared memory identifiers
has been reached.
[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.
SEE ALSO
shmctl(2), shmat(2), shmdt(2)
BSD
August 17, 1995 BSD