Sign in Join
FPDoc Onlineexperiment

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_PermrecordRecord used in all IPC systems to specify the permissions.
TMSGrecordRecord used in the handling of message queues. Do not use directly.
TMSGbufrecordGeneric message data record.
TMSQid_dsrecordRecord returned by the call, contains all data about a message queue.
TSEMbufrecordRecord used in call.
TSEMid_dsrecordStructure returned by the call, contains all data of a semaphore.
TSEMunrecordRecord used in call.
TSHM_inforecord
TShmid_dsrecordRecord used in the call to set or retrieve settings for shared memory.
TSHMinforecordRecord used by the shared memory system, Do not use directly.

Procedures and functions

ftokfunctionCreate token from filename.
msgctlfunctionPerform various operations on a message queue.
msggetfunctionReturn message queue ID, possibly creating the queue.
msgrcvfunctionRetrieve a message from the queue.
msgsndfunctionSend a message to the message queue.
semctlfunctionPerform various control operations on a semaphore set.
semgetfunctionReturn the ID of a semaphore set, possibly creating the set.
semopfunctionPerform semaphore operation.
semtimedopfunctionPerform semaphore operation using timeout.
shmatfunctionAttach a shared memory block.
shmctlfunctionPerform control operations on a shared memory block.
shmdtfunctionDetach shared memory block.
shmgetfunctionReturn the ID of a shared memory block, possibly creating it.

Types

key_ttypeAlias for type.
msglen_ttypeMessage length type.
msgqnum_ttypeMessage queue number type.
PIPC_PermtypePointer to record.
PMSGtypePointer to record.
PMSGbuftypePointer to record.
PMSQid_dstypePointer to .
PSEMbuftypePointer to record.
PSEMid_dstypePointer to record.
PSEMinfotypePointer to record.
PSEMuntypePointer to record.
PSHM_infotype
PShmid_DStypePointer to record.
TKeytypeType returned by the key generating function.

Constants

IPC_CREATconstantCreate if key is nonexistent.
IPC_EXCLconstantfail if key exists.
IPC_INFOconstantFor ipcs call.
IPC_NOWAITconstantreturn error on wait.
IPC_PRIVATEconstant
IPC_RMIDconstantRemove resource.
IPC_SETconstantset ipc_perm options.
IPC_STATconstantget ipc_perm options.
MSG_EXCEPTconstantInternal Message control code. Do not use.
MSG_NOERRORconstantInternal Message control code. Do not use.
MSGMAXconstantInternal Message control code. Do not use.
MSGMNBconstantInternal Message control code. Do not use.
MSGMNIconstantInternal Message control code. Do not use.
SEM_GETALLconstantSemaphore operation: Get all semaphore values.
SEM_GETNCNTconstantSemaphore operation: Get number of processes waiting for resource.
SEM_GETPIDconstantSemaphore operation: Get process ID of last operation.
SEM_GETVALconstantSemaphore operation: Get current value of semaphore.
SEM_GETZCNTconstantSemaphore operation: Get number of processes waiting for semaphores to reach zero.
SEM_SEMMNIconstantSemaphore operation: ?
SEM_SEMMNSconstantSemaphore operation: ?
SEM_SEMMSLconstantSemaphore operation: ?
SEM_SEMOPMconstantSemaphore operation: ?
SEM_SEMVMXconstantSemaphore operation: ?
SEM_SETALLconstantSemaphore operation: Set all semaphore values.
SEM_SETVALconstantSemaphore operation: Set semaphore value.
SEM_UNDOconstantConstant for use in .
SHM_LOCKconstantThis constant is used in the call.
SHM_RconstantThis constant is used in the call.
SHM_RDONLYconstantThis constant is used in the call.
SHM_REMAPconstantThis constant is used in the call.
SHM_RNDconstantThis constant is used in the call.
SHM_UNLOCKconstantThis constant is used in the call.
SHM_WconstantThis constant is used in the call.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.