2004 by Marc J. Rochkind. All rights reserved. Portions marked "Open Source" may be copied under license.

 

Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

c7/smi_shm.c File Reference


Detailed Description

SMI - System V shared memory [Sec. 7.13.3].

Definition in file smi_shm.c.

Go to the source code of this file.

Compounds

union  semun
struct  SMIQ_SHM

Defines

#define SEMI_READ   0
#define SEMI_WRITE   1
#define SEMI_POST   1
#define SEMI_WAIT   -1
#define MAX_ATTACHED   20

Functions

void mkshm_name_server (const SMIQ_SHM *p, char *shmname, size_t shmname_max)
int op_semi (int semid, int sem_num, int sem_op)
int init_semi (int semid)
void * getaddr (int shmid)
SMIQsmi_open_shm (const char *name, SMIENTITY entity, size_t msgsize)
bool smi_close_shm (SMIQ *sqp)
bool smi_send_getaddr_shm (SMIQ *sqp, struct client_id *client, void **addr)
bool smi_send_release_shm (SMIQ *sqp)
bool smi_receive_getaddr_shm (SMIQ *sqp, void **addr)
bool smi_receive_release_shm (SMIQ *sqp)


Define Documentation

#define MAX_ATTACHED   20
 

Definition at line 95 of file smi_shm.c.

Referenced by getaddr().

#define SEMI_POST   1
 

Definition at line 28 of file smi_shm.c.

#define SEMI_READ   0
 

Definition at line 26 of file smi_shm.c.

#define SEMI_WAIT   -1
 

Definition at line 29 of file smi_shm.c.

#define SEMI_WRITE   1
 

Definition at line 27 of file smi_shm.c.


Function Documentation

void* getaddr int  shmid  )  [static]
 

Definition at line 97 of file smi_shm.c.

References clock(), EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, MAX_ATTACHED, shmat(), shmdt(), and time().

int init_semi int  semid  )  [static]
 

Definition at line 74 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, op_semi(), semctl(), SEMI_POST, SEMI_READ, SEMI_WRITE, and semun::val.

Referenced by smi_open_shm().

void mkshm_name_server const SMIQ_SHM p,
char *  shmname,
size_t  shmname_max
[static]
 

Definition at line 52 of file smi_shm.c.

References SMIQ_SHM::sq_name.

Referenced by smi_close_pshm(), smi_close_shm(), smi_open_pshm(), and smi_open_shm().

int op_semi int  semid,
int  sem_num,
int  sem_op
[static]
 

Definition at line 58 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, sembuf::sem_flg, sembuf::sem_num, sembuf::sem_op, and semop().

Referenced by init_semi(), smi_close_pshm(), smi_receive_getaddr_pshm(), smi_receive_getaddr_shm(), smi_receive_release_pshm(), smi_receive_release_shm(), smi_send_getaddr_pshm(), smi_send_getaddr_shm(), smi_send_release_pshm(), and smi_send_release_shm().

bool smi_close_shm SMIQ sqp  ) 
 

Definition at line 228 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, getaddr(), mkshm_name_server(), SMIQ_SHM::msg_client, SMIQ_SHM::msg_server, semctl(), shmctl(), shmdt(), SMI_SERVER, SMIQ_SHM::sq_entity, SMIQ_SHM::sq_semid_client, SMIQ_SHM::sq_semid_server, SMIQ_SHM::sq_shmid_client, SMIQ_SHM::sq_shmid_server, and unlink().

SMIQ* smi_open_shm const char *  name,
SMIENTITY  entity,
size_t  msgsize
 

Definition at line 154 of file smi_shm.c.

References semun::buf, close(), EC_CLEANUP_BGN, EC_CLEANUP_END, EC_FAIL, ec_neg1, ec_null, errno, ftok(), init_semi(), mkshm_name_server(), SMIQ_SHM::msg_client, SMIQ_SHM::msg_server, open(), PERM_FILE, semid_ds::sem_otime, semctl(), semget(), SEMI_WRITE, SERVER_NAME_MAX, shmat(), shmctl(), shmget(), sleep(), smi_client_nowait, SMI_SERVER, SMIQ, SMIQ_SHM::sq_entity, SMIQ_SHM::sq_name, SMIQ_SHM::sq_semid_client, SMIQ_SHM::sq_semid_server, SMIQ_SHM::sq_shmid_client, and SMIQ_SHM::sq_shmid_server.

bool smi_receive_getaddr_shm SMIQ sqp,
void **  addr
 

Definition at line 317 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, SMIQ_SHM::msg_client, SMIQ_SHM::msg_server, op_semi(), SEMI_READ, SEMI_WAIT, SMI_SERVER, SMIQ_SHM::sq_entity, SMIQ_SHM::sq_semid_client, and SMIQ_SHM::sq_semid_server.

bool smi_receive_release_shm SMIQ sqp  ) 
 

Definition at line 338 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, op_semi(), SEMI_POST, SEMI_WRITE, SMI_SERVER, SMIQ_SHM::sq_entity, SMIQ_SHM::sq_semid_client, and SMIQ_SHM::sq_semid_server.

bool smi_send_getaddr_shm SMIQ sqp,
struct client_id *  client,
void **  addr
 

Definition at line 274 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, ec_null, getaddr(), SMIQ_SHM::msg_server, op_semi(), SEMI_WAIT, SEMI_WRITE, SMI_SERVER, SMIQ_SHM::sq_client, SMIQ_SHM::sq_entity, SMIQ_SHM::sq_semid_client, SMIQ_SHM::sq_semid_server, and SMIQ_SHM::sq_shmid_client.

bool smi_send_release_shm SMIQ sqp  ) 
 

Definition at line 300 of file smi_shm.c.

References EC_CLEANUP_BGN, EC_CLEANUP_END, ec_neg1, op_semi(), SEMI_POST, SEMI_READ, SMI_SERVER, SMIQ_SHM::sq_client, SMIQ_SHM::sq_entity, and SMIQ_SHM::sq_semid_server.


Generated on Fri Apr 23 10:57:10 2004 for AUP2 Example Source by doxygen 1.3.1