ipc unit
Unix Inter Process Communication functionality.
This document describes the IPC unit for Free Pascal. It was written for Linux by Michael Van Canneyt. It gives all the functionality of System V Inter-Process Communication: shared memory, semaphores and messages. It works only on the Linux operating system.
Many constants here are provided for completeness only, and should under normal circumstances not be used by the programmer.
Classes and records
TIPC_Perm | record | Record used in all IPC systems to specify the permissions. |
TMSG | record | Record used in the handling of message queues. Do not use directly. |
TMSGbuf | record | Generic message data record. |
TMSQid_ds | record | Record returned by the call, contains all data about a message queue. |
TSEMbuf | record | Record used in call. |
TSEMid_ds | record | Structure returned by the call, contains all data of a semaphore. |
TSEMun | record | Record used in call. |
TSHM_info | record | |
TShmid_ds | record | Record used in the call to set or retrieve settings for shared memory. |
TSHMinfo | record | Record used by the shared memory system, Do not use directly. |
Procedures and functions
ftok | function | Create token from filename. |
msgctl | function | Perform various operations on a message queue. |
msgget | function | Return message queue ID, possibly creating the queue. |
msgrcv | function | Retrieve a message from the queue. |
msgsnd | function | Send a message to the message queue. |
semctl | function | Perform various control operations on a semaphore set. |
semget | function | Return the ID of a semaphore set, possibly creating the set. |
semop | function | Perform semaphore operation. |
semtimedop | function | Perform semaphore operation using timeout. |
shmat | function | Attach a shared memory block. |
shmctl | function | Perform control operations on a shared memory block. |
shmdt | function | Detach shared memory block. |
shmget | function | Return the ID of a shared memory block, possibly creating it. |
Types
key_t | type | Alias for type. |
msglen_t | type | Message length type. |
msgqnum_t | type | Message queue number type. |
PIPC_Perm | type | Pointer to record. |
PMSG | type | Pointer to record. |
PMSGbuf | type | Pointer to record. |
PMSQid_ds | type | Pointer to . |
PSEMbuf | type | Pointer to record. |
PSEMid_ds | type | Pointer to record. |
PSEMinfo | type | Pointer to record. |
PSEMun | type | Pointer to record. |
PSHM_info | type | |
PShmid_DS | type | Pointer to record. |
TKey | type | Type returned by the key generating function. |
Constants
IPC_CREAT | constant | Create if key is nonexistent. |
IPC_EXCL | constant | fail if key exists. |
IPC_INFO | constant | For ipcs call. |
IPC_NOWAIT | constant | return error on wait. |
IPC_PRIVATE | constant | |
IPC_RMID | constant | Remove resource. |
IPC_SET | constant | set ipc_perm options. |
IPC_STAT | constant | get ipc_perm options. |
MSG_EXCEPT | constant | Internal Message control code. Do not use. |
MSG_NOERROR | constant | Internal Message control code. Do not use. |
MSGMAX | constant | Internal Message control code. Do not use. |
MSGMNB | constant | Internal Message control code. Do not use. |
MSGMNI | constant | Internal Message control code. Do not use. |
SEM_GETALL | constant | Semaphore operation: Get all semaphore values. |
SEM_GETNCNT | constant | Semaphore operation: Get number of processes waiting for resource. |
SEM_GETPID | constant | Semaphore operation: Get process ID of last operation. |
SEM_GETVAL | constant | Semaphore operation: Get current value of semaphore. |
SEM_GETZCNT | constant | Semaphore operation: Get number of processes waiting for semaphores to reach zero. |
SEM_SEMMNI | constant | Semaphore operation: ? |
SEM_SEMMNS | constant | Semaphore operation: ? |
SEM_SEMMSL | constant | Semaphore operation: ? |
SEM_SEMOPM | constant | Semaphore operation: ? |
SEM_SEMVMX | constant | Semaphore operation: ? |
SEM_SETALL | constant | Semaphore operation: Set all semaphore values. |
SEM_SETVAL | constant | Semaphore operation: Set semaphore value. |
SEM_UNDO | constant | Constant for use in . |
SHM_LOCK | constant | This constant is used in the call. |
SHM_R | constant | This constant is used in the call. |
SHM_RDONLY | constant | This constant is used in the call. |
SHM_REMAP | constant | This constant is used in the call. |
SHM_RND | constant | This constant is used in the call. |
SHM_UNLOCK | constant | This constant is used in the call. |
SHM_W | constant | This constant is used in the call. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
