Subversion Repositories tendra.SVN

Rev

Rev 78 | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __TENDRA_SYS_SEM_H
#define __TENDRA_SYS_SEM_H


/*
 * semop's sops parameter structure
 */
struct sembuf {
        unsigned short  sem_num;        /* semaphore # */
        short           sem_op;         /* semaphore operation */
        short           sem_flg;        /* operation flags */
};
#define SEM_UNDO        010000

struct semid_ds {
        struct ipc_perm sem_perm;       /* operation permission struct */
        struct sem      *__sem_base;    /* pointer to first semaphore in set */
        unsigned short  sem_nsems;      /* number of sems in set */
        time_t          sem_otime;      /* last operation time */
        time_t          sem_ctime;      /* last change time */
                                        /* Times measured in secs since */
                                        /* 00:00:00 UTC, Jan. 1, 1970, without leap seconds */
};


/*
 * commands for semctl
 */
#define GETNCNT 3       /* Return the value of semncnt {READ} */
#define GETPID  4       /* Return the value of sempid {READ} */
#define GETVAL  5       /* Return the value of semval {READ} */
#define GETALL  6       /* Return semvals into arg.array {READ} */
#define GETZCNT 7       /* Return the value of semzcnt {READ} */
#define SETVAL  8       /* Set the value of semval to arg.val {ALTER} */
#define SETALL  9       /* Set semvals from arg.array {ALTER} */
#define SEM_STAT 10     /* Like IPC_STAT but treats semid as sema-index */
#define SEM_INFO 11     /* Like IPC_INFO but treats semid as sema-index */


#endif