environment/sysvipclimits.c
///////////////////////////////////////////////////////////////////////////////
// Filename: sysvipclimits.c
///////////////////////////////////////////////////////////////////////////////
// Purpose: obtain the maximum nuber of System V IPC objects per process
///////////////////////////////////////////////////////////////////////////////
// History:
// ========
//
// Date Time Name Description
// -------- -------- -------- ------------------------------------------------
// 96/03/18 04:42:38 muellerg: created
//
///////////////////////////////////////////////////////////////////////////////
// Feature test switches ///////////////////////////// Feature test switches //
/* NONE */
// System headers /////////////////////////////////////////// System headers //
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/msg.h>
#include <sys/sem.h>
// Local headers ///////////////////////////////////////////// Local headers //
#include "../common.h"
// Macros /////////////////////////////////////////////////////////// Macros //
/* NONE */
// File scope objects /////////////////////////////////// File scope objects //
const int max_try = 1000; // how many IPC objects at best?
const int SHM_MODE = (SHM_R | SHM_W); // read and write
const int MSG_MODE = 0666; // MSG_R | MSG_W; // read and write
const int SEM_MODE = 0666; // SEM_R | SEM_A; // read and alter
const int SHM_SIZE = 4096; // size of shared memory segemnt
// External variables, functions, and classes ///////////// External objects //
/* NONE */
// Signal catching functions ///////////////////// Signal catching functions //
/* NONE */
// Structures, unions, and class definitions /////////////////// Definitions //
struct sysvinfo
{
int id; // key for System V IPC object
// this is only needed for shared memory:
char *shmptr; // pointer to shared memory
};