__getipc(), __getipc64()— Query interprocess communications
Standards
| Standards / Extensions | C or C++ | Dependencies |
|---|---|---|
| z/OS® UNIX | both |
Format
__getipc:#define _XOPEN_SOURCE
#include <sys/__getipc.h>
int __getipc(int token_id, IPCQPROC *bufptr, size_t buflng, int cmd);__getipc64:#define _LARGE_TIME_API
#define _XOPEN_SOURCE
#include <sys/__getipc.h>
int __getipc64(int token_id, IPCQPROC64 *bufptr, size_t buflng, int cmd);General description
The __getipc() and __getipc64() functions provide
means for obtaining information about the status of interprocess communications (IPC) resources,
message queues, semaphores, shared memory, and map service memory.
The __getipc64() function behaves exactly like
__getipc() except __getipc64() supports time beyond 03:14:07 UTC
on January 19, 2038 with a limit of 23:59:59 UTC on December 31, 9999.
The argument token_id is a number that identifies the relative position
of an IPC member in the system or specifies a message queue ID, semaphore ID, or shared memory ID.
Zero represents the first IPC member ID in the system. On the first call to
__getipc(), pass the a token_id of zero; the function
will return the token that identifies the next IPC resource to which the caller has access. Use this
token on the next call to __getipc().
The argument bufptr is the address where the data is to be stored.
The argument buflen is the length of the buffer.
- IPCQALL
- Retrieve the next shared memory, semaphore, or message queue
- IPCQMSG
- Retrieve the next message member
- IPCQSEM
- Retrieve the next semaphore member
- IPCQSHM
- Retrieve the next shared memory member
- IPCQMAP
- Retrieve the next map service memory currently allocated
- IPCQOVER
- Overview of system variables. Ignores the value of the first argument token_id.
Returned value
If successful, __getipc() returns 0.
__getipc() returns -1 and sets errno to one of
the following values: - Error Code
- Description
- EACCES
- Operation permission (read) is denied to the calling process for the member ID specified by token_id.
- EFAULT
- The argument bufptr contains an non-valid address.
- EINVAL
- The member ID specified in the argument token_id is not valid for the command specified, or the argument cmd is not a valid command.
Related information
- sys/__getipc.h — Interprocess communication
- sys/ipc.h — Interprocess communication access structure
- msgctl(), msgctl64() — Message control operations
- msgget() — Get message queue
- msgrcv() — Message receive operation
- msgsnd() — Message send operations
- msgxrcv(), msgxrcv64() — Extended message receive operation
- semctl(), semctl64() — Semaphore control operations
- semget() — Get a set of semaphores
- semop() — Semaphore operations
- shmat() — Shared memory attach operation
- shmctl(), shmctl64() — Shared memory control operations
- shmdt() — Shared memory detach operation
- shmget() — Get a shared memory segment